Joined: 09 May 2003 Posts: 25820 Location: The netherlands
Posted: Mon Jul 30, 2007 7:29 pm Post subject:
he wants to stop it on a event like pressing a button
If you look at the code the tflash object is created like this:
Code:
flashprocessbutton:=tflash.create(false);
that means flashprocessbutton (a variable) gets the address of the newly created tflash object
now, in the buttonclick I have the code:
Code:
if flashprocessbutton<>nil then
begin
flashprocessbutton.Terminate;
flashprocessbutton:=nil;
end;
It checks if the flash thread was created, and if so tell it to terminate (.terminate sets the terminated boolean to true) and clears the reference to it (and I see I forgot setting the freeonterminate boolean to true so a small mem leak here)
Then in the thread's while loop it will see terminated is true so exits the thread, and the cleanup code of the thread (after the loop) is executed which contains
Code:
mainform.Panel7.Color:=clBtnFace;
which sets the color to the main background
so, make a var (global or in mainform of type tflash) and give that the output of tflash.create(...);
then in the code you can do varname.terminate; _________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping
Last edited by Dark Byte on Tue Jul 31, 2007 7:05 am; edited 1 time in total
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
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 You cannot attach files in this forum You can download files in this forum