Difference between revisions of "Lua:getMemoryViewForm"

From Cheat Engine
Jump to navigation Jump to search
m
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' getMemoryViewForm() ''':''' [[Lua:Class:MemoryView]]
+
{{CodeBox|'''function''' getMemoryViewForm() ''':''' Form}}
  
Returns the main memory view [[Form]] class object which can be accessed using the [[Form]] class methods
+
Returns the main Memory View form object.
and the methods of the classes it inherits from. There can be multiple memory views,
 
but this will only find the original/base.
 
  
{{LuaFunctionParametersNone}}
+
There can be multiple Memory View windows, but this function only returns the original/base Memory View form. The returned object can be accessed using the Form class methods and the methods of the classes it inherits from.
  
== Examples ==
+
===Function Parameters===
-- see MemoryBrowserFormUnit in CE source
+
This function has no parameters.
local frm = getMemoryViewForm()
 
local hv = frm.HexadecimalView
 
--
 
-- see hexviewunit in CE source
 
--  TDisplayType = (dtByte, dtByteDec, dtWord, dtWordDec, dtDword, dtDwordDec, dtQword, dtQwordDec, dtSingle, dtDouble);
 
hv.address = 0x540000
 
hv.DisplayType = 4 -- dtDword
 
  
 +
===Returns===
 +
Form — The main Memory View form object.
 +
 +
===Examples===
 +
<pre>
 +
local memoryView = getMemoryViewForm()
 +
 +
if memoryView ~= nil then
 +
  memoryView.show()
 +
  memoryView.bringToFront()
 +
end
 +
</pre>
 +
 +
<pre>
 +
local memoryView = getMemoryViewForm()
 +
 +
if memoryView ~= nil then
 +
  print("Memory View caption: " .. tostring(memoryView.Caption))
 +
  print("Visible: " .. tostring(memoryView.Visible))
 +
end
 +
</pre>
 +
 +
<pre>
 +
local memoryView = getMemoryViewForm()
 +
 +
if memoryView ~= nil and memoryView.isForegroundWindow() then
 +
  print("The main Memory View is currently focused")
 +
end
 +
</pre>
 +
 +
===Notes===
 +
* This function returns the original/base Memory View form.
 +
* It does not return additional Memory View windows that may have been opened.
 +
* The returned object can be used like a Form object.
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
=== Related Functions ===
+
{{Forms}}
* [[Lua:getForm|getForm]]
 
* [[Lua:getFormCount|getFormCount]]
 
* [[Lua:getMainForm|getMainForm]]
 
* [[Lua:getSettingsForm|getSettingsForm]]
 
* [[Lua:getLuaEngine|getLuaEngine]]
 
* [[Lua:registerFormAddNotification|registerFormAddNotification]]
 
 
 
=== Related Classes ===
 
* [[Lua:Class:Form|Form]]
 
* [[Lua:Class:Component|Component]]
 
* [[Lua:Class:Control|Control]]
 
* [[Lua:Class:WinControl|WinControl]]
 
* [[Lua:Class:Application|Application]]
 
* [[Lua:Class:Object|Object]]
 

Revision as of 21:06, 24 June 2026

<> Lua API Reference

function getMemoryViewForm() : Form

Returns the main Memory View form object.

There can be multiple Memory View windows, but this function only returns the original/base Memory View form. The returned object can be accessed using the Form class methods and the methods of the classes it inherits from.

Function Parameters

This function has no parameters.

Returns

Form — The main Memory View form object.

Examples

local memoryView = getMemoryViewForm()

if memoryView ~= nil then
  memoryView.show()
  memoryView.bringToFront()
end
local memoryView = getMemoryViewForm()

if memoryView ~= nil then
  print("Memory View caption: " .. tostring(memoryView.Caption))
  print("Visible: " .. tostring(memoryView.Visible))
end
local memoryView = getMemoryViewForm()

if memoryView ~= nil and memoryView.isForegroundWindow() then
  print("The main Memory View is currently focused")
end

Notes

  • This function returns the original/base Memory View form.
  • It does not return additional Memory View windows that may have been opened.
  • The returned object can be used like a Form object.

Main Pages

Core Lua documentation entry points

Lua
Script Engine

Form Related Classes