Archived

This topic is now archived and is closed to further replies.

How do I get my Dialog box to repaint itself?

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

At the moment I am just basically trying to write program to have the user load a bitmap onto a dialog box. I don't really know how to load it onto a picture control, so I just blit the bitmap onto the (0,0) corner of the dialog box. The problem is that when the user loads it, it won't display it until the user drags something over it and it repaints itself. After the function that loads the bitmap I have included a PostMessage function that sends the WM_PAINT message and I also have the RedrawWindow after it and it still won't refresh the dialog box to display the bitmap. [edited by - manastone on November 11, 2003 10:40:10 AM]

Share this post


Link to post
Share on other sites
I don''t think it''s a good idea to send WM_PAINT messages yourself. Instead, call InvalidateRect () to set the invalid regions of the window (i.e. those that need to be redrawn. and use UpdateWindow () to send off a WM_PAINT message.

Look at the Platform SDK/Graphics and Multimedia Services/GDI/ on MSDN. It has holds such information.

Good luck,
Ro_Akira

Share this post


Link to post
Share on other sites
Have you tried an InvalidateRect for the target area? It''s what I use on views, and it''s a CWindow derivative, but I haven''t tried it on dialogs. Plain Invalidate will force redraw of the entire client area but I figured you might just want to redraw the bitmap area.

-fel

Share this post


Link to post
Share on other sites