The point of SetChildShowWindow(0) and CREATE_NO_WINDOW is to hide the console window that perl usually displays when creating new process.Win32::SetChildShowWindow(0); Win32::Process::Create($ProcessObj, $javaExe, $commandArgs, 0, Win32::Process::NORMAL_PRIORITY_CLASS|Win32::Process::CREATE_NO_WINDOW +, $installPath) or $retCode = -9;
This worked fine until I tried to run the same code inside a thread.
I now have a perl module JavaCall.pm with "static" subs calling the java classes. My perl service starts a thread each time it needs to call java (if the java process is not started inside a thread, the perl service does not get the shutdown event until the java process finishes). So I have something like this:
perlservice.pl:
sub Callback_Running { $runningThread = threads->new(\&startProcess, $installPath, $executePa +th, $configFile, $parser, $logger, $configref, $Context); $runningThread->detach(); } sub startProcess { JavaCall->callJavaClass(...); }
And here is the mistery: This works perfect under my Windows XP SP2 Profesional Edition, English. But the console "cmd.exe" shows up on a Windows XP SP2 Home Edition, French. I do not know yet if this problem is specific to Home or French edition.Win32::SetChildShowWindow(0); Win32::Process::Create($ProcessObj, $javaExe, $commandArgs, 0, Win32::Process::NORMAL_PRIORITY_CLASS|Win32::Process::CREATE_NO_WINDOW +, $installPath) or $retCode = -9;
This app is distributed on users PC and I cannot have that window showing up. Any help greatly appreciated. Jerome
In reply to Win32 console window & threads by jbenezech
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |