From 8bbe683f61af82bfb3025ccf4d23885d211ca90b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 25 Feb 2015 19:44:48 +0100 Subject: [PATCH] Fix using RegisterHotKey() with negative IDs in wxMSW. This was broken due to a wrong cast from WPARAM (i.e. 32 bit unsigned int in Win32) value containing the ID to WORD (i.e. 16 bit unsigned short) which truncated the ID value. Notice that MSDN documents the requirement for the IDs to be positive, but negative IDs seem to work, at least with Windows 7, after this fix. Closes #16880. --- docs/changes.txt | 1 + src/msw/window.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index df2d70e9e9..8b953d7ae2 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -609,6 +609,7 @@ wxMSW: - Fix disabling submenu items in the menus (Artur Wieczorek). - Fix wxEVT_TREE_STATE_IMAGE_CLICK generation (Antal). - Fix wxDV_ROW_LINES in horizontally scrolled wxDataViewCtrl. +- Fix RegisterHotKey() with negative IDs (troelsk). wxOSX: diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 55e8e948d3..7943f62ff0 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3245,7 +3245,7 @@ wxWindowMSW::MSWHandleMessage(WXLRESULT *result, #if wxUSE_HOTKEY case WM_HOTKEY: - processed = HandleHotKey((WORD)wParam, lParam); + processed = HandleHotKey(wParam, lParam); break; #endif // wxUSE_HOTKEY