Desktop Functions: Smart Device Functions:
|
Search Results for "HookProc" in [All]Delegates1: HookProc
delegate IntPtr HookProc(int code, IntPtr wParam, IntPtr lParam);
Private Delegate Function HookProc(ByVal code As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer user322: GetMsgProc Identical to HookProc
/// C++ ( lpfn [in]. Type: HOOKPROC )<br />A pointer to the hook procedure. If the dwThreadId parameter
static extern IntPtr SetWindowsHookEx(HookType hookType, HookProc lpfn, IntPtr hMod, uint dwThreadId);
Private Shared Function SetWindowsHookEx(ByVal hookType As HookType, ByVal lpfn As HookProc, ByVal hMod As IntPtr, ByVal dwThreadId As UInteger) As IntPtr A HookProc delegate representing the hook procedure method. Used as the value passed into lpfn (long pointer to function). Remember to keep the HookProc delegate alive manually, such as using a class member as shown in the example below, otherwise the garbage collector will clean up your hook delegate eventually, resulting in your code throwing a System.NullReferenceException.
private HookProc myCallbackDelegate = null;
this.myCallbackDelegate = new HookProc(this.MyCallbackFunction);
protected static extern IntPtr SetWindowsHookEx(HookType code, HookProc func, IntPtr hInstance, int threadID);
Delegate Function HookProc(ByVal code As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Integer
Private myCallbackDelegate As HookProc = Nothing
Me.myCallbackDelegate = New HookProc(AddressOf Me.MyCallbackFunction)
Friend Shared Function SetWindowsHookEx(ByVal idHook As Integer, ByVal lpfn As HookProc, ByVal hInstance As IntPtr, ByVal threadId As Integer) As Integer comdlg32
' LPOFNHOOKPROC lpfnHook;
typedef UINT_PTR (CALLBACK *LPOFNHOOKPROC) (HWND,UINT,WPARAM,LPARAM);
LPOFNHOOKPROC lpfnHook;
' LPOFNHOOKPROC lpfnHook; |