// overload for use with LowLevelKeyboardProc
[DllImport("user32.dll")]
static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, WM wParam, [In]KBDLLHOOKSTRUCT lParam);
// overload for use with LowLevelMouseProc
[DllImport("user32.dll")]
static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, WM wParam, [In]MSLLHOOKSTRUCT lParam);
VB.NET Signature:
<DllImport("user32.dll")> _
Private Shared Function CallNextHookEx(ByVal hhk As IntPtr, ByVal nCode As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
End Function
' overload for use with LowLevelKeyboardProc
<DllImport("user32.dll")> _
Private Shared Function CallNextHookEx(ByVal hhk As IntPtr, ByVal nCode As Integer, ByVal wParam As WindowsMessages, <[In]()> ByVal lParam As KBDLLHOOKSTRUCT) As IntPtr
End Function
' overload for use with LowLevelMouseProc
<DllImport("user32.dll")> _
Private Shared Function CallNextHookEx(ByVal hhk As IntPtr, ByVal nCode As Integer, ByVal wParam As WindowsMessages, <[In]()> ByVal lParam As MSLLHOOKSTRUCT) As IntPtr
End Function
VB Signature
Public Declare Function CallNextHookEx Lib "user32" _
(ByVal hHook As Long, _
ByVal ncode As Long, _
ByVal wParam As WindowsMessages, _
lParam As Any) As Long
' overload for use with LowLevelKeyboardProc
Public Declare Function CallNextHookExKbd Lib "user32" Alias "CallNextHookEx" _
(ByVal hHook As Long, _
ByVal ncode As Long, _
ByVal wParam As WindowsMessages, _
lParam As KBDLLHOOKSTRUCT) As Long
' overload for use with LowLevelMouseProc
Public Declare Function CallNextHookExMse Lib "user32" Alias "CallNextHookEx" _
(ByVal hHook As Long, _
ByVal ncode As Long, _
ByVal wParam As WindowsMessages, _
lParam As MSLLHOOKSTRUCT) As Long
The KBDLLHOOKSTRUCT structure contains information about a low-level keyboard input event
4/15/2012 5:04:48 PM - -80.75.4.115
The MSLLHOOKSTRUCT structure contains information about a low-level mouse input event.
4/1/2011 12:52:14 PM - -217.119.210.6
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 11:00:13 AM - tsahi-62.219.227.88
http://mwinapi.sourceforge.net/
3/31/2008 1:53:29 PM - -79.217.85.81
Installs a hook to monitor certain types of events.
10/24/2012 8:49:35 AM - -123.243.122.161
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).