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 


executeCodeLocalEx EnumWindows callback function in lua

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Mon Jun 01, 2020 10:35 pm    Post subject: executeCodeLocalEx EnumWindows callback function in lua Reply with quote

hi

tried like this i have no idea
Code:
function enumcallback(hwnd, lparam)
print("test")
return true
end

executeCodeLocalEx("EnumWindows",enumcallback,0)


i read this topic https://forum.cheatengine.org/viewtopic.php?t=614401, no similiar function like enumwindows (if theres im sorry, ill recheck again please tell me Smile )
how i do enumwindows callback function in lua?

thanks, lynxz

_________________
my english is bad
discord : rynx#9828
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Tue Jun 02, 2020 12:16 am    Post subject: Reply with quote

you have to use autoassembler and implement a callback and give that address
_________________
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
Back to top
View user's profile Send private message MSN Messenger
Lynxz Gaming
Expert Cheater
Reputation: 4

Joined: 01 Jul 2017
Posts: 208
Location: help

PostPosted: Tue Jun 02, 2020 3:01 am    Post subject: Reply with quote

Dark Byte wrote:
you have to use autoassembler and implement a callback and give that address


i dont really get this, i need an example or some link i can learn, thank you

_________________
my english is bad
discord : rynx#9828
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Tue Jun 02, 2020 5:41 am    Post subject: Reply with quote

I don't know in CE Lua, but if in Win API + Alien, something like this:

Code:
require 'alien'
-- API
EnumWindows = alien.user32.EnumWindows
EnumWindows:types {"callback", "pointer", abi="stdcall"}

GetClassName = alien.user32.GetClassNameA
GetClassName:types {"long", "pointer", "int", abi="stdcall" }

-- callback
local buf = alien.buffer(512)
local function enum_func(hwnd, p)
  GetClassName(hwnd, buf, 511)
  print (hwnd..":"..tostring(buf))
  return 1
end
local callback_func = alien.callback(
   enum_func,
   {"int", "pointer", abi="stdcall"})
-- call
EnumWindows(callback_func, nil)


Maybe, try change 'alien' with 'executeCodeLocalEx'

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
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