|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
movss Cheater Reputation: 0
Joined: 10 Feb 2018 Posts: 38
|
Posted: Thu Feb 22, 2018 5:47 am Post subject: how to use hookWndProc() |
|
|
i can use this with C++
but,don't know the params in lua,
anyone can post a sample?
thanks
_________________
A wild programmer |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Thu Feb 22, 2018 10:05 am Post subject: |
|
|
it's currently not working as I intended (quite buggy, and for some reason crashes on first run but not on second) but if it worked, it'd be like this:
Code: |
cetutwindow=findWindow(nil,"Cheat Engine Tutorial v3.4") --first window of the tutorial
if getWindowProcessID(cetutwindow)~=getOpenedProcessID() then
showMessage('wrong window')
return
end
-- Hooks a window's wndproc procedure. The given function will receive all functions. Return 0 to say you handled it. 1 to let the default windows handler deal with it. Or anything else, to let the original handler deal with it. Besides the return value, you can also return hWnd, Msg, lParam and wParam, modified, or nil for the original value. Set ASYNC to true if you don't want to run this in the CE GUI. (faster, but you can't touch gui objects)
function myfilter(hwnd, msg, wparam, lparam)
local s=string.format("%x",msg)
if msg==0x0201 then
s=s..":Down"
print(s)
end
return 2 --let the target deal with it normally (1 to not let the target deal with it specially, but let windows do it. 0 for no handling at all)
end
hookWndProc(cetutwindow, myfilter, false)
|
_________________
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 |
|
|
movss Cheater Reputation: 0
Joined: 10 Feb 2018 Posts: 38
|
Posted: Sat Feb 24, 2018 1:52 am Post subject: |
|
|
Dark Byte wrote: | it's currently not working as I intended (quite buggy, and for some reason crashes on first run but not on second) but if it worked, i\
[/code] |
thank you DB,
i think the prototype of this function is SetwindowLong and CALLBACK WindowProc
LONG SetWindowLong(
HWND hWnd, // handle to window
int nIndex, // offset of value to set
LONG dwNewLong // new value);
LRESULT CALLBACK WindowProc( HWND hwnd, // handle to window
UINT uMsg, // message identifier
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter);
_________________
A wild programmer |
|
Back to top |
|
|
|
|
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
|
|