Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "HookProc" in [All]

comdlg32

.

    '  LPOFNHOOKPROC lpfnHook;

.

typedef UINT_PTR (CALLBACK *LPOFNHOOKPROC) (HWND,UINT,WPARAM,LPARAM);

.

     LPOFNHOOKPROC lpfnHook;

.

    '  LPOFNHOOKPROC lpfnHook;

Delegates

.

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

.

MSDN documentation about HookProc : https://docs.microsoft.com/en-us/windows/win32/api/winuser/nc-winuser-hookproc

user32

.

Identical to HookProc

.

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


 
Access PInvoke.net directly from VS: