From 4d1145787b9c860f3eaa8b647ccde86bbcab1819 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 May 2018 23:25:15 +0200 Subject: [PATCH] Fix wxKeyboardHook() callback signature in Win64 build The callback must return LRESULT, which is 64 bits under Win64, not int, which is still 32 bits. This fixes a gcc8 -Wcast-function-type warning and might fix a real bug in Win64 build too. --- src/msw/window.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 2da6726752..cd7e253ebe 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -6866,8 +6866,8 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd) // in active frames and dialogs, regardless of where the focus is. static HHOOK wxTheKeyboardHook = 0; -int APIENTRY -wxKeyboardHook(int nCode, WORD wParam, DWORD lParam) +LRESULT APIENTRY +wxKeyboardHook(int nCode, WXWPARAM wParam, WXLPARAM lParam) { DWORD hiWord = HIWORD(lParam); if ( nCode != HC_NOREMOVE && ((hiWord & KF_UP) == 0) ) @@ -6934,7 +6934,7 @@ void wxSetKeyboardHook(bool doIt) wxTheKeyboardHook = ::SetWindowsHookEx ( WH_KEYBOARD, - (HOOKPROC)wxKeyboardHook, + wxKeyboardHook, NULL, // must be NULL for process hook ::GetCurrentThreadId() );