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.
This commit is contained in:
Vadim Zeitlin
2015-02-25 19:44:48 +01:00
parent 82106a9d9e
commit 8bbe683f61
2 changed files with 2 additions and 1 deletions

View File

@@ -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:

View File

@@ -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