lists.zerezo.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

***BOGO*** Re: [Mingw-users] stop dos window from opening



Ralblas wrote:

> How can I solve this?
> 1. How to prevent that the program window is minimized together with the
> command shell?
> And/Or
> 2. How to prevent that a system call causes a command shell popup?

If you use CreateProcess() directly instead of relying on system() you
can specify that the process be created detached (dwCreationFlags
contains DETACHED_PROCESS) without a console.  But CreateProcess() is a
lower level API than system(), so you potentially have to replicate a
great deal more logic, notably the fact that system() runs the command
through the shell (i.e. %COMSPEC% /c command) and that it handles
quoting.  CreateProcess() does none of this, you must handle it all
yourself.  But for a fixed command this is usually not a problem, and in
fact you gain a small bit of efficiency if a shell is not required, e.g.
there's no redirection.

Brian

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users