Hello,
so I learned how to take off caption after CreateWindowEx:
Code:
DWORD styles;
win32assert(thesquare->active, "square_setcaptionoff activity");
styles = GetWindowLong(thesquare->hwnd, GWL_STYLE);
styles &= ~(WS_CAPTION);
SetWindowLong(thesquare->hwnd, GWL_STYLE, styles);
following that code is repainting, which works fine. However,
Code:
styles = GetWindowLong(thesquare->hwnd, GWL_STYLE);
styles |= WS_CAPTION;
SetWindowLong(thesquare->hwnd, GWL_STYLE, styles);
InvalidateRect(thesquare->hwnd, NULL, TRUE);
SetWindowPos(thesquare->hwnd, NULL, 0,0,320,240, SWP_NOSIZE|SWP_NOMOVE|SWP_NOZORDER);
The above code tries to put back the caption bar. It doesn't repaint for some reason though, you have to drag the window first for the caption bar to appear..
This is how it's supposed to work from this tutorial.. I don't know why it doesnt work. Am I missing something? I thought the code is identical to the one from the tutorial, so it's strange and I'm stuck.
Please help, cheers