win32gui.GetOpenFileName

int = GetOpenFileName(OPENFILENAME)

Creates an Open dialog box that lets the user specify the drive, directory, and the name of a file or set of files to open.

Parameters

OPENFILENAME : string/bytes

A string packed into an OPENFILENAME structure, probably via the struct module.

Comments

The win32gui::GetOpenFileNameW function is far more convenient to use.

Return Value

If the user presses OK, the function returns TRUE. Otherwise, use CommDlgExtendedError for error details (ie, a win32gui.error is raised). If the user cancels the dialog, the winerror attribute of the exception will be zero.