C ++ Windows remove field to enlarge

I use these window styles when called. CreateWindow
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX
This disables the maximize window, but is there a way to completely remove it?

+5
source share
2 answers

There is no easy way, but if you draw the title yourself, then you can do it.

To give you an idea, this article Adding a Minimize to Tray button to the form's title bar explains how to add a button. Removing a standard button is about the same — setting non-client area.

+2
source

, Windows 7.. , () , , - ,

void ClearButtons(void)
{
    int index = WS_BORDER;
    unsigned int a = (unsigned int)((WS_BORDER | WS_CAPTION) & (~WS_ICONIC));

    LONG_PTR lPtr;
    HWND hWnd = GetActiveWindow();
    lPtr = GetWindowLongPtr(hWnd, index); 
    SetWindowLongPtr(hWnd, GWL_STYLE, a);  
}
+1

All Articles