Link to home
Start Free TrialLog in
Avatar of vedeveloper
vedeveloper

asked on

Unable to draw over a Dialog

I am currently drawing an image using OpenGL into a CWnd. The Window is hidden and the image is drawn to the front buffer and then saved as a .bmp.

The problem is that there is another dialog on the screen at the same time and it is obstructing the hidden window I am drawing onto. This results in the saved bitmap having part of the obstructed dialog drawn on it. I have attempted to draw to the back buffer but all this does is leave the area that the dialog was obstructing being drawn in left black.

I have tried setting the tried using calls like SetFocus(), BringWindowToTop(), SetWindowPos(), etc with the idea of bring my window to the top of the pile but none of those ideas have worked. I suspect the reason is because the obstructing dialog is run independent from my Window, it's in C# my one is in C++.

I should also say that I have been able solve this problem on an 32 ibt XP machine but not on 64 bit XP. The same code also acts differently on Vista machines. I suspected it might have something to do with graphics cards as NVidea and ATi.
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

This might be silly but a hidden window is not visible - so why do you draw onto it?
Avatar of vedeveloper
vedeveloper

ASKER

The reason the window is hidden is because I don't want the window popping up for the user to see/. It is only created for the purpose of drawing the image and then saving it.
>>It is only created for the purpose of drawing the image and then saving it.

?
Why can't you save the image directly?

(I suspect your problems are because you are drawing to a non-visible window, nothing about C++  or C#)
ASKER CERTIFIED SOLUTION
Avatar of vedeveloper
vedeveloper

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial