Re: PR_CreateProcess() without Windows console window?

Wan-Teh Chang <[email protected]> Mon, 12 Jul 2010 12:36:22 -0700
Newsgroups gmane.comp.mozilla.devel.nspr
Message-ID <[email protected]>
Hi Fredrik,

On Mon, Jul 12, 2010 at 11:52 AM, Fredrik Roubert <[email protected]> wrote:
>
> 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?

That console window is caused by building the executable as a console
application.

Is it possible to build the executable as a Windows application (which
means using wmain instead of main and perhaps specifying some
linker flag)?

> 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?

I don't know.  It seems that the problem is caused by the way
the executable is built, so I'm not sure if we can fix the console
window problem by passing some flags to CreateProcess().

Can you play with the wShowWindow field in the STARTUPINFO
structure passed to CreateProcess(), and see if it solves the
problem?
http://msdn.microsoft.com/en-us/library/ms686331(v=VS.85).aspx

Wan-Teh