Lua:sendMessage

From Cheat Engine
Jump to navigation Jump to search

sendMessage(hwnd, msg, wparam, lparam): result - Sends a message to a window. Those that wish to use it, should know how to use it (and fill in the msg id's yourself)

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessage

local WM_IME_CHAR = 0x0286
local hWnd = 0x000406E0

local text = "hello"

for i=1,#text do
  local c = string.sub(text, i, i)
  local wParam = textToShortCut(c)
  local lParam = textToShortCut(c)
  sendMessage( hWnd, WM_IME_CHAR, wParam, lParam )
end