(PyUNICODE,PyUNICODE, int) = GetOpenFileNameW(hwndOwner, hInstance , Filter , CustomFilter , FilterIndex , File , MaxFile , InitialDir , Title , Flags , DefExt , TemplateName )

Creates a dialog to allow user to select file(s) to open


hwndOwner=None : PyHANDLE

Handle to window that owns dialog

hInstance=None : PyHANDLE

Handle to module that contains dialog template

Filter=None : PyUNICODE

Contains pairs of descriptions and filespecs separated by NULLS, with a final trailing NULL. Example: 'Python Scripts\\0*.py;*.pyw;*.pys\\0Text files\\0*.txt\\0'

CustomFilter=None : PyUNICODE

Description to be used for filter that user selected or typed, can also contain a filespec as above

FilterIndex=0 : int

Specifies which of the filters is initially selected, use 0 for CustomFilter

File=None : PyUNICODE

The file name initially displayed

MaxFile=1024 : int

Number of characters to allocate for selected filename, override if large number of files expected

InitialDir=None : PyUNICODE

The starting directory

Title=None : PyUNICODE

The title of the dialog box

Flags=0 : int

Combination of win32con.OFN_* constants

DefExt=None : PyUNICODE

The default extension to use

TemplateName=None : PyResourceId

Name or resource id of dialog box template


Accepts keyword arguments, all arguments optional Input parameters and return values are identical to win32gui::GetSaveFileNameW

Return Value

The result is a tuple of (filename, filter, flags), where the first 2 elements are unicode strings, and the last an integer. If the user presses cancel or an error occurs, a win32gui.error is raised (and if the user pressed cancel, the error number will be zero)