Hi Guys,
Please help me here..the idea being whenever I run the following code, the user should not be able to use the mouse or keyboard. However- the mouse doesnt block, rather nothing freezes. guide me in the right direction.
Declare PtrSafe Function BlockInput Lib "User32.dll" (ByVal fBlockIt As Boolean) As Boolean
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub MouseKeyboardTest() 'both keyboard and mouse blocked
BlockInput True ' Turns off Keyboard and Mouse
' Routine goes here
Sleep 5000 ' Optional coding
BlockInput False ' Turns on Keyboard and Mouse
End Sub
Bookmarks