[rt.cpan.org #78208] how use with CREATE_NO_WINDOW and without in one script?

[email protected] ("Christopher J. Madsen via RT")
Newsgroups perl.libwin32
Message-ID <[email protected]>
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: [email protected]
      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,
    ".");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.