Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with WM_SETREDRAW message

Status
Not open for further replies.

QuadraQ

Programmer
May 7, 2004
1
0
0
US
I'm trying to batch the updating of controls on the screen. Basically some
controls are being removed and then recreated and I need to minimize the
'flicker' effect that is created. I created a function to turn on and off
the redrawing of the screen like this: (I'm re-creating from memory)

bool __fastcall SetAutomaticUpdate(bool setAutoUpdate);
{
static bool autoupdate = true;

if(autoupdate != setAutoUpdate)
{
autoupdate = setAutoUpdate;
SendMessage(GetWindow()->Handle, WM_SETREDRAW, (WPARAM)(autoupdate ?
TRUE : FALSE), 0);

if(autoupdate)
GetWindow()->Repaint(); // Also tried InvalidateRec() Windows
API call without success
}
return autoupdate;
}

Basically I have two different types of controls that are getting updated.
One type is a very slightly modified descendent of TLabel. The other is a
slightly modified descendent of TMemo. The TLabel descendents are getting
redrawn from the call to Repaint(), but the TMemo descendents are not
getting updated at all. If I minimize the program and the restore, the
screen refreshes correctly which makes it all the more maddening. I'm using
C++ Builder 6. Any ideas? Any help would be most appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top