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 


when can i use inMainThread() ?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
movss
Cheater
Reputation: 0

Joined: 10 Feb 2018
Posts: 40

PostPosted: Sun Mar 04, 2018 9:20 am    Post subject: when can i use inMainThread() ? Reply with quote

i have a sample:
function onOpenProcess(pid)
print("pid="..pid)
if inMainThread() then
print('in main thread')
end



but when i can use this function?

_________________
A wild programmer
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 353

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

PostPosted: Sun Mar 04, 2018 9:50 am    Post subject: Reply with quote

if you don't know for sure if your code is running in the GUI thread, you use it.

e.g. onOpenProcess can be called from any thread, even threads unrelated to opening a process

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Back to top
View user's profile Send private message MSN Messenger
movss
Cheater
Reputation: 0

Joined: 10 Feb 2018
Posts: 40

PostPosted: Sun Mar 04, 2018 2:10 pm    Post subject: Reply with quote

Dark Byte wrote:
if you don't know for sure if your code is running in the GUI thread, you use it.

e.g. onOpenProcess can be called from any thread, even threads unrelated to opening a process


is it possible i use this function in debugger_onBreakpoint(),for judge which thread is the execution of the current code?

maybe ,is not

is there a way to achieve this function?
maybe i should write a dll?

_________________
A wild programmer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
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
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