Difference between revisions of "Lua:getWindow"

From Cheat Engine
Jump to navigation Jump to search
(add example)
 
m (fix typo)
 
Line 1: Line 1:
[https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindow Microsoft docucumentation]
+
[https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindow Microsoft documentation]
  
  

Latest revision as of 08:06, 9 July 2023

Microsoft documentation


HWND GetWindow(
 [in] HWND hWnd,
 [in] UINT uCmd
);

Example[edit]

Start Cheat Engine and open a Memory Viewer, then go to the Lua Engine and execute this:

local hwnd = findWindow(null, "Lua Engine")
local memViewer = getWindow(hwnd, GW_HWNDNEXT)
local childCaption = getWindowCaption(memViewer)
print(hwnd, memViewer, childCaption)

Output should be like this:

1835872 328890 Memory Viewer