Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Disabling threading (From CE Source...) ?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Mon Jul 30, 2007 6:10 pm    Post subject: Reply with quote

Why don't you just remove the procedure and all the references to it? This way you don't waste resources enabling then immediately disabling it.
Back to top
View user's profile Send private message
DeletedUser14087
I post too much
Reputation: 2

Joined: 21 Jun 2006
Posts: 3069

PostPosted: Mon Jul 30, 2007 6:15 pm    Post subject: Reply with quote

appalsap wrote:
Why don't you just remove the procedure and all the references to it? This way you don't waste resources enabling then immediately disabling it.


What this person said im afraid is....correct Sad
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25820
Location: The netherlands

PostPosted: Mon Jul 30, 2007 7:29 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message MSN Messenger
Kevin
Grandmaster Cheater Supreme
Reputation: 0

Joined: 07 Mar 2007
Posts: 1139
Location: Spiderman-World

PostPosted: Tue Jul 31, 2007 4:57 am    Post subject: Reply with quote

Thanks!!

edit: And it works Wink
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites