Jump to content
  • Advertisement
Sign in to follow this  
Fluffy-Bunny

Setting/resetting window style (Win32)

This topic is 4626 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!