Setting Win32 Console app in foreground

I want to get an NT console application running in full screen mode in foreground. SetForeground window works only if the application is not in fullscreen mode.
Any ideas ?
HERESONAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
zyqwertConnect With a Mentor Commented:
This worked for me on NT.

When you alt+tab away from a full screen console mode app, it is minimized, so a SetForegroundWindow will bring it to the foreground, but it will still be minimized.  To get it back in sight, tell it to show itself with ShowWindow:

case WM_LBUTTONDOWN:
{
   // I assume you know exactly which console window you want.
    HWND h= FindWindow("ConsoleWindowClass", NULL);
    SetForegroundWindow(h);
    ShowWindow(h, SW_MAXIMIZE);
}

0
 
HERESONAuthor Commented:
I've found the same answer by myself ths weekend.
0
All Courses

From novice to tech pro — start learning today.