Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset DC content on window minimize?

Status
Not open for further replies.

tabaar

Programmer
Jun 12, 2001
34
US
Hi!

I have a problem: my program's main window is a dialog with CStatic control on it. Program gets CStatic's DC and draws some kind of graph on it. But when the window is minimized and then restored again, this control is empty (it's content is reset). I have one idea: to paint everything on virtual (in-memory) DC and then copy it to the CStatic DC. Virtual DC shouldn't be flushed when the window is minimized, should it? I tried to do so, but nothing works. Help me, please, or point me to another solution of this problem.

Thanx, bye!
 
I am not sure if this is it but try setting the property of it to "Clip Children" I believe this may fix the problem. Other then that, I would suggest a bitblt into the dc

Matt
 
Try to draw something on visible DC and then minimize window, which contains this DC. Then maximize it. The drawing is gone, the DC is reset. This is a problem.
 
Oh... this is yet another guess but re-blt the dc. There is prolly an easier solution but this should do it.

Create a CBitmap.
Blt the dc into the bitmap then reblt it into the dc. I am not sure if you should create the copy on minimize then blt on the maximize or if it can be all done in the on minimize. Also, there will be no undo capability with the blt.

matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top