[Mono-list] Re: [Gtk-sharp-list] Dos window - when launch app onWin32 OS - how to remove it ?

Kornél Pál kornelpal at hotmail.com
Fri Jul 15 05:37:08 EDT 2005


>> Maybe I'm wrong but on windows installation it isn't posible to disable
>> dos command box while starting mono application.
> Yes, you are wrong.

> Thats right, we successfully run .net applications using gtk# compiled
> with mcs on ms.net with gtk# without a dos box, and all we do is build
> with /target:winexe.

> It might not work on *MONO* on win32, but I have never tested that, and
> anyway, you are kinda insane for using it IMO.

Managed applications are not native Win32 applications so the console window
(official name of dos box) is not dependent on them. It is dependent however
on the exe file that was used to create the native Win32 process. In the
case of MS .NET Framework runtime this is the managed exe file altough it's
runned against the runtime. In case of Mono this is mono.exe. There is a
flag in PE header (IMAGE_OPTIONAL_HEADER.Subsystem) that specifies a
subsystem (for example Win32 GUI, Win32 CUI) used by the application. If it
is IMAGE_SUBSYSTEM_WINDOWS_CUI it will be attached to the existing console
or a new console window will be created it the process group hasn't got one.
If it is IMAGE_SUBSYSTEM_WINDOWS_GUI no new console window will be created
and the process will not be attached to the existing console window. Mono
has IMAGE_SUBSYSTEM_WINDOWS_CUI to be able to provide /target:exe (console)
functionality. This results however in a console window for /target:winexe
(GUI) applications as well.

Kornél



More information about the Mono-list mailing list