Its been awhile since I generated an exe with GUI on Windows - the last major release was on XP. The default was a command line task that shows STDOUT/STDERR and then a task for the GUI itself (much bigger).

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() ); }

In reply to Re: PAR pp Windows 2 instances by Marshall
in thread PAR pp Windows 2 instances by IB2017

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.