Sign in to follow this  

Setting/resetting window style (Win32)

This topic is 4261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When in windowed mode, I can use the following to cover up my window's title bar and the desktop's taskbar, without the need for ChangeDisplaySettings. SetWindowLong( hWnd, GWL_style, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN ); SetWindowLong( hWnd, GWL_EXstyle, WS_EX_APPWINDOW ); SetWindowPos( hWnd, HWND_TOP,0,0,width,height,SWP_SHOWWINDOW|SWP_FRAMECHANGED ); At this point, if I try to make the window smaller (e.g. 640x480 on a 1280x1024 desktop), the screen area outside my window is not updated. It's as if the last frame of my previously fullscreen window is still drawn on it. I tried to force the desktop window to refresh but it doesn't work. SetWindowLong( hwnd , GWL_style, WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN ); SetWindowLong(hWnd, GWL_EXstyle, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE ); SetWindowPos( hWnd, HWND_TOP,x,y,width,height,SWP_SHOWWINDOW|SWP_FRAMECHANGED ); PostMessage( GetDesktopWindow(), WM_PAINT, 0, 0 ); Anyone know the cause of this?

Share this post


Link to post
Share on other sites
It's early so bare with me (early considering I went to bed 3 hours ago)...

PostMessage(GetDesktopWindow(), ERASEBKGND, 0, 0);


You could also try:
ShowWindow(hWnd, SW_NORMAL);
SetFocus(hWnd);

This might also force the background to redraw.

Share this post


Link to post
Share on other sites

This topic is 4261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this