Windows Perl (icon v command line)

IvorW combobulus at xemaps.com
Fri Dec 9 10:47:45 GMT 2005



> -----Original Message-----
> From: Steve Mynott [mailto:steve at tightrope.demon.co.uk]
> Sent: 09 December 2005 10:03
> To: London.pm Perl M[ou]ngers
> Subject: Windows Perl (icon v command line)
> 
> ...
> 
> But I was wondering, and I guess this is more a windows question than
> perl, if anyone knew of a simple way on Windows of knowing whether the
> exe had been ran as an icon or via a cmd.exe box?

It's really a question of how your PAR .exe was built; whether --gui was specified to pp. If your app was built as a gui, you can still launch it from a cmd prompt, but you won't see STDOUT in the console window, and you won't be able to tell that it was launched via cmd.

If you want to be able to test whether your .exe was built as a gui or a console app, this is doable. Have a look at exetype.bat supplied with ActiveState. This is actually a wrapper around a Perl script. Exetype itself only provides a setter mechanism, not a getter mechanism, but it should be easy to turn this into some code that lists out the executable type, as all the information about magic IMAGE_* structures is documented.

Ivor.


More information about the london.pm mailing list