in reply to PAR pp Windows 2 instances
With PerlApp, there was an option to eliminate this extra task that when maximized shows command line output. I guess that you are using pp? I suspect that there is a similar "launch option". If there is not, then it is possible to write some Perl code to launch your app as a "detached process", meaning that there is no command line. From my previous testing this is about 1/2 page of Perl. Look for a compile option in pp. From my memory on WinXP, killing the command line task also killed the GUI. Windows is a complicated beast - I have no idea why that doesn't work on Win10.
Update:
I was trying to kill my application from outside Perl (to perform an update which requires my application to be killed)
I can't even imagine intentionally doing such a thing. My gosh you are describing something that would be a program crash! I mean as a user if I'm using the GUI and then all of a sudden "poof", the program dies, I'd be pretty upset!! Internally within the main application code, a "kill" command from the OS will likely cause some data loss.
I have tested Perl signal handlers under Windows - I don't remember exactly how, but there has got to be some better way for your update process to work. Issuing a "kill" at a random moment during user GUI interaction is "BAD, VERY BAD".
Update:
If you don't want the command line task, something similar to this should work. I got this from one of my Perl books and I remember testing something close to this in the past. This code does appear in a copyrighted book, but it is so short that I think "fair use" applies because it just shows how to use Win32::Process::Create().
#!/usr/bin/perl -w # loader - starts Perl scripts without the annoying DOS window use strict; use Win32; use Win32::Process; # Create the process object. Win32::Process::Create($Win32::Process::Create::ProcessObj, 'C:/perl5/bin/perl.exe', # Whereabouts of Perl 'perl realprogram', # 0, # Don't inherit. DETACHED_PROCESS, # ".") or # current dir. die print_error(); #or perhaps, just die "some error msg"; #consider using the START command in a Windows batch file sub print_error() { return Win32::FormatMessage( Win32::GetLastError() ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: PAR pp Windows 2 instances
by IB2017 (Pilgrim) on Feb 04, 2019 at 08:18 UTC | |
by Marshall (Canon) on Feb 04, 2019 at 12:14 UTC | |
by IB2017 (Pilgrim) on Feb 04, 2019 at 14:23 UTC | |
by Marshall (Canon) on Feb 04, 2019 at 14:39 UTC | |
by Anonymous Monk on Feb 05, 2019 at 11:48 UTC | |
|