The pfild parameter is required and the FILEDLG structure must be properly initialized.

On return, the FILEDLG structure is updated with any user alterations, and the field is set to the value returned by the file dialog's WinDismissDlg function. By default, this is the ID of the push button pressed to dismiss the dialog, DID_OK or DID_CANCEL, unless the application supplied additional push buttons in its template.

For convenience, the pointer to the FILEDLG structure is placed in the QWL_USER field of the dialog's frame window. If in a custom file dialog procedure the pointer to the FILEDLG structure is desired, it should be queried from the frame window with the WinQueryWindowULong function.

To subclass the default file dialog with a new template, the application must give the module and ID of the new file dialog template and the address of a dialog procedure for message handling. Window IDs in the range 0x0000 through 0x0FFF are reserved for the standard file dialog controls. IDs from outside this range must be chosen for any controls or windows added to a custom file dialog.

When a modeless dialog is dismissed, the owner of the file dialog will receive a WM_COMMAND message with the the ID of the file dialog.


[Back] [Next]