I was wondering if their is an easy way to know if a Windows application is up and running or not. When I use Win32 to launch an executable the Perl script will continue after that which is ok, however some code in it will communicate with the application and if the application is not completely running it will fail. A way to get around that was by using sleep(4), but this is so dirty, because on some systems it take 3 seconds to launch, on others longer and if launched second time it only take 1 second, so the script would be all the time waiting for nothing. Is their a way to let the script wait untill the application is fully up and running.

Win32::Process::Create($get,$GENESIS_EDIR.'\\get\\get.exe',"get -a$p +ort",0,CREATE_NEW_CONSOLE,".")|| die ErrorReport();

In reply to How to know if an application is completely launched by juo

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.