FileDialog.HookProc(IntPtr, Int32, IntPtr, IntPtr) Method

Definition

Defines the common dialog box hook procedure that is overridden to add specific functionality to the file dialog box.

C#
protected override IntPtr HookProc(IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam);

Parameters

hWnd
IntPtr

The handle to the dialog box window.

msg
Int32

The message received by the dialog box.

wparam
IntPtr

Additional information about the message.

lparam
IntPtr

Additional information about the message.

Returns

IntPtr

Returns zero if the default dialog box procedure processes the message; returns a nonzero value if the default dialog box procedure ignores the message.

Remarks

A hook procedure allows the user to connect or insert other routines into a routine or application for the purpose of debugging or enhancing functionality.

By default, the hook procedure centers the dialog box on the screen in response to a WM_INITDIALOG message.

Notes to Inheritors

When overriding HookProc(IntPtr, Int32, IntPtr, IntPtr) in a derived class, be sure to call the base class's HookProc(IntPtr, Int32, IntPtr, IntPtr) method.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10