Jump to content
  • Advertisement
Sign in to follow this  
aboeing

win32 - Redraw

This topic is 4724 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

Hi, I'm trying to redraw a window from another thread, and it doesn't seem to be working. I have a dialoge box with a progress bar in it, and a background thread doing some grunt work. I want to update the progress bar, and an edit box, but the window never seems to redraw. I've tried:
	ShowWindow(g_progress_hWnd, SW_SHOW); 
	UpdateWindow(g_progress_hWnd);
	RedrawWindow(g_progress_hWnd,0,0,RDW_UPDATENOW);
none of which seem to have any effect... I've checked that g_progress_hWnd is correct, and put a printf in WM_PAINT - nothing seems to ever happen.. Any advice would be appreciated. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Use the InvalidateRect(window handler, null, true) for redrawing the window you want.
UpdateWindow sends an WM_PAINT but if there is nothing to update nothing will be changed in the window, InvalidateRect tells the API which area in the client window needs to be updated(null for entire window). Check the SDK for more info.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!