[python-win32] How to detect User pressing escape, or clicking cancel in call to win32gui.GetOpenFileNameW()
Tony Cappellini
cappy2112 at gmail.com
Wed Mar 14 02:14:34 CET 2007
I'm trying to understand how to detect a user pressing Escape, or
clicking on Cancel when win32gui.GetOpenFileNameW() is called.
When I press escape when the FileOpen dialogue is present, I see the
following error with Python2.5/PWin32 Build 210
error: (0, 'GetOpenFileNameW', 'No error message is available')
Would someone explain what this means, or how to detect the above situations?
My call looks like this
filter='Patches'
customfilter='All Files'
unicodeFilenames=None
unicodeFilenames, customfilter, flags =
win32gui.GetOpenFileNameW(Filter=filter,
CustomFilter=customfilter,
FilterIndex=1,
File='*.pch',
InitialDir=os.getcwd(),
Title='Select Input Files',
Flags=win32con.OFN_ALLOWMULTISELECT|win32con.OFN_EXPLORER,
DefExt='.pch')
More information about the Python-win32
mailing list