My program should arbitrarily maximize any window on the current desktop. I achieve this by calling ShowWindow(hWnd, SW_MAXIMIZE) , where hWnd is the HWND window I want to maximize. When this line of code is executed, the corresponding window (here, Notepad) looks like this:

Everything seems fine, except for the fact that the window was not correctly installed, that is, the window looks a little lower, and the title bar does not look βcrushedβ as it should. Compared to what it should look like when you click the maximize button, the problem is obvious:

Does anyone know why this is happening, and what can I do to fix it?
source share