Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25857 Location: The netherlands
|
Posted: Sun May 05, 2019 3:33 am Post subject: |
|
|
| Code: |
local windows={}
local w=getWindow(getForegroundWindow(),GW_HWNDFIRST);
local i=0
local pid=getOpenedProcessID()
while (w~=0) and (i<10000) do
if getWindowProcessID(w)==pid then
windows[#windows+1]=w
end
w=getWindow(w,GW_HWNDNEXT);
i=i+1
end
--windows contains a windowlist of the target process
--in next CE version you can do executeCodeLocalEx which is more efficient, but for now use executeCodeEx which runs inside the target
local i
local rectaddress=allocateMemory(16)
local addr=getAddress("GetWindowRect")
for i=1,#windows do
local r=executeCodeEx(0,nil,addr,{type=0,value=windows[i]},{type=0,value=rectaddress})
if (r~=nil) and (r~=0) then
local left=readInteger(rectaddress)
local top=readInteger(rectaddress+4)
local right=readInteger(rectaddress+8)
local bottom=readInteger(rectaddress+12)
local s=string.format("%s is located at %d,%d with a width of %d and height of %d", getWindowCaption(windows[i]), left,top,right-left,bottom-top)
print(s)
end
end
deAlloc(rectaddress)
|
_________________
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 |
|