Skip to content

Commit 4be2fec

Browse files
Use W versions of Win32 functions
1 parent 36989ff commit 4be2fec

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/win/hook.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use winapi::{
1111
windef::{HHOOK, HWND, POINT},
1212
},
1313
um::{
14-
libloaderapi::GetModuleHandleA,
14+
libloaderapi::GetModuleHandleW,
1515
processthreadsapi::GetCurrentThreadId,
1616
winuser::{
17-
CallNextHookEx, SetWindowsHookExA, UnhookWindowsHookEx, HC_ACTION, MSG, PM_REMOVE,
17+
CallNextHookEx, SetWindowsHookExW, UnhookWindowsHookEx, HC_ACTION, MSG, PM_REMOVE,
1818
WH_GETMESSAGE, WM_CHAR, WM_KEYDOWN, WM_KEYUP, WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP,
1919
WM_USER,
2020
},
@@ -66,10 +66,10 @@ pub(crate) fn init_keyboard_hook(hwnd: HWND) -> KeyboardHookHandle {
6666
} else {
6767
// keyboard hook doesn't exist (no windows open before this), create it
6868
let new_hook = KeyboardHook(unsafe {
69-
SetWindowsHookExA(
69+
SetWindowsHookExW(
7070
WH_GETMESSAGE,
7171
Some(keyboard_hook_callback),
72-
GetModuleHandleA(ptr::null()),
72+
GetModuleHandleW(ptr::null()),
7373
GetCurrentThreadId(),
7474
)
7575
});

0 commit comments

Comments
 (0)