New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ShowWindow(GetConsoleWindow(), SW_HIDE); does not work with Terminal in Windows 11 #15311
Comments
The console basically contains your debug/info log right? That's a really clever way to use it. To give a short background for this change: We're trying to align Windows more closely to how the other major operating systems work when it comes to terminals. If you write to stdout on those platforms the output is simply discarded. The only way to see it is if you attached something to stdout prior to launching the application, like a terminal or an indirection to a file for instance. To circumvent this, I'd say the quick fix is to spawn your application through conhost explicitly. Basically, instead of running |
Thx for your comments/suggestions @lhecker ; Afraid some of them will not be satisfactory for end-users. I will have trouble explaining GUI only users they should launch the GUI app using a command-line script, when all they want to know is where to click. I hope MS finds a way to 'trace' so to speak the terminal associated with the instance of the app it is attached to, and create a separate, single tab instance of the As to "small apps", some of them are above 20000 lines, but some are just a few 100's. :-) |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
I develop small applications using C and Win32 libraries. I typically call
ShowWindow(GetConsoleWindow(), SW_HIDE);
in my programs so the console/terminal window would become hidden, leaving only the GUI application and its main loop for capturing user events. Only when/if needed, would I show again the console window under certain circumstances, such as fatal errors.This works/worked great with all instances of Windows (at least XP and W10) but in W11, as now "Terminal" takes over the console host by default, my call to
ShowWindow
will no longer hide the terminal.I can ask all users to change the default "Terminal" back to Console Host, but is there another/better way?
Thx,
-Patrick
The text was updated successfully, but these errors were encountered: