ArdiIIa Guest
|
Posted: Fri Apr 23, 2004 6:03 pm Post subject: Scroll an Thread |
|
|
Hello friends:
I am lost; I have a thread that takes charge of carrying out a scroll in the
area client of the main window:
is the Scroll carried out well, however, when the main window receives a
message (mouse movement) for example, does the procedure stop to DRAW,
although the thread continues in execution which the problem is?
NOTICE: I have proven with WaitForSingleObject and with
EnterCriticalSection, and the result is the same one.
procedure THilo.Execute;
Var
ScrollRect, ClipRect, UpdateRect , Recta : TRect;
Dc : HDC;
begin
GetClientRect(FHandleWindow,Recta);
Dc := GetDc( FHandleWindow);
ScrollRect := Rect(0,0,Recta.Right,FImage.Graphic.Height);
ClipRect := ScrollRect;
FIncremento := 1;
While Not Terminated DO
Begin
Sleep(50);
// WaitForSingleObject(FMutex, INFINITE);
ScrollDC(Fondo.Canvas.Handle, FIncremento , 0, ScrollRect, ClipRect,
0, @UpdateRect);
Fondo.Canvas.CopyRect(UpdateRect, Fondo.Canvas, Rect( Recta.Right -
FIncremento , 0, Recta.Right ,Fimage.Graphic.Height));
BitBlt(DC, 0, 0,Recta.Right, Recta.Bottom,
Fondo.Canvas.Handle,0,0,SRCCOPY)
// ReleaseMutex(FMutex);
End;
ReleaseDc(FHandleWindow,DC);
end;
The code:
|
|