SetupHookProc
A SetupHookProc
hook procedure is an application-defined or library-defined callback procedure
that is used with the Print Setup common dialog box. The hook procedure
receives messages or notifications intended for the default dialog box
procedure.
UINT APIENTRY SetupHookProc(
HWND hdlg, |
// handle to the
dialog box window |
UINT uiMsg, |
// message
identifier |
WPARAM wParam, |
// message
parameter |
LPARAM lParam |
// message
parameter |
); |
|
Parameters
hdlg
Handle to the
Print Setup common dialog box window for which the message is intended.
uiMsg
Identifies
the message being received.
wParam
Specifies
additional information about the message. The exact meaning depends on the
value of the uiMsg parameter.
lParam
Specifies
additional information about the message. The exact meaning depends on the
value of the uiMsg parameter.
Return Values
If the hook
procedure returns zero, the default dialog box procedure processes the message.
If the hook
procedure returns a nonzero value, the default dialog box procedure ignores the
message.
Remarks
The Print
Setup dialog box has been superseded by the Page Setup dialog box, which should
be used by new applications written for Windows NT or Windows 95. However, for
compatibility with earlier versions of Windows, the PrintDlg
To enable the
hook procedure, use the PRINTDLG
The default
dialog box procedure processes the WM_INITDIALOG message before passing it to
the hook procedure. For all other messages, the hook procedure receives the
message first. Then, the return value of the hook procedure determines whether
the default dialog procedure processes the message or ignores it.
If the hook
procedure processes the WM_CTLCOLORDLG
Do not call
the EndDialog
You can
subclass the standard controls of the common dialog box. However, the common
dialog box procedure may also subclass the controls. Because of this, you should
subclass controls when your hook procedure processes the WM_INITDIALOG message.
This ensures that your subclass procedure receives the control-specific
messages before the subclass procedure set by the dialog box procedure.
SetupHookProc is a placeholder for the application-defined or
library-defined function name. The LPSETUPHOOKPROC type is a pointer to
a SetupHookProc hook procedure.
See Also