function get_xy_lparam(lParam)
local lp = ffi.new("unsigned long[1]", lParam)
local x, y = ffi.cast("short*", lp), ffi.cast("short*", lp) + 1
x, y = x[0], y[0]
return x, y
end
function onWindowMessage(uMsg, wParam, lParam)
if msg == 513 then
local x, y = get_xy_lparam(lParam)
print(x, y)
end
end