public static void main(String[] args) throws Exception { HOOKPROC hookProc = new HOOKPROC_bg(); HINSTANCE hInst = Kernel32.INSTANCE.GetModuleHandle(null); User32.HHOOK hHook = User32.INSTANCE.SetWindowsHookEx(User32.WH_KEYBOARD_LL, hookProc, hInst, 0); if (hHook == null) return; User32.MSG msg = new User32.MSG(); System.err.println("Please press any key ...."); while (true) { User32.INSTANCE.GetMessage(msg, null, 0, 0); } }
HWND CreateWindowEx(int styleEx, String className, String windowName, int style, int x, int y, int width, int height, HWND parent, HMENU menu, HINSTANCE instance, Pointer param);
HINSTANCE ShellExecute(int hWnd, String lpVerb, String lpFile, String lpParameters, String lpDirectory, int nShow);