LDialogFile::DoModalSave
#include "ltwrappr.h"
virtual L_INT LDialogFile::DoModalSave(hWndOwner)
HWND hWndOwner; |
/* handle of the window which owns the dialog */ |
Displays the Save dialog box, and gets the options for LDialogFile::DoModalSave.
Parameter |
Description |
hWndOwner |
Handle of the window which owns the dialog. |
Returns
SUCCESS_DLG_OK |
The "OK" button was pressed, and the dialog exited successfully. |
SUCCESS_DLG_CANCEL |
The "Cancel" button was pressed, and the dialog exited successfully. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
LDialogFile::SetSaveParams must be called before using this function to set the initial values for the dialog. You can get the updated SAVEDLGPARAMS with the values entered by the user through the dialog by using LDialogFile::GetSaveParams.
The Save dialog is shown in the following figure:
Required DLLs and Libraries
LTDLGFILE For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Example
void TestFunction(LBitmap * pBitmap, HWND hWnd)
{
L_INT nRet = 0;
LDialogFile DlgFile;
DlgFile.SetBitmap (pBitmap);
LDialogFile::Initialize (0);
SAVEDLGPARAMS DlgParams ;
OPENFILENAME OpenFileName ;
memset ( &DlgParams, 0, sizeof ( SAVEDLGPARAMS ) ) ;
OpenFileName.lStructSize = sizeof ( OPENFILENAME ) ;
OpenFileName.lpstrInitialDir = NULL;
OpenFileName.lpstrTitle = TEXT("Save a File");
OpenFileName.nFilterIndex = 0 ;
DlgParams.uStructSize = sizeof (SAVEDLGPARAMS) ;
DlgParams.nQFactor = 2 ;
DlgParams.nPageNumber = 1 ;
DlgParams.uSaveMulti = MULTIPAGE_OPERATION_REPLACE ;
DlgParams.uDlgFlags = DLG_SAVE_SHOW_FILEOPTIONS_PROGRESSIVE |
DLG_SAVE_SHOW_FILEOPTIONS_MULTIPAGE |
DLG_SAVE_SHOW_FILEOPTIONS_STAMP |
DLG_SAVE_SHOW_FILEOPTIONS_QFACTOR |
DLG_SAVE_SHOW_FILEOPTIONS_J2KOPTIONS |
DLG_SAVE_SHOW_FILEOPTIONS_BASICJ2KOPTIONS ;
DlgFile.EnableCallBack(FALSE);
DlgFile.SetSaveParams (&DlgParams) ;
DlgFile.SetFileName(TEXT("C:\\IMAGE1.GIF")) ;
nRet = DlgFile.DoModalSave(hWnd);
// Gets the updated values for the structure
DlgFile.GetSaveParams(&DlgParams, sizeof(DlgParams)) ;
LDialogFile::Free ();
}