mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 15:16:35 +00:00
[INCLUDE][ATL] Fix WM_SETHOTKEY macro wrappers
WM_SETHOTKEY / WM_GETHOTKEY messages encode the hotkey in a different
way than with the WM_HOTKEY message.
For more details, see:
https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-gethotkey
https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-sethotkey
Addendum to commit 6829350af9
(PR #7947)
This commit is contained in:
parent
3bb27eb416
commit
f20efc6007
3 changed files with 12 additions and 12 deletions
|
@ -15,7 +15,7 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef _INC_WINXX
|
||||
#include "winxx.h" /* An unofficial extension of <windowsx.h>. */
|
||||
#include "winxx.h" /* An unofficial extension of <windowsx.h> */
|
||||
#endif
|
||||
#ifndef _INC_SHELLAPI
|
||||
#include <shellapi.h>
|
||||
|
@ -1308,14 +1308,14 @@ MD_OnHotKey(HWND hwnd, int idHotKey, UINT fuModifiers, UINT vk)
|
|||
}
|
||||
|
||||
static __inline INT MSGDUMP_API
|
||||
MD_OnSetHotKey(HWND hwnd, INT nCode, UINT nOptions)
|
||||
MD_OnSetHotKey(HWND hwnd, WORD wVkCode, WORD wModifiers)
|
||||
{
|
||||
MSGDUMP_TPRINTF(TEXT("%sWM_SETHOTKEY(hwnd:%p, nCode:%d, nOptions:%u)\n"),
|
||||
MSGDUMP_PREFIX, (void *)hwnd, nCode, nOptions);
|
||||
MSGDUMP_TPRINTF(TEXT("%sWM_SETHOTKEY(hwnd:%p, wVkCode:%u, wModifiers:%u)\n"),
|
||||
MSGDUMP_PREFIX, (void *)hwnd, wVkCode, wModifiers);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static __inline INT MSGDUMP_API
|
||||
static __inline DWORD MSGDUMP_API
|
||||
MD_OnGetHotKey(HWND hwnd)
|
||||
{
|
||||
MSGDUMP_TPRINTF(TEXT("%sWM_GETHOTKEY(hwnd:%p)\n"),
|
||||
|
|
|
@ -33,20 +33,20 @@
|
|||
((fn)((hwnd), WM_NULL, 0, 0L), 0L)
|
||||
#endif
|
||||
|
||||
/* INT Cls_OnSetHotKey(HWND hwnd, INT nCode, UINT nOptions) */
|
||||
/* INT Cls_OnSetHotKey(HWND hwnd, WORD wVkCode, WORD wModifiers) */
|
||||
#ifndef HANDLE_WM_SETHOTKEY
|
||||
#define HANDLE_WM_SETHOTKEY(hwnd, wParam, lParam, fn) \
|
||||
(LRESULT)(INT_PTR)(INT)(fn)((hwnd), (INT)LOWORD(wParam), (UINT)HIWORD(wParam))
|
||||
#define FORWARD_WM_SETHOTKEY(hwnd, nCode, nOptions, fn) \
|
||||
(INT)(fn)((hwnd), WM_SETHOTKEY, MAKEWPARAM((nCode), (nOptions)))
|
||||
(LRESULT)(INT_PTR)(INT)(fn)((hwnd), (WORD)LOBYTE(LOWORD(wParam)), (WORD)HIBYTE(LOWORD(wParam)))
|
||||
#define FORWARD_WM_SETHOTKEY(hwnd, wVkCode, wModifiers, fn) \
|
||||
(INT)(fn)((hwnd), WM_SETHOTKEY, (WPARAM)MAKEWORD((wVkCode), (wModifiers)), 0L)
|
||||
#endif
|
||||
|
||||
/* INT Cls_OnGetHotKey(HWND hwnd) */
|
||||
#ifndef HANDLE_WM_GETHOTKEY
|
||||
#define HANDLE_WM_GETHOTKEY(hwnd, wParam, lParam, fn) \
|
||||
(LRESULT)(INT_PTR)(INT)(fn)((hwnd))
|
||||
(LRESULT)(UINT_PTR)(DWORD)(fn)((hwnd))
|
||||
#define FORWARD_WM_GETHOTKEY(hwnd, fn) \
|
||||
(INT)(fn)((hwnd), WM_GETHOTKEY, 0, 0L)
|
||||
(DWORD)(fn)((hwnd), WM_GETHOTKEY, 0, 0L)
|
||||
#endif
|
||||
|
||||
/* void Cls_OnPaintIcon(HWND hwnd) */
|
||||
|
|
|
@ -1210,7 +1210,7 @@ public:
|
|||
int SetHotKey(WORD wVirtualKeyCode, WORD wModifiers)
|
||||
{
|
||||
ATLASSERT(::IsWindow(m_hWnd));
|
||||
return ::SendMessage(m_hWnd, WM_SETHOTKEY, MAKEWPARAM(wVirtualKeyCode, wModifiers), 0);
|
||||
return (int)::SendMessage(m_hWnd, WM_SETHOTKEY, MAKEWORD(wVirtualKeyCode, wModifiers), 0);
|
||||
}
|
||||
|
||||
HICON SetIcon(HICON hIcon, BOOL bBigIcon = TRUE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue