I have a Image viewer application window using layout splitters. I am drawing the bitmap on a dialog inside a splitter using a custom image control
class CPictureCtrl :
public CStatic
{
public:
.
.
protected:
virtual void PreSubclassWindow();
//Draws the Control
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
virtual BOOL OnEraseBkgnd(CDC* pDC);
private:
//Internal image stream buffer
IStream* m_pStream;
//Control flag if a pic is loaded
BOOL m_bIsPicLoaded;
//GDI Plus Token
ULONG_PTR m_gdiplusToken;
};
Inside the DrawItem() method, I take GDI+ graphics from lpDrawItemStruct and paint the image.
Everything works fine, but when I open a child window to the dialog where I have this control, the image gets painted over my popup window.
Is there a way I can bring the popup window to the front.
full source of the control can be found at http://www.codeproject.com/Articles/24969/An-MFC-picture-control-to-dynamically-show-picture?fid=1183733&df=90&mpp=25&noise=1&prof=True&sort=Position&view=Expanded&spc=Relaxed&fr=1