Thu Jul 05 03:15:21 2012: Request 78208 was acted upon.
Transaction: Correspondence added by CJM
       Queue: Win32-Process
     Subject: how use with CREATE_NO_WINDOW and without in one script?
   Broken in: 0.14
    Severity: Normal
       Owner: Nobody
  Requestors: stefa...@cpan.org
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=78208 >


You've misunderstood how CREATE_NO_WINDOW & CREATE_NEW_CONSOLE work. 
They're just constants that should be included as part of the $cflags
(using the | operator).  Simply including them as part of the import
list doesn't do anything except create the constant.

  use Win32::Process qw(NORMAL_PRIORITY_CLASS
                        CREATE_NO_WINDOW CREATE_NEW_CONSOLE);

  Win32::Process::Create($ProcessObj,
    "C:\\Windows\\System32\\echo.exe",
    "",
    0,
    NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW,
    ".");

  Win32::Process::Create($ProcessObj,
    "C:\\Windows\\System32\\echo.exe",
    "",
    0,
    NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE,
    ".");

Reply via email to