Call Windows SetWinEventHook from nodejs
问题 I'm trying to call SetWinEventHook as described here for C# but from nodejs. I'm using ffi-napi to bind to the function. Here's my code so far: const ffi = require("ffi-napi") const user32 = ffi.Library("user32", { SetWinEventHook: ["int", ["int", "int", "pointer", "pointer", "int", "int", "int"]] }) const pfnWinEventProc = ffi.Callback("void", ["pointer", "int", "pointer", "long", "long", "int", "int"], function (hWinEventHook, event, hwnd, idObject, idChild, idEventThread, dwmsEventTime) {