ReactOS 0.4.16-dev-91-g764881a
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
45typedef struct tagHOTKEY_INFO
46{
58 WCHAR strNone[15]; /* hope it's long enough ... */
60
61static const WCHAR HOTKEY_plussep[] = { ' ', '+', ' ' };
63
64#define IsOnlySet(flags) (infoPtr->CurrMod == (flags))
65
66static 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;
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
95static 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);
109 {
112 }
113 else
114 {
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 */
134static 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
187static 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
200static 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
208static 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
219static void
220HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod)
221{
222 infoPtr->InvComb = invComb;
223 infoPtr->InvMod = invMod;
224 TRACE("(infoPtr=%p) Invalid Modifiers: 0x%x, If Invalid: 0x%x\n", infoPtr,
225 infoPtr->InvComb, infoPtr->InvMod);
226}
227
228
229static LRESULT
231{
232 infoPtr->hwndNotify = lpcs->hwndParent;
233
235
236 return 0;
237}
238
239
240static LRESULT
242{
243 /* free hotkey info data */
244 SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
245 heap_free (infoPtr);
246 return 0;
247}
248
249
250static LRESULT
252{
253 HBRUSH hBrush, hSolidBrush = NULL;
254 RECT rc;
255
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
277static inline LRESULT
279{
280 return (LRESULT)infoPtr->hFont;
281}
282
283static LRESULT
285{
286 WORD wOldHotKey;
287 BYTE bOldMod;
288
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
344static LRESULT
346{
347 BYTE bOldMod;
348
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
385static LRESULT
387{
388 infoPtr->bFocus = FALSE;
389 DestroyCaret ();
390
391 return 0;
392}
393
394
395static LRESULT
397{
398 if (!(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & WS_DISABLED))
399 SetFocus (infoPtr->hwndSelf);
400
401 return 0;
402}
403
404
405static 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;
420 infoPtr->hwndSelf = hwnd;
422
423 return DefWindowProcW (infoPtr->hwndSelf, WM_NCCREATE, 0, (LPARAM)lpcs);
424}
425
426static 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
439static LRESULT
441{
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
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
465static LRESULT WINAPI
467{
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
540void
542{
543 WNDCLASSW wndClass;
544
545 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
546 wndClass.style = CS_GLOBALCLASS;
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
558void
560{
562}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
HFONT hFont
Definition: main.c:53
#define ERR(fmt,...)
Definition: precomp.h:57
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
Definition: commctrl.c:1755
#define HKY_NONE
Definition: comctl32.h:106
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
HMODULE COMCTL32_hModule
Definition: commctrl.c:79
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static LRESULT HOTKEY_SetFont(HOTKEY_INFO *infoPtr, HFONT hFont, BOOL redraw)
Definition: hotkey.c:440
static void HOTKEY_Paint(HOTKEY_INFO *infoPtr, HDC hdc)
Definition: hotkey.c:188
static LRESULT HOTKEY_GetFont(const HOTKEY_INFO *infoPtr)
Definition: hotkey.c:278
static LRESULT HOTKEY_GetHotKey(const HOTKEY_INFO *infoPtr)
Definition: hotkey.c:201
static LRESULT HOTKEY_KeyDown(HOTKEY_INFO *infoPtr, DWORD key, DWORD flags)
Definition: hotkey.c:284
static void HOTKEY_DrawHotKey(HOTKEY_INFO *infoPtr, HDC hdc, LPCWSTR KeyName, WORD NameLen)
Definition: hotkey.c:96
static LRESULT HOTKEY_LButtonDown(const HOTKEY_INFO *infoPtr)
Definition: hotkey.c:396
static LRESULT HOTKEY_KeyUp(HOTKEY_INFO *infoPtr, DWORD key)
Definition: hotkey.c:345
void HOTKEY_Register(void)
Definition: hotkey.c:541
static LRESULT HOTKEY_EraseBackground(const HOTKEY_INFO *infoPtr, HDC hdc)
Definition: hotkey.c:251
static const WCHAR HOTKEY_plussep[]
Definition: hotkey.c:61
struct tagHOTKEY_INFO HOTKEY_INFO
static void HOTKEY_SetHotKey(HOTKEY_INFO *infoPtr, WORD hotKey)
Definition: hotkey.c:209
static LRESULT HOTKEY_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
Definition: hotkey.c:406
static BOOL HOTKEY_IsCombInv(const HOTKEY_INFO *infoPtr)
Definition: hotkey.c:67
static void HOTKEY_Refresh(HOTKEY_INFO *infoPtr, HDC hdc)
Definition: hotkey.c:135
static LRESULT HOTKEY_Destroy(HOTKEY_INFO *infoPtr)
Definition: hotkey.c:241
static LRESULT HOTKEY_Create(HOTKEY_INFO *infoPtr, const CREATESTRUCTW *lpcs)
Definition: hotkey.c:230
#define IsOnlySet(flags)
Definition: hotkey.c:64
static LRESULT WINAPI HOTKEY_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: hotkey.c:466
void HOTKEY_Unregister(void)
Definition: hotkey.c:559
static LRESULT HOTKEY_KillFocus(HOTKEY_INFO *infoPtr)
Definition: hotkey.c:386
static void HOTKEY_SetRules(HOTKEY_INFO *infoPtr, WORD invComb, WORD invMod)
Definition: hotkey.c:220
static LRESULT HOTKEY_SetFocus(HOTKEY_INFO *infoPtr)
Definition: hotkey.c:427
#define lstrlenW
Definition: compat.h:750
#define WM_APP
Definition: eventvwr.h:73
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
pKey DeleteObject()
GLbitfield flags
Definition: glext.h:7161
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
unsigned int UINT
Definition: ndis.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_DISABLED
Definition: pedump.c:621
#define HKCOMB_SCA
Definition: commctrl.h:2234
#define HOTKEY_CLASSW
Definition: commctrl.h:2241
#define HKCOMB_S
Definition: commctrl.h:2228
#define HKCOMB_A
Definition: commctrl.h:2230
#define HKCOMB_SA
Definition: commctrl.h:2232
#define HOTKEYF_SHIFT
Definition: commctrl.h:2223
#define HKCOMB_CA
Definition: commctrl.h:2233
#define HKCOMB_C
Definition: commctrl.h:2229
#define HOTKEYF_CONTROL
Definition: commctrl.h:2224
#define HKM_SETHOTKEY
Definition: commctrl.h:2236
#define HKM_SETRULES
Definition: commctrl.h:2238
#define HKCOMB_SC
Definition: commctrl.h:2231
#define HKCOMB_NONE
Definition: commctrl.h:2227
#define HKM_GETHOTKEY
Definition: commctrl.h:2237
#define HOTKEYF_ALT
Definition: commctrl.h:2225
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define TRACE(s)
Definition: solgame.cpp:4
COLORREF clrBtnFace
Definition: comctl32.h:174
COLORREF clrWindow
Definition: comctl32.h:182
COLORREF clrGrayText
Definition: comctl32.h:184
COLORREF clrWindowText
Definition: comctl32.h:183
LONG cx
Definition: kdterminal.h:27
LPCWSTR lpszClassName
Definition: winuser.h:3188
HBRUSH hbrBackground
Definition: winuser.h:3186
int cbClsExtra
Definition: winuser.h:3181
UINT style
Definition: winuser.h:3179
WNDPROC lpfnWndProc
Definition: winuser.h:3180
int cbWndExtra
Definition: winuser.h:3182
HCURSOR hCursor
Definition: winuser.h:3185
Definition: copy.c:22
WORD InvMod
Definition: hotkey.c:54
WORD HotKey
Definition: hotkey.c:52
INT nHeight
Definition: hotkey.c:51
BYTE CurrMod
Definition: hotkey.c:55
HFONT hFont
Definition: hotkey.c:49
INT CaretPos
Definition: hotkey.c:56
WCHAR strNone[15]
Definition: hotkey.c:58
DWORD ScanCode
Definition: hotkey.c:57
HWND hwndNotify
Definition: hotkey.c:48
HWND hwndSelf
Definition: hotkey.c:47
WORD InvComb
Definition: hotkey.c:53
BOOL bFocus
Definition: hotkey.c:50
Definition: time.h:68
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define MAKEWORD(a, b)
Definition: typedefs.h:248
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
#define ZeroMemory
Definition: winbase.h:1712
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
BOOL WINAPI GetTextMetricsW(_In_ HDC, _Out_ LPTEXTMETRICW)
Definition: text.c:221
HGDIOBJ WINAPI GetStockObject(_In_ int)
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define SYSTEM_FONT
Definition: wingdi.h:911
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI GetTextExtentPoint32W(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpString, _In_ int c, _Out_ LPSIZE psizl)
#define WM_PAINT
Definition: winuser.h:1623
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_ERASEBKGND
Definition: winuser.h:1628
#define MAKEWPARAM(l, h)
Definition: winuser.h:4012
#define GetWindowLongPtrW
Definition: winuser.h:4832
BOOL WINAPI ShowCaret(_In_opt_ HWND)
#define VK_TAB
Definition: winuser.h:2202
#define MAKELPARAM(l, h)
Definition: winuser.h:4011
#define WM_KEYUP
Definition: winuser.h:1719
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1611
#define DLGC_WANTCHARS
Definition: winuser.h:2621
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define VK_SPACE
Definition: winuser.h:2222
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1743
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define VK_CONTROL
Definition: winuser.h:2206
#define WM_SETFOCUS
Definition: winuser.h:1616
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_GETFONT
Definition: winuser.h:1654
#define WM_NCCREATE
Definition: winuser.h:1686
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
#define SM_CYBORDER
Definition: winuser.h:968
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_SYSCHAR
Definition: winuser.h:1724
#define VK_RETURN
Definition: winuser.h:2204
HWND WINAPI SetFocus(_In_opt_ HWND)
int WINAPI GetKeyNameTextW(_In_ LONG lParam, _Out_writes_(cchSize) LPWSTR lpString, _In_ int cchSize)
#define WM_SETFONT
Definition: winuser.h:1653
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define SM_CXBORDER
Definition: winuser.h:967
#define DLGC_WANTARROWS
Definition: winuser.h:2613
#define WM_SYSKEYUP
Definition: winuser.h:1723
#define VK_BACK
Definition: winuser.h:2201
HDC WINAPI GetDC(_In_opt_ HWND)
#define WM_CHAR
Definition: winuser.h:1720
#define CS_GLOBALCLASS
Definition: winuser.h:652
#define WM_USER
Definition: winuser.h:1898
int WINAPI GetDlgCtrlID(_In_ HWND)
#define VK_SHIFT
Definition: winuser.h:2205
#define VK_DELETE
Definition: winuser.h:2236
#define WM_DESTROY
Definition: winuser.h:1612
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
#define WM_KEYDOWN
Definition: winuser.h:1718
BOOL WINAPI SetCaretPos(_In_ int, _In_ int)
BOOL WINAPI CreateCaret(_In_ HWND, _In_opt_ HBITMAP, _In_ int, _In_ int)
BOOL WINAPI DestroyCaret(void)
Definition: caret.c:35
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5358
#define GWL_STYLE
Definition: winuser.h:855
#define WM_CTLCOLOREDIT
Definition: winuser.h:1770
#define VK_ESCAPE
Definition: winuser.h:2217
#define WM_KILLFOCUS
Definition: winuser.h:1617
int WINAPI GetSystemMetrics(_In_ int)
#define WM_SYSKEYDOWN
Definition: winuser.h:1722
#define WM_GETDLGCODE
Definition: winuser.h:1692
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_MENU
Definition: winuser.h:2207
#define GWL_EXSTYLE
Definition: winuser.h:854
#define EN_CHANGE
Definition: winuser.h:2025
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193