[Mono-devel-list] [PATCH] Detach console when executing IMAGE_SUBSYSTEM_WINDOWS_GUI on win32

Kornél Pál kornelpal at hotmail.com
Wed Jul 20 13:47:41 EDT 2005


>> The only proper solution could be to use two separate mono.exe files. One
>> for CUI and one for GUI. But this is too complicated and Windows is not
>> the
>> primary platform for Mono so I think detaching the console for GUI
>> applications is the best solution.
>
> This patch looks good to me to go into SVN, please commit.
>
> Am wondering how we can remove the batch file wrappers from our Windows
> installation, thats something that I think we should fix.

I committed as revision 47477.

Removing batch files could be good because currently the console is
preserved because of batch files. And when executing Mono programmatically
it's better to have a handle to the real mono process.

cmd.exe for example waits for the executable to exit even if it releases the
console when it is a CUI application.

Note that using Mono without batch files will not make the console window
"flickering" disappar because this would require a mono.exe marked with
IMAGE_SUBSYSTEM_WINDOWS_GUI that could not be used for console applications.
So if we want to get rid of flickering we have to have to mono executable
files for example mono.exe (graphical) and a mono.com (console) like Visual
Studio .NET does. But we could not call mono.exe from mono.com because Mono
has to provide full console functionality like colors and cursor moving that
cannot be done without a console attached. So we should have two different
executables that could share a dll for example and we would call a single
entry function from two stubs (these executables don't have to contain other
than an entry point that calls a single function in the dll).

I don't know whether it is worth to have two executables.

Kornél




More information about the Mono-devel-list mailing list