so I learned how to take off caption after CreateWindowEx:
following that code is repainting, which works fine. However,Code:DWORD styles; win32assert(thesquare->active, "square_setcaptionoff activity"); styles = GetWindowLong(thesquare->hwnd, GWL_STYLE); styles &= ~(WS_CAPTION); SetWindowLong(thesquare->hwnd, GWL_STYLE, styles);
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..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);
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