ExDev001
asked on
How to know LockWindowUpdate state for a specified control
Hello,
I'm using Windows.LockWindowUpdate in order to optimize control's drawing while moving and resizing.
Something like this:
Sometimes I need to know if LockWindowUpdate is enabled or disabled for a specified control.
Something like "IsWindowUpdateLocked()".
How can this be done? (If it can be done..)
Thanks for your willingness.
I'm using Windows.LockWindowUpdate in order to optimize control's drawing while moving and resizing.
Something like this:
LockWindowUpdate(MyPanel.Handle);
//some code here
//...
//...
LockWindowUpdate(0);
Sometimes I need to know if LockWindowUpdate is enabled or disabled for a specified control.
Something like "IsWindowUpdateLocked()".
How can this be done? (If it can be done..)
Thanks for your willingness.
The only way I can think to do it is to define a Boolean flag to go with each control you want to know the status of and set it to true or false as you set lockwindowupdate on or off.
According to this: http://msdn.microsoft.com/ en-us/libr ary/window s/desktop/ dd145034%2 8v=vs.85%2 9.aspx
or Form.DoubleBuffered:=True.
A locked window cannot be movedTry to use Panel.DoubleBuffered:=True
ASKER
Isn't there another way?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello, your informations helped me in writing IsWindowUpdateLocked function.
function IsWindowUpdateLocked() : boolean;
begin
Result := not LockWindowUpdate(Applicati on.Handle) ;
if(not Result)
then LockWindowUpdate(0);
end;
Consider that LockWindowUpdate fails if another window is update-locked.
Furthermore, LockWindowUpdate doesn't causes auto-update.
function IsWindowUpdateLocked() : boolean;
begin
Result := not LockWindowUpdate(Applicati
if(not Result)
then LockWindowUpdate(0);
end;
Consider that LockWindowUpdate fails if another window is update-locked.
Furthermore, LockWindowUpdate doesn't causes auto-update.