How to call a system file selection dialog using perl on windows? -


i know many perl based gui module curious methods other than prima or tk etc.
want call dialog (exactly looking windows explorer) command line package.

is similar system(''); command possible.

pls mind that, need open , process file/s selected such dialog via perl.

it's not easy, first have build data structure needed openfiledialog api, interact system @ low level, track file handles, , parse resulting structure.

there horrible hacks save windows script, , run perl using system suggested. keep in mind requires right permissions, , scripting languages installed.

# http://www.pcreview.co.uk/threads/launching-a-search-explorer-exe-form-the-command-line.1468270/ system( q{"echo createobject("shell.application").findfiles >%temp%\myff.vbs"} ); #setup script @files = system( "cscript.exe //nologo %temp%\myff.vbs" ); # files system( "del %temp%\myff.vbs" ); # cleanup 

the authors of win32::gui have done great job of simplification,

my @file = win32::gui::getopenfilename (); 

or helpful options filtering, starting directory , window title.

# simple open file graphic filers ( @file, $file ); ( @parms ); push @parms,   -filter =>     [ 'tif - tagged image format', '*.tif',       'bmp - windows bitmap', '*.bmp',       'gif - graphics interchange format', '*.gif',       'jpg - joint photographics experts group', '*.jpg',       'all files - *', '*'     ],   -directory => "c:\\program files",   -title => 'select file'; push @parms, -file => $lastfile  if $lastfile; @file = win32::gui::getopenfilename ( @parms ); 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -