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.
This commit is contained in:
Vadim Zeitlin
2018-05-27 23:25:15 +02:00
parent 4230cb24de
commit 4d1145787b

View File

@@ -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()
);