How to avoid the console from apearing.

Steven Schveighoffer schveiguy at yahoo.com
Tue Aug 17 19:57:48 PDT 2010


On Tue, 17 Aug 2010 17:40:02 -0400, John Connors  
<JohnConnors at mailinator.com> wrote:

> Hi.
>
> This is my entire program:
>
> import std.process: system;
>
> int main(string[] argv)
> {
> 	return system(r"bin\someprogram.exe");
> }
>
> It works but a console (from my program) apears while someprogram.exe is
> running. I've read that some optlink switches are needed to make the  
> console
> disapear. Tried the following (which I found in DM FAQ), but don't seem  
> to work:
>
> dmd -L/exet:nt/su:windows loader.d resource.res
>
> The console keeps appearing.
>
> Do you care to give me the correct switches?

The console is appearing because of the way you are starting the child  
process.  I don't think the linker flags passed to the loader have any  
bearing on what happens when you execute a child process.

Changes are afoot to std.process, we recently got a blocker fixed (not yet  
in svn, but someone submitted a correct patch) so I can finish my Windows  
version.  This will include a 'gui' flag that allows you to suppress the  
console.  I don't know if the gui flag will be available on the 'system'  
function, but you should be able to easily run a program with the new  
std.process functions.

-Steve


More information about the Digitalmars-d-learn mailing list