Joined: 16 Oct 2022 Posts: 6 Location: Planet Earth
Posted: Tue May 07, 2024 3:01 pm Post subject: How to iterate over items in the form?
I'm trying to modify "Select current function" item in the Memory View Form, accessing it with this code:
Code:
local form = getMemoryViewForm()
local item = form.MenuItem2
It used to work on CE 7.4 but doesn't work on 7.5. I reckon there might've been some changes. I'd like to know how I can iterate over Memory View's items until I find the correct class name using Caption for comparison.
I'd just look at the source code. Find the relevant lfm file (i.e. Cheat Engine/MemoryBrowserFormUnit.lfm) and search for the caption of the GUI component you want to find. The name is how you access it.
Code:
local mi = getMemoryViewForm().miSelectCurrentFunction
If you really want to iterate over components:
Code:
local form = getMemoryViewForm()
for i = 0, form.ComponentCount - 1 do
local c = form.Component[i]
print(c.Name)
end
Most things are owned by the form itself, but if you want everything, you'll need to do that recursively. _________________
I don't know where I'm going, but I'll figure it out when I get there.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum