whluk
asked on
Why the objects keep refreshing?
I worked along a program with the MFC library, and I added some code for Bitmap and font display in the OnDraw function. Then the program is compiled and run, but when I
resize the program. The objects inside the view just keeps
flashing/Refreshing. ls there any way that I can get around it?
Thanks
Jacky
resize the program. The objects inside the view just keeps
flashing/Refreshing. ls there any way that I can get around it?
Thanks
Jacky
Look at the WM_sizing and see if this is any use
alternatively display a bigger screen initially. SetWindowPos api will let you control the size of a window. Coupled with GetSystemMetrics(SM_CXSCRE EN) AND SM_CYSCREEN you can make a window take the full screen.
Perhaps the flashing occurs because you don't process the OnEraseBkgnd() message.
If your OnPaint() function draws the entire update region (i.e. with the background),
then you may ignore the OnEraseBkgnd() message:
BOOL CMyWnd::OnEraseBkgnd()
{
return TRUE; // Do not call the base class implementation
}
If your OnPaint() function draws the entire update region (i.e. with the background),
then you may ignore the OnEraseBkgnd() message:
BOOL CMyWnd::OnEraseBkgnd()
{
return TRUE; // Do not call the base class implementation
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops I made a mistake
cs.style & ~(CS_HREDRAW | CS_VREDRAW)
should be
0
cs.style & ~(CS_HREDRAW | CS_VREDRAW)
should be
0