I had a similar problem. I have a progragram where the user can dump the client to a BMP file. But it would capture the file dialog. So what I did was basically do the DoModal for the file dialog then redraw the entire client then do the bit block transfer from the client to the memdc. So in your code on the other post in the SaveDCtoBMP function.
Code:int ret = dlgFile.DoModal(); /////redraw the client here////// if(IDOK == ret) { .......etc.......
How you redraw the client will depend on how you have written your program. It might just be Invalidate or whatever other methods you have.
Wait a minute.....hold on here.....you're getting the entire screen (mainframe and all). OK I see how to fix that.
In SaveDCtoBMP you are using:
Use this insteadCode:CClientDC clientDC(::AfxGetMainWnd());
That way you get a DC for the view only, not the the entire mainframe. Using that along with redrawing the client after DoModal for the file dialog should give you what you need.Code:CClientDC clientDC(this);
TDM




Reply With Quote