Thanks!

On 4/13/09, Niki Spahiev <niki.spahiev@gmail.com> wrote:
Old sample:

def getDXF(filespec=('DXF (.dxf)\0*.dxf','All\0*.*'), mode='r'):
   import win32gui, win32con
   from array import array
   od = array( 'l', [0]*22 )
   od[0] = len(buffer(od))
   filter = buffer('\0'.join(filespec))
   od[3] = win32gui.PyGetBufferAddressAndLen( filter )[0]
   name = win32gui.PyMakeBuffer( 300 )
   name[0] = '\0'
   od[7],od[8] = win32gui.PyGetBufferAddressAndLen( name )
   if 'r' in mode:
       od[13] = win32con.OFN_FILEMUSTEXIST | win32con.OFN_HIDEREADONLY
   else:
       od[13] = win32con.OFN_HIDEREADONLY|win32con.OFN_OVERWRITEPROMPT
   if win32gui.GetOpenFileName( str(buffer(od)) ):
       return name[:str(name).index('\0')]

HTH

Niki