CDN_FILEOK notification code

Sent by an Explorer-style Open or Save As dialog box when the user specifies a file name and clicks the OK button.

Your OFNHookProc hook procedure receives this message in the form of a WM_NOTIFY message.

#define CDN_FIRST               (0U-601U)
#define CDN_FILEOK              (CDN_FIRST - 0x0005)

Parameters

wParam

This parameter is not used.

lParam

A pointer to an OFNOTIFY structure.

The OFNOTIFY structure contains an NMHDR structure whose code member indicates the CDN_FILEOK notification message.

The OFNOTIFY structure also contains a pointer to an OPENFILENAME structure whose lpstrFile member specifies the address of the selected file name.

Return value

If the hook procedure returns zero, the dialog box accepts the specified file name and closes.

To reject the specified file name and force the dialog box to remain open, return a nonzero value from the hook procedure and call the SetWindowLong function to set a nonzero DWL_MSGRESULT value.

Remarks

The system sends this notification only if the dialog box was created using the OFN_EXPLORER value.

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Commdlg.h (include Windows.h)

See also

Reference

GetOpenFileName

GetSaveFileName

OFNHookProc

OFNOTIFY

OPENFILENAME

SetWindowLong

Conceptual

Common Dialog Box Library

Other Resources

WM_NOTIFY