[python-win32] Re: Drag and drop of files (CF_HDROP)
Roger Upole
rwupole at msn.com
Mon Sep 22 01:14:00 CEST 2008
You can use struct.pack to create a buffer containing
a DROPFILES struct:
"""
typedef struct _DROPFILES {
DWORD pFiles;
POINT pt;
BOOL fNC;
BOOL fWide; } DROPFILES, *LPDROPFILES;
"""
fname_buf='\0'.join(fnames)+'\0\0'
fmt="lllll%ss" %len(fname_buf)
df=struct.pack(fmt, 20, 0, 0, 0, 0, fname_buf)
ret_stg.set(pythoncom.TYMED_HGLOBAL, df)
Roger
More information about the python-win32
mailing list