VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

System-wide mouse and keyboard hook

Ark  (13 Submissions)   Windows API Call/Explanation   Visual Basic 3.0   Advanced   Wed 3rd February 2021

Set system-wide mouse and keyboard hook and generate 'standard' VB events (System_MouseUp/Down/Move, System_KeyUp/Down) with standard parameters (Button, Shift, X, Y, KeyCode).

Inputs
Form to receive hook notification and hook flags

Assumes
Though MSDN says that WH_JOURNALRECORD hook is thread defined, in w95/98 it allow system-wide hook when set ThreadID parameter of hook = 0. To run this code you need form with two multiline textboxes (Text1 and Text2) and one label (Label1).

Returns
Mouse/keyboard events with appropriate parameters

Side Effects
Works only with w95/98. Don't work with NT/2000. This code use hook, don't stop sample from IDE, use Form [x] button.

API Declarations
'See bas module code

Rate System-wide mouse and keyboard hook (6(6 Vote))
System-wide mouse and keyboard hook.bas

System-wide mouse and keyboard hook Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters