|
-
Jan 22nd, 2010, 01:04 AM
#1
Thread Starter
Lively Member
Re: LowLevelKeyboardProc + Alt key
Ok, that’s my code. It is working, but is it correct? I mean, have I left no mistakes here?
Code:
Function LowLevelKeyboardProc(ByVal nCode As Long, ByVal wParam As Long, lParam As KBDLLHOOKSTRUCT) As Long
If nCode = HC_ACTION Then
If CBool(lParam.flags And LLKHF_ALTDOWN) Then
If lParam.vkCode = VK_TAB Then
Debug.Print "Alt+Tab allowed"
LowLevelKeyboardProc = 0
Else
Debug.Print "Alt blocked"
LowLevelKeyboardProc = -1
End If
Exit Function
End If
End If
LowLevelKeyboardProc = CallNextHookEx(0, nCode, wParam, ByVal lParam)
End Function
I have found this on msdn:
If nCode is less than zero, the hook procedure must return the value returned by CallNextHookEx.
If nCode is greater than or equal to zero, and the hook procedure did not process the message, it is highly recommended that you call CallNextHookEx and return the value it returns; otherwise, other applications that have installed WH_KEYBOARD_LL hooks will not receive hook notifications and may behave incorrectly as a result.
According to this, my code is no correct or is it?
Last edited by riov; Jan 22nd, 2010 at 01:59 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|