| View previous topic :: View next topic |
| Author |
Message |
liekong1991 How do I cheat?
Reputation: 0
Joined: 08 Feb 2020 Posts: 6
|
Posted: Thu Feb 25, 2021 3:25 am Post subject: Is there a way to get the desktop window's coordinate? |
|
|
For example, I want to get the coordinate (In Windows, the left-top corner of the main monitor is (0,0)) of the MEmu's Form, is there some lua code can do that? Actually I've try some code in forum to get the size of the window but the result is incorrect (see the screenshot)
| Description: |
|
| Filesize: |
674.16 KB |
| Viewed: |
1262 Time(s) |

|
|
|
| Back to top |
|
 |
blankTM Cheater
Reputation: 1
Joined: 03 May 2020 Posts: 49
|
Posted: Thu Feb 25, 2021 5:44 am Post subject: Re: Is there a way to get the desktop window's coordinate? |
|
|
function GetWindowRect(hWnd)
local My = createMemoryStream()
My.Size= 16
executeCodeLocalEx('user32.GetWindowRect',hWnd,My.Memory)
local left= My.readDword()
if left > 0xffffff then
left= -0xfffffffe~left
end
local RECT ={
left=left,
top=My.readDword(),
right=My.readDword(),
bottom=My.readDword()
}
My.destroy()
return RECT
end
|
|
| Back to top |
|
 |
|