Difference between revisions of "Lua:closeRemoteHandle"

From Cheat Engine
Jump to navigation Jump to search
(Initial page creation.)
 
m (Syntax Highlighting.)
Line 25: Line 25:
  
 
===Examples===
 
===Examples===
<pre>
+
<syntaxhighlight lang="lua" line>
 
local handles = getHandleList(1)
 
local handles = getHandleList(1)
  
Line 37: Line 37:
 
   end
 
   end
 
end
 
end
</pre>
+
</syntaxhighlight>
  
 
{{LuaSeeAlso}}
 
{{LuaSeeAlso}}

Revision as of 19:17, 25 June 2026

<> Lua API Reference

function closeRemoteHandle(handle, processid) : boolean

Closes a handle owned by a process.

If processid is provided, the handle is closed in the specified process. If processid is omitted, the handle is closed using the currently opened target process context.

Function Parameters

Parameter Type Description
handle Integer The handle value to close.
processid Integer (optional) The ID of the process that owns the handle.

Returns

boolean — True if the handle was closed successfully, otherwise false.

Examples

 1 local handles = getHandleList(1)
 2 
 3 if #handles > 0 then
 4   local handle = handles[1]
 5 
 6   if closeRemoteHandle(handle.HandleValue, handle.ProcessID) then
 7     print("Handle closed")
 8   else
 9     print("Failed to close handle")
10   end
11 end

Main Pages

Core Lua documentation entry points

Lua
Script Engine