Re: PR_CreateProcess() without Windows console window?
Rob Arnold <[email protected]> Tue, 13 Jul 2010 11:42:59 -0400
| Newsgroups | gmane.comp.mozilla.devel.nspr |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jul 13, 2010 at 9:33 AM, Benjamin Smedberg <[email protected]>wrote: > On 7/12/10 2:52 PM, Fredrik Roubert wrote: > >> Hello! >> >> When I use PR_CreateProcess() to run an executable that on Windows is >> built as a console application, a console window will pop up (and >> quickly disappear again, as the executable I'm calling just performs a >> very quick task). Would it somehow be possible to get rid of this >> window? >> >> If it isn't currently possible, what do you think of adding come >> functionality to PR_CreateProcess(), maybe accessed by a flag in >> PRProcessAttr, that would add the right flags to the Win32 >> CreateProcess() call? >> > > While it is technically possible, I don't think it is worth the hassle to > add NSPR flags to solve this problem: since you already know the correct > windows-specific code, why don't you use CreateProcess() directly and bypass > NSPR? > Since the console is inherited by default, your invoking program, which I presume you control, could allocate a console for itself via AllocConsole and hide the window[1] before creating the process. -Rob [1] GetConsoleWindow will get you the HWND