VB and VBA Users Source Code: Block keyboard and mouse input to an application
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Block keyboard and mouse input to an application
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Wednesday, February 21, 2001
Hits:
922
Category:
Windows API
Article:
To block keyboard and mouse input to an application use the following routine: Private Declare Function BlockInput Lib "user32" (ByVal lBlock As Long) As Long 'Purpose : Blocks all keyboard and mouse input to an application. 'Inputs : bBlock If True, blocks keyboard and mouse input, else unblocks both. 'Outputs : Returns True on success. 'Author : Andrew Baker 'Date : 11/09/2000 'Notes : 'Revisions : 'OS : Windows 2000; Windows 98 Function KeyboardBlock(bBlock As Boolean) As Boolean On Error GoTo ErrFailed Call BlockInput(CLng(bBlock)) KeyboardBlock = True Exit Function ErrFailed: KeyboardBlock = False End Function
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder