I have a Windows console application written in C ++ and you want to hide / remove the full title bar of the console window, including close, min / max controls, etc. I searched a lot, but have not yet found anything useful.
I request the HWND console using GetConsoleWindow and try to change the console window style using SetWindowLong by removing the WS_CAPTION flag, but this does not seem to have any effect:
HWND hwnd = GetConsoleWindow(); LONG style = GetWindowLong(hwnd, GWL_STYLE); style &= ~(WS_BORDER|WS_CAPTION|WS_THICKFRAME); SetWindowLong(hwnd, GWL_STYLE, style); SetWindowPos( hwnd, NULL, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE |SWP_FRAMECHANGED );
I also tried GetSystemMenu / RemoveMenu, but this only disables the controls, such as the close button.
c ++ winapi console
asdrubael
source share