From: Sean H. <jal...@ho...> - 2008-12-15 16:08:25
|
Brian Somers wrote: > Basically, I’m trying to implement a dual listbox interface quite > similar to what Eric Hansen wrote about in 1999. What I can’t find > anywhere is how to fill the left listbox with the files in a given > directory, although the closest I found was a tutorial in VB out on the > web. I’m trying to use the methods Dir and AddFile, but something’s not > working. I can’t figure out what the Dir method is supposed to return, > nor what parameters/arguments to send. I try AddFile and my app crashes. > I can make AddString work, though. MSDN is your friend! (Seriously, MSDN is your best bet for figuring out undocumented Win32::GUI methods.) AddFile($path) http://msdn.microsoft.com/en-us/library/bb775165(VS.85).aspx Take note: "The list box to which lParam is added must have been filled by the DlgDirList function." This is presumably why you're crashing Unfortunately, however, Win32::GUI does not expose the DlgDirList function to Perl. (At least, a search of the source files does not find "DlgDirList".) Dir($path, $flags) http://msdn.microsoft.com/en-us/library/bb775185(VS.85).aspx Some notes: 2) The order of parameters is swapped in Win32::GUI. 3) The constants don't seem to be available via Win32::GUI::Constants, so here they are: DDL_READWRITE = 0x00 DDL_READONLY = 0x01 DDL_HIDDEN = 0x02 DDL_SYSTEM = 0x04 DDL_DIRECTORY = 0x10 DDL_ARCHIVE = 0x20 DDL_DRIVES = 0x4000 DDL_EXCLUSIVE = 0x8000 (I hope these are correct - I found them on the web and haven't tested them.) |