How to avoid the console from apearing.

Michael Parrott baseball.mjp at gmail.com
Tue Aug 17 15:07:07 PDT 2010


Michal Minich Wrote:

> On Tue, 17 Aug 2010 21:40:02 +0000, John Connors 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?
> > 
> > Thanks
> 
> this example does not shows console. Maybe you can simplify it.
> http://digitalmars.com/d/2.0/windows.html
> 
> in step 3 you need to crate mydef.def file and give it as an argument to 
> compiler.
> 
> you will probably not need, but complete docs are here
> http://www.digitalmars.com/ctg/ctgDefFiles.html
> http://www.digitalmars.com/ctg/win32programming.html

If you look on that page, you'll see:

3. A .def  (Module Definition File) with at least the following two lines in it:

EXETYPE NT
SUBSYSTEM WINDOWS

Without those, Win32 will open a text console window whenever the application is run.

So I'm assuming that is the answer.


More information about the Digitalmars-d-learn mailing list