From: Chris Hulan Date: 2010-02-13T11:55:06+09:00 Subject: Re: Can SWIN CommonDialog.openFilename() select multiple files? I was able to get your code to work, surprisingly the docs seem to actually be correct ;) Here is your (Siep) code expanded a bit: require 'swin' OFN_ALLOWMULTISELECT = 0x200 OFN_EXPLORER = 0x80000 NUL = "\x00" filetype_filter = [['Ruby files (*.rb)','*.rb'],['All files (*.*)', '*.*']] paths = SWin::CommonDialog::openFilename( nil, filetype_filter, OFN_EXPLORER|OFN_ALLOWMULTISELECT, 'Choose one or more files.') if paths files = paths.split(NUL) if files.length > 1 puts "Found #{files.length-1} files in #{files[0]}" files[1..-1].each_with_index{|el,i| puts "#{i} => #{el}"} else d,f = File.split(files[0]) puts "Single file: #{f} in #{d}" end else puts "No selction made" end using OFN_EXPLORER returns the list of files as a string will NUL separating the file names, allowing file names to contain spaces. The directory is the first item in this case If a single file is selected, the result is a single string with the full path and file name. Selecting cancel in the dialog results in a nul return value. I have to thank Louis Laverna for his work on the new Ruby installer, and epecially the dev kit that allowed me to build and install swin to play with this Cheers