Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.23
LEADTOOLS Common Dialog C DLL Help

L_DlgSave

Show in webframe

#include "l_bitmap.h"

L_LTDLG_API L_INT L_DlgSave(hWndOwner, pOpenFileName, pDlgParams)

L_HWND hWndOwner;

/* owner of dialog */

LPOPENFILENAMEW pOpenFileName;

/* pointer to a Windows OPENFILENAMEW structure */

LPSAVEDLGPARAMS pDlgParams;

/* pointer to a structure */

Displays the Save dialog box, and gets the options for L_DlgSave.

Parameter

Description

hWndOwner

Handle of the window, which owns the dialog.

pOpenFileName

Windows structure. This structure is documented in the Microsoft Windows SDK documentation. For this function, you must set the following members of the OPENFILENAMEW structure:

 

lStructSize

 

lpstrFilter

 

nFilterIndex

 

lpstrFile

 

nMaxFile

 

lpstrFileTitle

 

nMaxFileTitle

 

lpstrInitialDir

 

lpstrTitle

 

lpstrDefExt

 

 

 

Flags

 

LEADTOOLS specifically sets the following flags:

 

OFN_HIDEREADONLY

 

OFN_ENABLEHOOK

 

OFN_ENABLETEMPLATE

 

OFN_ALLOWMULTISELECT is not set by LEADTOOLS automatically, but is allowed.

 

OFN_SHOWHELP is set only if you specify a HELP callback (that is pfnCallback was not NULL).

pDlgParams

Pointer to a SAVEDLGPARAMS structure to be updated with the values entered by the user through the dialog. Set members of this structure, before calling this function, to set the dialogs initial values.

Comments

The Save dialog.

Note: In the Save as type, the file type listed below is only supported in 32-bit platforms:

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.

Required DLLs and Libraries

LTDLGFILE
LTDLGKRN
LTDLGUTL
LTDLGCTRL
LTDLGCOM
LTFIL
LTDIS
LTIMG
LTKRN

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

Functions:

L_DlgInit, L_SaveBitmap, L_SaveBitmapList, L_SaveFile, L_SaveFileOffset, L_SaveFileTile

Topics:

Dialogs: Maintenance and General Use

 

Using Imaging Common Dialog

Example

 L_INT DlgSaveExample(HWND hWnd)
{
   L_INT nRet;
   SAVEDLGPARAMS DlgParams ;
   OPENFILENAME  OpenFileName ;

   memset ( &DlgParams, 0, sizeof ( SAVEDLGPARAMS ) ) ;
   memset ( &OpenFileName, 0, sizeof ( OPENFILENAME ) ) ;

   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_APPEND ;
   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 ;

   nRet = L_DlgInit (DLG_INIT_COLOR) ;
   if(nRet != SUCCESS && nRet != ERROR_DLG_ALREADYINITIATED)
      return nRet;

   nRet = L_DlgSave ( hWnd, &OpenFileName,  &DlgParams );
   if(nRet < 1)
      return nRet;

   nRet = L_DlgFree () ;
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}
Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.