Difference between revisions of "Lua:openProcess"

From Cheat Engine
Jump to navigation Jump to search
m
m (Added CodeBox Template.)
 
Line 1: Line 1:
 
[[Category:Lua]]
 
[[Category:Lua]]
'''function''' openProcess(''ProcessID'')
+
{{CodeBox|'''function''' openProcess(''ProcessID'')}}
'''function''' openProcess(''ProcessName'')
+
{{CodeBox|'''function''' openProcess(''ProcessName'')}}
  
 
Opens the specified process in Cheat Engine, either by process ID or by process name.   
 
Opens the specified process in Cheat Engine, either by process ID or by process name.   
Line 35: Line 35:
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}
  
=== Related Functions ===
+
{{Process}}
* [[Lua:getProcesslist|getProcesslist]]
 
* [[Lua:getOpenedProcessID|getOpenedProcessID]]
 
* [[Lua:getProcessIDFromProcessName|getProcessIDFromProcessName]]
 
* [[Lua:createProcess|createProcess]]
 
* [[Lua:openFileAsProcess|openFileAsProcess]]
 

Latest revision as of 00:47, 5 December 2025

<> Function

function openProcess(ProcessID)

<> Function

function openProcess(ProcessName)

Opens the specified process in Cheat Engine, either by process ID or by process name. This sets the target process for memory editing and scanning.

Function Parameters[edit]

Parameter Type Description
ProcessID Integer The ID of the process to open.
ProcessName String The name of the process to find and open (e.g., "notepad.exe").

Examples[edit]

-- Open a process by name
openProcess("notepad.exe")

-- Open a process by ID
local pid = getProcessIDFromProcessName("notepad.exe")
if pid then
  openProcess(pid)
end

See also[edit]

Lua
Script Engine

Related Functions[edit]

createProcess
openProcess
onOpenProcess
getForegroundProcess
getOpenedProcessID
getProcessIDFromProcessName
openFileAsProcess
saveOpenedFile
setPointerSize
setAssemblerMode
getProcesslist
getWindowlist
pause
unpause
targetIs64Bit
enumModules
closeRemoteHandle