Texugo How do I cheat?
Reputation: 0
Joined: 14 Jan 2021 Posts: 1
|
Posted: Tue Jan 19, 2021 1:04 pm Post subject: Mouse clicks on a specific window. |
|
|
Hello how are u?
I'm used to AutoHotkey and a little bit of python, but totally new to the lua scripting. I wasn't sure if it was possible, but I've read some posts, virtual key and PostMessage documentation and I have a doubt about it.
I wrote this(and I can't test right now because i'm not at home). I want to click on a specific region of a specific window without move the mouse or without being unable to use the pc while running the script:
function control_click(x, y)
hwnd = findWindow('example')
coord = x,y
x,y = ScreenToClient(hwnd, coord)
lParam = MAKELONG(x,y)
PostMessage(hwnd, WM_LBUTTONDOWN, MK_LBUTTON, lParam)
PostMessage(hwnd, WM_LBUTTONUP, MK_LBUTTON, lParam)
If this piece of code works, to use PostMessage I have to provide:
HWND = It will identify wich window I want to click.
x, y = absolute coordinates converted to relative to the window coordinates.
WM_LBUTTONDOWN+UP = Send a left click on the specified window.
But at the description of MK_LBUTTON(0x0001) says "The left mouse button is down." Is there a MK_LBUTTON "UP"? |
|
Oxijen Expert Cheater
Reputation: 0
Joined: 07 May 2020 Posts: 163 Location: On The Moon
|
Posted: Wed Jan 20, 2021 12:50 pm Post subject: |
|
|
Ah, i still remember i asked questions about sendMessage for like 5 times, this function doesnt work on some games here is a tutorial youtube.com/watch?v=6dKywEy2u0Q made by xeome 👍 _________________
I can see you Hitler
Especially When I am On the Moon!!
You are Right now in cheat engine forum  |
|