Lua:getWindowCaption
Jump to navigation
Jump to search
Returns the caption text of a window.
The window is identified by its window handle.
Contents
Function Parameters
| Parameter | Type | Description |
|---|---|---|
| windowhandle | Integer | The handle of the window whose caption should be returned. |
Returns
String — The caption text of the specified window.
Examples
local form = createForm() form.Caption = "Example Window" local caption = getWindowCaption(form.Handle) print(caption)
local mainForm = getMainForm()
if mainForm ~= nil then
local caption = getWindowCaption(mainForm.Handle)
print("Main form caption: " .. tostring(caption))
end
local memoryView = getMemoryViewForm() if memoryView ~= nil then print(getWindowCaption(memoryView.Handle)) end
Notes
- The function requires a valid window handle.
- For Cheat Engine controls and forms, the Handle property can usually be used.
- For normal Cheat Engine form objects, reading the Caption property directly is usually simpler.