Lua:closeRemoteHandle

From Cheat Engine
Revision as of 16:57, 21 June 2026 by Leunsel (talk | contribs) (Initial page creation.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<> 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

local handles = getHandleList(1)

if #handles > 0 then
  local handle = handles[1]

  if closeRemoteHandle(handle.HandleValue, handle.ProcessID) then
    print("Handle closed")
  else
    print("Failed to close handle")
  end
end

Main Pages

Core Lua documentation entry points

Lua
Script Engine