Click to See Complete Forum and Search --> : UpdateWindow()


fwehlin
April 14th, 1999, 01:19 PM
Hi,

I´m having a little problem to redraw my created window. So if anyone could give me a hint on how to use UpdateWindow() or RedrawWindow(), I would be very happy.Also I´m trying to draw this window on a round area, should it work the way I figured or? Included is my constructor:

CMainFrame::CMainFrame()
{
CRect r;
r.SetRect(100,100,200,200);
CRgn m_wndRgn;
Create(NULL, "Simple MFC App",
WS_POPUP,
r, NULL, NULL, 0, NULL );
GetWindowRect(r);
m_wndRgn.CreateEllipticRgn (r.left,r.top,
r.Width(),r.Height());
SetWindowRgn(m_wndRgn,TRUE);
ModifyStyle(0, WS_SYSMENU, 0);
ModifyStyleEx (WS_EX_CLIENTEDGE, 0, 0);
m_bMouseDown = FALSE;
UpdateWindow(); // ?? doesn´t work, why?


}

Karl
April 15th, 1999, 03:32 AM
It doesn't work because no part of your window is invalidated. UpdateWindow launches the process of drawing. RedrawWindow invalidates a zone and launches drawing (with default flags RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE).
You should define an elliptical CRgn, invalidate it and after call UpdateWindow().

HTH.

K.

Ash to ash and clay to clay, if the enemy doesn't get you, your own folk may.