Results 1 to 2 of 2

Thread: Making app only available thing until ended

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2001
    Location
    South Africa
    Posts
    35

    Question Making app only available thing until ended

    Is there a way that I can make an app only allow focus on itself and nothing else until it is unloaded? I am making a test program and I don't want the users to be able to store answers in a text file on the hard drive or something and then look at them while writing.

    Thanks for help

  2. #2
    jim mcnamara
    Guest
    This keeps your window from losing focus to another window that is already activated but doesn't have focus.

    Code:
    Const HWND_TOPMOST = -1
    Const HWND_NOTOPMOST = -2
    Const SWP_NOSIZE = &H1
    Const SWP_NOMOVE = &H2
    Const SWP_NOACTIVATE = &H10
    Const SWP_SHOWWINDOW = &H40
    Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, _ 
         ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
    
    Private Sub FormOnTop()
    
        SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, _
       SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE _ 
       Or SWP_NOSIZE
    
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width