|
Customizing Old-Style Dialog Boxes
You can customize an old-style Open or Save As dialog box by providing an OFNHookProcOldStyle hook procedure that receives messages or notifications intended for the
default dialog box procedure. You can also provide a custom template to use in place
of the default template. The hook procedures and templates used with the
old-style dialog boxes are similar to those used with the other common dialog boxes.
For more information, see Hook Procedures for Common Dialog Boxes and Custom Templates.
To enable a hook procedure for an old-style Open or Save As dialog box, use
the OPENFILENAME structure when you create the dialog box. Set the OFN_ENABLEHOOK flag in the Flags member and specify the address of an OFNHookProcOldStyle hook procedure in the lpfnHook member. The dialog box procedure sends a WM_INITDIALOG message to the hook procedure with the lParam parameter set to the address of the OPENFILENAME structure used to initialize the dialog box.
You can use the OPENFILENAME structure to specify a custom template for the Open or Save As dialog box to
use in place of the default template. If your custom template is a resource in
an application or dynamic-link library, set the OFN_ENABLETEMPLATE flag in the Flags member and use the hInstance and lpTemplateName members of the structure to identify the module and resource name. If your
custom template is already in memory, set the OFN_ENABLETEMPLATEHANDLE flag and
use the hInstance member to identify the memory object that contains the template. Create the
custom template by modifying the default template specified in the FILEOPEN.DLG
file. The control identifiers used in the default Find and Replace dialog
templates are defined in the DLGS.H file.
By default, the GetOpenFileName and GetSaveFileName functions display the Explorer-style dialog boxes. If you want to display an
old-style dialog box, you must provide an OFNHookProcOldStyle hook procedure and ensure that the OFN_EXPLORER flag is not set in the Flags member of the OPENFILENAME structure.
If you set the OFN_EXPLORER flag, the system treats a hook procedure or custom
template as an Explorer-style customization. For information about customizing
an Explorer-style dialog box, see Explorer-Style Custom Templates.
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder
More Online Helps
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|