CommonDialog.HookProc(IntPtr, Int32, IntPtr, IntPtr) 方法

定义

定义要重写的通用对话框挂钩过程,以便向通用对话框添加特定功能。Defines the common dialog box hook procedure that is overridden to add specific functionality to a common dialog box.

protected:
 virtual IntPtr HookProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam);
[System.Security.SecurityCritical]
protected virtual IntPtr HookProc (IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam);
abstract member HookProc : nativeint * int * nativeint * nativeint -> nativeint
override this.HookProc : nativeint * int * nativeint * nativeint -> nativeint
Protected Overridable Function HookProc (hwnd As IntPtr, msg As Integer, wParam As IntPtr, lParam As IntPtr) As IntPtr

参数

hwnd
IntPtr

Win32Win32 对话框的窗口句柄。Window handle for the Win32Win32 dialog.

msg
Int32

要由 Win32Win32 对话框处理的 Windows 消息。Windows message to be processed by the Win32Win32 dialog.

wParam
IntPtr

用于对话框操作的参数。Parameters for dialog actions.

lParam
IntPtr

用于对话框操作的参数。Parameters for dialog actions.

返回

始终返回 ZeroAlways returns Zero.

属性

注解

HookProc通过使对话框窗口相对于屏幕居中, 并将焦点设置到默认控件来处理对话框初始化。HookProc handles dialog initialization by centering the dialog window, relative to the screen, and to set focus to the default control.

适用于