Results 1 to 2 of 2

Thread: more screen locking help

  1. #1

    Thread Starter
    Hyperactive Member zer0_flaw's Avatar
    Join Date
    Apr 2001
    Posts
    448

    Exclamation more screen locking help

    The following was the code the guy who responded earlier told me to use:

    ---------------------------------------------------------------------------------------------
    Try using the LockWindowUpdate API function to lock all handles except your programs.

    Private Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long

    Usage
    'Lock/Freeze: LockWindowUpdate hwnd
    'Unlock/Unfreeze: LockWindowUpdate 0&

    ---------------------------------------------------------------------------------------------

    That will most likly work but I do have one question... How do I get the handles of all the other programs running? I mean the user could have any number of programs running at the time he starts mine... how do I get all their handles so I can lock them and leave mine the only one that is able to be clicked? Thanks in advance. Later,

    -zer0 flaw

  2. #2
    Megatron
    Guest
    VB Code:
    1. 'Add this to a Module
    2. Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
    3. Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
    4. Declare Function EnumWindows Lib "user32.dll" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Long
    5.  
    6. Public Function EnumWindowsProc(ByVal hwnd As Long, ByVal lParam As Long) As Long
    7.     'The hwnd argument contains the handle of the window
    8.     EnumWindowsProc = 1
    9. End Function
    10.  
    11. 'Use this line to Trigger it.
    12. EnumWindows AddressOf EnumWindowsProc, 0

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