BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Scroll an Thread

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
ArdiIIa
Guest





PostPosted: Fri Apr 23, 2004 6:03 pm    Post subject: Scroll an Thread Reply with quote



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:






Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.