Lua:registerFormAddNotification

From Cheat Engine
Revision as of 00:04, 11 July 2025 by Leunsel (talk | contribs) (Created page with "Category:Lua '''function''' registerFormAddNotification(''Callback'') ''':''' Object Registers a function to be called whenever a form is added to Cheat Engine's form lis...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

function registerFormAddNotification(Callback) : Object

Registers a function to be called whenever a form is added to Cheat Engine's form list. This is useful for extensions that add new functionality to certain existing forms. Returns an object that can be used with unregisterFormAddNotification to remove the notification.

Function Parameters

Parameter Type Description
Callback Function A function that takes one parameter (the form object) and is called when a form is added.

Examples

-- Print the class name of every form that gets added
local notif = registerFormAddNotification(function(form)
  print("Form added: " .. (form.ClassName or "Unknown"))
end)

-- Later, you can unregister the notification:
unregisterFormAddNotification(notif)

See also