[Starting with Windows Vista, the Open and Save As common dialog boxes have been superseded by the Common Item Dialog. We recommended that you use the Common Item Dialog API instead of these dialog boxes from the Common Dialog Box Library.]
Applies to: desktop apps only
An Open or Save As dialog box sends the FILEOKSTRING registered message to your hook procedure, OFNHookProc, when the user specifies a file name and clicks the OK button. The hook procedure can accept the file name and allow the dialog box to close, or reject the file name and force the dialog box to remain open.
#define FILEOKSTRING TEXT("commdlg_FileNameOK")
Parameters
- wParam
-
This parameter is not used.
- lParam
-
A pointer to an OPENFILENAME structure. The lpstrFile member of this structure contains the drive, path, and file name specified by the user.
Return value
If the hook procedure returns zero, the Open or Save As dialog box accepts the specified file name and closes.
If the hook procedure returns a nonzero value, the Open or Save As dialog box rejects the specified file name and remains open.
Remarks
The hook procedure must specify the FILEOKSTRING constant in a call to the RegisterWindowMessage function to get the identifier for the message sent by the dialog box.
Requirements
|
Minimum supported client | Windows 2000 Professional |
|---|---|
|
Minimum supported server | Windows 2000 Server |
|
Header |
|
|
Unicode and ANSI names | FILEOKSTRINGW (Unicode) and FILEOKSTRINGA (ANSI) |
See also
- Reference
- CDN_FILEOK
- OPENFILENAME
- RegisterWindowMessage
- Conceptual
- Common Dialog Box Library
Send comments about this topic to Microsoft
Build date: 2/10/2012