An OFNHookProcOldStyle hook procedure is an application-defined or library-defined callback procedure that is used with the Open and Save As common dialog boxes. The hook procedure receives messages or notifications intended for the dialog box procedure.
If you specify the OFN_EXPLORER flag when you create an Open or Save As common dialog box, and you want a hook procedure, you must use an Explorer-style OFNHookProc hook procedure.
UINT APIENTRY OFNHookProcOldStyle(
HWND hdlg, |
// handle to the dialog box window |
UINT uiMsg |
// message identifier |
WPARAM wParam, |
// message parameter |
LPARAM lParam |
// message parameter |
); |
If the uiMsg parameter indicates the WM_INITDIALOG message, lParam is a pointer to an OPENFILENAME structure containing the values specified when the common dialog box was created.
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.
When you use the GetOpenFileName or GetSaveFileName functions to create an old-style Open or Save As dialog box, you can provide an OFNHookProcOldStyle hook procedure. To enable the hook procedure, use the OPENFILENAME structure that you passed to the dialog creation function. Specify the pointer to the hook procedure in the lpfnHook member and specify the OFN_ENABLEHOOK flag in the Flags member.
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 message, it must return a valid brush handle for painting the background of the dialog box. In general, if the hook procedure processes any WM_CTLCOLOR* message, it must return a valid brush handle for painting the background of the specified control.
Do not call the EndDialog function from the hook procedure. Instead, the hook procedure can call the PostMessage function to post a WM_COMMAND message with the IDABORT value to the dialog box procedure. Posting IDABORT closes the dialog box and causes the dialog box function to return FALSE. If you need to know why the hook procedure closed the dialog box, you must provide your own communication mechanism between the hook procedure and your application.
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.
OFNHookProcOldStyle is a placeholder for the application-defined or library-defined function name. The LPOFNHOOKPROC type is a pointer to either an OFNHookProcOldStyle or OFNHookProc hook procedure.
GetOpenFileName, GetSaveFileName, OFNHookProc, OPENFILENAME, WM_INITDIALOG
file: /Techref/os/win/api/win32/func/src/f65_15.htm, 5KB, , updated: 2000/4/7 11:19, local time: 2024/11/25 01:57,
3.147.47.177:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/TECHREF/os/win/api/win32/func/src/f65_15.htm"> OFNHookProcOldStyle</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.