DTWAIN_SetFileSavePos

Top  Previous  Next

The DTWAIN_SetFileSavePos function allows the user to set a title and position of the "Save As" dialog when saving an acquired image to a file.

 

DTWAIN_BOOL  DTWAIN_SetFileSavePos (

HWND

hWndParent,

LPCTSTR

szTitle,

LONG

xpos,

LONG

ypos,

LONG

flags );

 

Parameters

hWndParent

Points to the window that will be the parent of the File Save dialog, or NULL if no parent window.

 

szTitle

Optional title, or NULL.

 

xpos, ypos

Position of the File Save dialog with respect to the parent window.

 

flags

Optional window placement flags.

 

 

Return Values

If successful, the return value is TRUE.  Otherwise FALSE is returned.

 

Character specific version

ANSI version:

DTWAIN_SetFileSavePosA

Unicode version:

DTWAIN_SetFileSavePosW

 

Comments

The DTWAIN_SetFileSavePos allows an application to set the postion and title of the "Save As" dialog whenever DTWAIN_AcquireFile or DTWAIN_AcquireFileEx is called using the DTWAIN_USEPROMPT flag.

 

The hWndParent sets the "Save As" dialog's parent window to hWndParent.  If no parent window is desired, hWndParent must be NULL or 0.  If hWndParent is NULL, the parent window is the entire screen.  The xpos and ypos arguments place the window at position (xpos, pos) with respect to the parent window (if no parent window, xpos and ypos are relative to the entire screen).

 

The szTitle argument is a null-terminated string that represents the title to display on the window.  If szTitle is NULL, the title is "Save As".

 

The flags parameter determine whether the dialog will be centered and whether the list of Source names displayed will be sorted.  A list of available flag options are as follows (multiple options can be selected by adding the values together).

 

DTWAIN_DLG_CENTER

 

Centers the File Save dialog on the parent window hWndParent.  The xpos and ypos arguments are ignored.

 

 

If more customization is desired beyond what DTWAIN_SetFileSavePos provides, call DTWAIN_SetCustomFileSave using an OPENFILENAME structure that has been set up by the application.

 

TWAIN State Transitions

None

 

Prerequisite Calls

DTWAIN_SysInitialize

 

Optional Prerequisite Calls

None.

 

See Also

Source Selection Functions