2009/6/26 Corinna Vinschen:
>> The proper, yet probably completely impractical solution: compile
>> Cygwin programs for the GUI subsystem instead of the console one and
>> attach to the parent process' console, if any, with explicit calls at
>> program startup. POSIX programs don't use the Win32 console API, so
>> there should be no need to always have a console available.
>
> The problem is rather that you want to be able to run certain native
> applications which refuse to run if no console is allocated.  Or they
> pop up a console on their own.

Good point, that would be rather an unwelcome change. Shame.


>> Otherwise:
>>
>>     DWORD version = GetVersion();
>>     version = ((version & 0xff) << 8) | ((version >> 8) & 0xff);
>>     if (version >= 0x0601 && AllocConsole())
>>       ShowWindowAsync(GetConsoleWindow(), SW_HIDE);
>>
>> Still looks bad though, with "subliminal" popups, as demonstrated by
>> mintty on Windows 7.
>
> And what's really bad is that the console shows up in the taskbar.

Forgot to say: the occurances of this could at least be reduced by
trying AttachConsole to get a hold on the parent process' console, if
any. When I attempted that in MinTTY, though, I couldn't make it work.
Did you previously mention that MS fixed bug in this area?

Andy

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to