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:
@@ -6866,8 +6866,8 @@ extern wxWindow *wxGetWindowFromHWND(WXHWND hWnd)
|
|||||||
// in active frames and dialogs, regardless of where the focus is.
|
// in active frames and dialogs, regardless of where the focus is.
|
||||||
static HHOOK wxTheKeyboardHook = 0;
|
static HHOOK wxTheKeyboardHook = 0;
|
||||||
|
|
||||||
int APIENTRY
|
LRESULT APIENTRY
|
||||||
wxKeyboardHook(int nCode, WORD wParam, DWORD lParam)
|
wxKeyboardHook(int nCode, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
DWORD hiWord = HIWORD(lParam);
|
DWORD hiWord = HIWORD(lParam);
|
||||||
if ( nCode != HC_NOREMOVE && ((hiWord & KF_UP) == 0) )
|
if ( nCode != HC_NOREMOVE && ((hiWord & KF_UP) == 0) )
|
||||||
@@ -6934,7 +6934,7 @@ void wxSetKeyboardHook(bool doIt)
|
|||||||
wxTheKeyboardHook = ::SetWindowsHookEx
|
wxTheKeyboardHook = ::SetWindowsHookEx
|
||||||
(
|
(
|
||||||
WH_KEYBOARD,
|
WH_KEYBOARD,
|
||||||
(HOOKPROC)wxKeyboardHook,
|
wxKeyboardHook,
|
||||||
NULL, // must be NULL for process hook
|
NULL, // must be NULL for process hook
|
||||||
::GetCurrentThreadId()
|
::GetCurrentThreadId()
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user