ReactOS  0.4.14-dev-368-gfa26425
hotkey.c
Go to the documentation of this file.
1 /*
2  * Hotkey control
3  *
4  * Copyright 1998, 1999 Eric Kohl
5  * Copyright 2002 Gyorgy 'Nog' Jeney
6  * Copyright 2004 Robert Shearman
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  *
22  * This code was audited for completeness against the documented features
23  * of Comctl32.dll version 6.0 on Sep. 21, 2004, by Robert Shearman.
24  *
25  * Unless otherwise noted, we believe this code to be complete, as per
26  * the specification mentioned above.
27  * If you discover missing features or bugs please note them below.
28  *
29  */
30 
31 #include <stdarg.h>
32 #include <string.h>
33 #include "windef.h"
34 #include "winbase.h"
35 #include "wingdi.h"
36 #include "winuser.h"
37 #include "winnls.h"
38 #include "commctrl.h"
39 #include "comctl32.h"
40 #include "wine/debug.h"
41 #include "wine/heap.h"
42 
44 
45 typedef struct tagHOTKEY_INFO
46 {
58  WCHAR strNone[15]; /* hope it's long enough ... */
59 } HOTKEY_INFO;
60 
61 static const WCHAR HOTKEY_plussep[] = { ' ', '+', ' ' };
63 
64 #define IsOnlySet(flags) (infoPtr->CurrMod == (flags))
65 
66 static BOOL
68 {
69  TRACE("(infoPtr=%p)\n", infoPtr);
70  if((infoPtr->InvComb & HKCOMB_NONE) && !infoPtr->CurrMod)
71  return TRUE;
72  if((infoPtr->InvComb & HKCOMB_S) && IsOnlySet(HOTKEYF_SHIFT))
73  return TRUE;
74  if((infoPtr->InvComb & HKCOMB_C) && IsOnlySet(HOTKEYF_CONTROL))
75  return TRUE;
76  if((infoPtr->InvComb & HKCOMB_A) && IsOnlySet(HOTKEYF_ALT))
77  return TRUE;
78  if((infoPtr->InvComb & HKCOMB_SC) &&
80  return TRUE;
81  if((infoPtr->InvComb & HKCOMB_SA) && IsOnlySet(HOTKEYF_SHIFT | HOTKEYF_ALT))
82  return TRUE;
83  if((infoPtr->InvComb & HKCOMB_CA) &&
85  return TRUE;
86  if((infoPtr->InvComb & HKCOMB_SCA) &&
88  return TRUE;
89 
90  TRACE("() Modifiers are valid\n");
91  return FALSE;
92 }
93 #undef IsOnlySet
94 
95 static void
97 {
98  SIZE TextSize;
99  INT nXStart, nYStart;
100  COLORREF clrOldText, clrOldBk;
101  HFONT hFontOld;
102 
103  /* Make a gap from the frame */
104  nXStart = GetSystemMetrics(SM_CXBORDER);
105  nYStart = GetSystemMetrics(SM_CYBORDER);
106 
107  hFontOld = SelectObject(hdc, infoPtr->hFont);
108  if (GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED)
109  {
112  }
113  else
114  {
116  clrOldBk = SetBkColor(hdc, comctl32_color.clrWindow);
117  }
118 
119  TextOutW(hdc, nXStart, nYStart, KeyName, NameLen);
120 
121  /* Get the text width for the caret */
122  GetTextExtentPoint32W(hdc, KeyName, NameLen, &TextSize);
123  infoPtr->CaretPos = nXStart + TextSize.cx;
124 
125  SetBkColor(hdc, clrOldBk);
126  SetTextColor(hdc, clrOldText);
127  SelectObject(hdc, hFontOld);
128 
129  /* position the caret */
130  SetCaretPos(infoPtr->CaretPos, nYStart);
131 }
132 
133 /* Draw the names of the keys in the control */
134 static void
136 {
137  WCHAR KeyName[64];
138  WORD NameLen = 0;
139  BYTE Modifier;
140 
141  TRACE("(infoPtr=%p hdc=%p)\n", infoPtr, hdc);
142 
143  if(!infoPtr->CurrMod && !infoPtr->HotKey) {
144  HOTKEY_DrawHotKey (infoPtr, hdc, infoPtr->strNone, lstrlenW(infoPtr->strNone));
145  return;
146  }
147 
148  if(infoPtr->HotKey)
149  Modifier = HIBYTE(infoPtr->HotKey);
150  else if(HOTKEY_IsCombInv(infoPtr))
151  Modifier = infoPtr->InvMod;
152  else
153  Modifier = infoPtr->CurrMod;
154 
155  if(Modifier & HOTKEYF_CONTROL) {
157  KeyName, 64);
158  NameLen = lstrlenW(KeyName);
159  memcpy(&KeyName[NameLen], HOTKEY_plussep, sizeof(HOTKEY_plussep));
160  NameLen += 3;
161  }
162  if(Modifier & HOTKEYF_SHIFT) {
164  &KeyName[NameLen], 64 - NameLen);
165  NameLen = lstrlenW(KeyName);
166  memcpy(&KeyName[NameLen], HOTKEY_plussep, sizeof(HOTKEY_plussep));
167  NameLen += 3;
168  }
169  if(Modifier & HOTKEYF_ALT) {
171  &KeyName[NameLen], 64 - NameLen);
172  NameLen = lstrlenW(KeyName);
173  memcpy(&KeyName[NameLen], HOTKEY_plussep, sizeof(HOTKEY_plussep));
174  NameLen += 3;
175  }
176 
177  if(infoPtr->HotKey) {
178  GetKeyNameTextW(infoPtr->ScanCode, &KeyName[NameLen], 64 - NameLen);
179  NameLen = lstrlenW(KeyName);
180  }
181  else
182  KeyName[NameLen] = 0;
183 
184  HOTKEY_DrawHotKey (infoPtr, hdc, KeyName, NameLen);
185 }
186 
187 static void
189 {
190  if (hdc)
191  HOTKEY_Refresh(infoPtr, hdc);
192  else {
193  PAINTSTRUCT ps;
194  hdc = BeginPaint (infoPtr->hwndSelf, &ps);
195  HOTKEY_Refresh (infoPtr, hdc);
196  EndPaint (infoPtr->hwndSelf, &ps);
197  }
198 }
199 
200 static LRESULT
202 {
203  TRACE("(infoPtr=%p) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr,
204  HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey));
205  return (LRESULT)infoPtr->HotKey;
206 }
207 
208 static void
210 {
211  infoPtr->HotKey = hotKey;
212  infoPtr->ScanCode =
213  MAKELPARAM(0, MapVirtualKeyW(LOBYTE(infoPtr->HotKey), 0));
214  TRACE("(infoPtr=%p hotKey=%x) Modifiers: 0x%x, Virtual Key: %d\n", infoPtr,
215  hotKey, HIBYTE(infoPtr->HotKey), LOBYTE(infoPtr->HotKey));
216  InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
217 }
218 
219 static void
220 HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod)
221 {
222  infoPtr->InvComb = invComb;
223  infoPtr->InvMod = invMod;
224  TRACE("(infoPtr=%p) Invalid Modifers: 0x%x, If Invalid: 0x%x\n", infoPtr,
225  infoPtr->InvComb, infoPtr->InvMod);
226 }
227 
228 
229 static LRESULT
230 HOTKEY_Create (HOTKEY_INFO *infoPtr, const CREATESTRUCTW *lpcs)
231 {
232  infoPtr->hwndNotify = lpcs->hwndParent;
233 
235 
236  return 0;
237 }
238 
239 
240 static LRESULT
242 {
243  /* free hotkey info data */
244  SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
245  heap_free (infoPtr);
246  return 0;
247 }
248 
249 
250 static LRESULT
252 {
253  HBRUSH hBrush, hSolidBrush = NULL;
254  RECT rc;
255 
256  if (GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED)
257  hBrush = hSolidBrush = CreateSolidBrush(comctl32_color.clrBtnFace);
258  else
259  {
260  hBrush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLOREDIT,
261  (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
262  if (!hBrush)
263  hBrush = hSolidBrush = CreateSolidBrush(comctl32_color.clrWindow);
264  }
265 
266  GetClientRect (infoPtr->hwndSelf, &rc);
267 
268  FillRect (hdc, &rc, hBrush);
269 
270  if (hSolidBrush)
271  DeleteObject(hSolidBrush);
272 
273  return -1;
274 }
275 
276 
277 static inline LRESULT
278 HOTKEY_GetFont (const HOTKEY_INFO *infoPtr)
279 {
280  return (LRESULT)infoPtr->hFont;
281 }
282 
283 static LRESULT
285 {
286  WORD wOldHotKey;
287  BYTE bOldMod;
288 
289  if (GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED)
290  return 0;
291 
292  TRACE("() Key: %d\n", key);
293 
294  wOldHotKey = infoPtr->HotKey;
295  bOldMod = infoPtr->CurrMod;
296 
297  /* If any key is Pressed, we have to reset the hotkey in the control */
298  infoPtr->HotKey = 0;
299 
300  switch (key)
301  {
302  case VK_RETURN:
303  case VK_TAB:
304  case VK_SPACE:
305  case VK_DELETE:
306  case VK_ESCAPE:
307  case VK_BACK:
308  InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
309  return DefWindowProcW (infoPtr->hwndSelf, WM_KEYDOWN, key, flags);
310 
311  case VK_SHIFT:
312  infoPtr->CurrMod |= HOTKEYF_SHIFT;
313  break;
314  case VK_CONTROL:
315  infoPtr->CurrMod |= HOTKEYF_CONTROL;
316  break;
317  case VK_MENU:
318  infoPtr->CurrMod |= HOTKEYF_ALT;
319  break;
320 
321  default:
322  if(HOTKEY_IsCombInv(infoPtr))
323  infoPtr->HotKey = MAKEWORD(key, infoPtr->InvMod);
324  else
325  infoPtr->HotKey = MAKEWORD(key, infoPtr->CurrMod);
326  infoPtr->ScanCode = flags;
327  break;
328  }
329 
330  if ((wOldHotKey != infoPtr->HotKey) || (bOldMod != infoPtr->CurrMod))
331  {
332  InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
333 
334  /* send EN_CHANGE notification */
337  (LPARAM)infoPtr->hwndSelf);
338  }
339 
340  return 0;
341 }
342 
343 
344 static LRESULT
346 {
347  BYTE bOldMod;
348 
349  if (GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED)
350  return 0;
351 
352  TRACE("() Key: %d\n", key);
353 
354  bOldMod = infoPtr->CurrMod;
355 
356  switch (key)
357  {
358  case VK_SHIFT:
359  infoPtr->CurrMod &= ~HOTKEYF_SHIFT;
360  break;
361  case VK_CONTROL:
362  infoPtr->CurrMod &= ~HOTKEYF_CONTROL;
363  break;
364  case VK_MENU:
365  infoPtr->CurrMod &= ~HOTKEYF_ALT;
366  break;
367  default:
368  return 1;
369  }
370 
371  if (bOldMod != infoPtr->CurrMod)
372  {
373  InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
374 
375  /* send EN_CHANGE notification */
378  (LPARAM)infoPtr->hwndSelf);
379  }
380 
381  return 0;
382 }
383 
384 
385 static LRESULT
387 {
388  infoPtr->bFocus = FALSE;
389  DestroyCaret ();
390 
391  return 0;
392 }
393 
394 
395 static LRESULT
397 {
398  if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED))
399  SetFocus (infoPtr->hwndSelf);
400 
401  return 0;
402 }
403 
404 
405 static inline LRESULT
407 {
408  HOTKEY_INFO *infoPtr;
409  DWORD dwExStyle = GetWindowLongW (hwnd, GWL_EXSTYLE);
411  dwExStyle | WS_EX_CLIENTEDGE);
412 
413  /* allocate memory for info structure */
414  infoPtr = heap_alloc_zero (sizeof(*infoPtr));
415  SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
416 
417  /* initialize info structure */
418  infoPtr->HotKey = infoPtr->InvComb = infoPtr->InvMod = infoPtr->CurrMod = 0;
419  infoPtr->CaretPos = GetSystemMetrics(SM_CXBORDER);
420  infoPtr->hwndSelf = hwnd;
421  LoadStringW(COMCTL32_hModule, HKY_NONE, infoPtr->strNone, 15);
422 
423  return DefWindowProcW (infoPtr->hwndSelf, WM_NCCREATE, 0, (LPARAM)lpcs);
424 }
425 
426 static LRESULT
428 {
429  infoPtr->bFocus = TRUE;
430 
431  CreateCaret (infoPtr->hwndSelf, NULL, 1, infoPtr->nHeight);
433  ShowCaret (infoPtr->hwndSelf);
434 
435  return 0;
436 }
437 
438 
439 static LRESULT
441 {
442  TEXTMETRICW tm;
443  HDC hdc;
444  HFONT hOldFont = 0;
445 
446  infoPtr->hFont = hFont;
447 
448  hdc = GetDC (infoPtr->hwndSelf);
449  if (infoPtr->hFont)
450  hOldFont = SelectObject (hdc, infoPtr->hFont);
451 
452  GetTextMetricsW (hdc, &tm);
453  infoPtr->nHeight = tm.tmHeight;
454 
455  if (infoPtr->hFont)
456  SelectObject (hdc, hOldFont);
457  ReleaseDC (infoPtr->hwndSelf, hdc);
458 
459  if (redraw)
460  InvalidateRect (infoPtr->hwndSelf, NULL, TRUE);
461 
462  return 0;
463 }
464 
465 static LRESULT WINAPI
467 {
468  HOTKEY_INFO *infoPtr = (HOTKEY_INFO *)GetWindowLongPtrW (hwnd, 0);
469  TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx\n", hwnd, uMsg, wParam, lParam);
470  if (!infoPtr && (uMsg != WM_NCCREATE))
471  return DefWindowProcW (hwnd, uMsg, wParam, lParam);
472  switch (uMsg)
473  {
474  case HKM_GETHOTKEY:
475  return HOTKEY_GetHotKey (infoPtr);
476  case HKM_SETHOTKEY:
477  HOTKEY_SetHotKey (infoPtr, (WORD)wParam);
478  break;
479  case HKM_SETRULES:
480  HOTKEY_SetRules (infoPtr, (WORD)wParam, (WORD)lParam);
481  break;
482 
483  case WM_CHAR:
484  case WM_SYSCHAR:
485  return HOTKEY_KeyDown (infoPtr, MapVirtualKeyW(LOBYTE(HIWORD(lParam)), 1), lParam);
486 
487  case WM_CREATE:
488  return HOTKEY_Create (infoPtr, (LPCREATESTRUCTW)lParam);
489 
490  case WM_DESTROY:
491  return HOTKEY_Destroy (infoPtr);
492 
493  case WM_ERASEBKGND:
494  return HOTKEY_EraseBackground (infoPtr, (HDC)wParam);
495 
496  case WM_GETDLGCODE:
498 
499  case WM_GETFONT:
500  return HOTKEY_GetFont (infoPtr);
501 
502  case WM_KEYDOWN:
503  case WM_SYSKEYDOWN:
504  return HOTKEY_KeyDown (infoPtr, wParam, lParam);
505 
506  case WM_KEYUP:
507  case WM_SYSKEYUP:
508  return HOTKEY_KeyUp (infoPtr, wParam);
509 
510  case WM_KILLFOCUS:
511  return HOTKEY_KillFocus (infoPtr);
512 
513  case WM_LBUTTONDOWN:
514  return HOTKEY_LButtonDown (infoPtr);
515 
516  case WM_NCCREATE:
518 
519  case WM_PRINTCLIENT:
520  case WM_PAINT:
521  HOTKEY_Paint(infoPtr, (HDC)wParam);
522  return 0;
523 
524  case WM_SETFOCUS:
525  return HOTKEY_SetFocus (infoPtr);
526 
527  case WM_SETFONT:
528  return HOTKEY_SetFont (infoPtr, (HFONT)wParam, LOWORD(lParam));
529 
530  default:
531  if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))
532  ERR("unknown msg %04x wp=%08lx lp=%08lx\n",
533  uMsg, wParam, lParam);
534  return DefWindowProcW (hwnd, uMsg, wParam, lParam);
535  }
536  return 0;
537 }
538 
539 
540 void
542 {
543  WNDCLASSW wndClass;
544 
545  ZeroMemory (&wndClass, sizeof(WNDCLASSW));
546  wndClass.style = CS_GLOBALCLASS;
547  wndClass.lpfnWndProc = HOTKEY_WindowProc;
548  wndClass.cbClsExtra = 0;
549  wndClass.cbWndExtra = sizeof(HOTKEY_INFO *);
550  wndClass.hCursor = 0;
551  wndClass.hbrBackground = 0;
552  wndClass.lpszClassName = HOTKEY_CLASSW;
553 
554  RegisterClassW (&wndClass);
555 }
556 
557 
558 void
560 {
562 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
void HOTKEY_Unregister(void)
Definition: hotkey.c:559
#define WS_DISABLED
Definition: pedump.c:621
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
#define HKCOMB_SC
Definition: commctrl.h:2222
#define HKY_NONE
Definition: comctl32.h:96
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND hwndNotify
Definition: hotkey.c:48
static LRESULT WINAPI HOTKEY_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hotkey.c:466
#define TRUE
Definition: types.h:120
#define MAKEWPARAM(l, h)
Definition: winuser.h:3948
#define DLGC_WANTCHARS
Definition: winuser.h:2593
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
UINT style
Definition: winuser.h:3150
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_CHAR
Definition: winuser.h:1699
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LOBYTE(W)
Definition: jmemdos.c:487
HDC WINAPI GetDC(_In_opt_ HWND)
#define MAKEWORD(a, b)
Definition: typedefs.h:247
WINE_DEFAULT_DEBUG_CHANNEL(hotkey)
DWORD ScanCode
Definition: hotkey.c:57
static void HOTKEY_Paint(HOTKEY_INFO *infoPtr, HDC hdc)
Definition: hotkey.c:188
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
static HDC
Definition: imagelist.c:92
#define HIBYTE(W)
Definition: jmemdos.c:486
#define HOTKEYF_SHIFT
Definition: commctrl.h:2214
static LRESULT HOTKEY_Create(HOTKEY_INFO *infoPtr, const CREATESTRUCTW *lpcs)
Definition: hotkey.c:230
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
#define ZeroMemory
Definition: winbase.h:1642
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
#define GWL_EXSTYLE
Definition: winuser.h:845
int cbClsExtra
Definition: winuser.h:3152
static void HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod)
Definition: hotkey.c:220
HWND WINAPI SetFocus(_In_opt_ HWND)
UINT_PTR WPARAM
Definition: windef.h:207
#define VK_TAB
Definition: winuser.h:2174
#define VK_MENU
Definition: winuser.h:2179
#define GetWindowLongPtrW
Definition: winuser.h:4730
static LRESULT HOTKEY_SetFocus(HOTKEY_INFO *infoPtr)
Definition: hotkey.c:427
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define VK_ESCAPE
Definition: winuser.h:2189
static BOOL HOTKEY_IsCombInv(const HOTKEY_INFO *infoPtr)
Definition: hotkey.c:67
#define lstrlenW
Definition: compat.h:415
#define WM_NCCREATE
Definition: winuser.h:1665
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int32_t INT
Definition: typedefs.h:56
#define VK_RETURN
Definition: winuser.h:2176
WPARAM wParam
Definition: combotst.c:138
#define HKCOMB_CA
Definition: commctrl.h:2224
HFONT hFont
Definition: main.c:53
#define WM_PRINTCLIENT
Definition: richedit.h:70
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:975
static LRESULT HOTKEY_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
Definition: hotkey.c:406
COLORREF clrWindowText
Definition: comctl32.h:170
int WINAPI GetDlgCtrlID(_In_ HWND)
static LRESULT HOTKEY_KillFocus(HOTKEY_INFO *infoPtr)
Definition: hotkey.c:386
#define HKCOMB_SCA
Definition: commctrl.h:2225
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
WORD HotKey
Definition: hotkey.c:52
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI CreateCaret(_In_ HWND, _In_opt_ HBITMAP, _In_ int, _In_ int)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
static LRESULT HOTKEY_KeyUp(HOTKEY_INFO *infoPtr, DWORD key)
Definition: hotkey.c:345
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
WNDPROC lpfnWndProc
Definition: winuser.h:3151
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_SYSCHAR
Definition: winuser.h:1703
static LRESULT HOTKEY_SetFont(HOTKEY_INFO *infoPtr, HFONT hFont, BOOL redraw)
Definition: hotkey.c:440
static LRESULT HOTKEY_KeyDown(HOTKEY_INFO *infoPtr, DWORD key, DWORD flags)
Definition: hotkey.c:284
#define HKM_GETHOTKEY
Definition: commctrl.h:2228
#define VK_SHIFT
Definition: winuser.h:2177
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
BOOL bFocus
Definition: hotkey.c:50
static LRESULT HOTKEY_Destroy(HOTKEY_INFO *infoPtr)
Definition: hotkey.c:241
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
#define SYSTEM_FONT
Definition: wingdi.h:910
LONG cx
Definition: windef.h:319
#define WM_KEYDOWN
Definition: winuser.h:1697
LPCWSTR lpszClassName
Definition: winuser.h:3159
LONG_PTR LPARAM
Definition: windef.h:208
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
static void HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc)
Definition: hotkey.c:135
#define VK_DELETE
Definition: winuser.h:2208
#define WM_DESTROY
Definition: winuser.h:1591
void HOTKEY_Register(void)
Definition: hotkey.c:541
struct tagHOTKEY_INFO HOTKEY_INFO
#define TRACE(s)
Definition: solgame.cpp:4
#define WM_KILLFOCUS
Definition: winuser.h:1596
int cbWndExtra
Definition: winuser.h:3153
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD COLORREF
Definition: windef.h:285
WORD InvComb
Definition: hotkey.c:53
#define CS_GLOBALCLASS
Definition: winuser.h:647
#define WINAPI
Definition: msvc.h:8
#define WM_KEYUP
Definition: winuser.h:1698
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define HOTKEYF_CONTROL
Definition: commctrl.h:2215
unsigned short WORD
Definition: ntddk_ex.h:93
int WINAPI GetSystemMetrics(_In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
static void HOTKEY_SetHotKey(HOTKEY_INFO *infoPtr, WORD hotKey)
Definition: hotkey.c:209
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
GLbitfield flags
Definition: glext.h:7161
#define WM_PAINT
Definition: winuser.h:1602
WORD InvMod
Definition: hotkey.c:54
#define SM_CYBORDER
Definition: winuser.h:955
#define IsOnlySet(flags)
Definition: hotkey.c:64
HDC hdc
Definition: main.c:9
#define HKM_SETHOTKEY
Definition: commctrl.h:2227
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define SM_CXBORDER
Definition: winuser.h:954
BYTE CurrMod
Definition: hotkey.c:55
unsigned char BYTE
Definition: mem.h:68
#define WM_APP
Definition: eventvwr.h:70
Definition: time.h:76
#define WM_COMMAND
Definition: winuser.h:1722
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define VK_BACK
Definition: winuser.h:2173
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
#define WM_USER
Definition: winuser.h:1877
int WINAPI GetKeyNameTextW(_In_ LONG lParam, _Out_writes_(cchSize) LPWSTR lpString, _In_ int cchSize)
HCURSOR hCursor
Definition: winuser.h:3156
#define ERR(fmt,...)
Definition: debug.h:109
#define GWL_STYLE
Definition: winuser.h:846
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
static LRESULT HOTKEY_GetHotKey(const HOTKEY_INFO *infoPtr)
Definition: hotkey.c:201
COLORREF clrGrayText
Definition: comctl32.h:171
COLORREF clrBtnFace
Definition: comctl32.h:161
INT CaretPos
Definition: hotkey.c:56
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
HMODULE COMCTL32_hModule
Definition: commctrl.c:79
INT nHeight
Definition: hotkey.c:51
BOOL WINAPI DestroyCaret(void)
Definition: caret.c:35
#define WM_SYSKEYUP
Definition: winuser.h:1702
#define WM_CTLCOLOREDIT
Definition: winuser.h:1749
HBRUSH hbrBackground
Definition: winuser.h:3157
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static void HOTKEY_DrawHotKey(HOTKEY_INFO *infoPtr, HDC hdc, LPCWSTR KeyName, WORD NameLen)
Definition: hotkey.c:96
unsigned int UINT
Definition: ndis.h:50
#define VK_SPACE
Definition: winuser.h:2194
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
static LRESULT HOTKEY_EraseBackground(const HOTKEY_INFO *infoPtr, HDC hdc)
Definition: hotkey.c:251
#define WM_SETFONT
Definition: winuser.h:1632
#define VK_CONTROL
Definition: winuser.h:2178
HWND hwndSelf
Definition: hotkey.c:47
#define HKM_SETRULES
Definition: commctrl.h:2229
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define HKCOMB_S
Definition: commctrl.h:2219
#define WM_CREATE
Definition: winuser.h:1590
#define HKCOMB_SA
Definition: commctrl.h:2223
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
#define HIWORD(l)
Definition: typedefs.h:246
#define HKCOMB_A
Definition: commctrl.h:2221
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1748
WCHAR strNone[15]
Definition: hotkey.c:58
#define HKCOMB_C
Definition: commctrl.h:2220
BOOL WINAPI ShowCaret(_In_opt_ HWND)
#define SetWindowLongPtrW
Definition: winuser.h:5247
static LRESULT HOTKEY_LButtonDown(const HOTKEY_INFO *infoPtr)
Definition: hotkey.c:396
static const WCHAR HOTKEY_plussep[]
Definition: hotkey.c:61
#define WM_ERASEBKGND
Definition: winuser.h:1607
#define WM_SETFOCUS
Definition: winuser.h:1595
LONG_PTR LRESULT
Definition: windef.h:209
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define HOTKEY_CLASSW
Definition: commctrl.h:2232
COLORREF clrWindow
Definition: comctl32.h:169
#define HKCOMB_NONE
Definition: commctrl.h:2218
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
BOOL WINAPI SetCaretPos(_In_ int, _In_ int)
#define DLGC_WANTARROWS
Definition: winuser.h:2585
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
#define HOTKEYF_ALT
Definition: commctrl.h:2216
Definition: path.c:42
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
static LRESULT HOTKEY_GetFont(const HOTKEY_INFO *infoPtr)
Definition: hotkey.c:278
HFONT hFont
Definition: hotkey.c:49
#define EN_CHANGE
Definition: winuser.h:2004