ReactOS 0.4.16-dev-1278-gd809cd0
appswitch.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS user32.dll
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: App switching functionality
5 * COPYRIGHT: Copyright Johannes Anderwald (johannes.anderwald@reactos.org)
6 * Copyright David Quintana (gigaherz@gmail.com)
7 * Copyright Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
8 */
9
10//
11// TODO:
12// Move to Win32k.
13// Add registry support.
14//
15//
16
17#include <user32.h>
18
20
21#define DIALOG_MARGIN 8 // margin of dialog contents
22
23#define CX_ICON 32 // width of icon
24#define CY_ICON 32 // height of icon
25#define ICON_MARGIN 4 // margin width around an icon
26
27#define CX_ITEM (CX_ICON + 2 * ICON_MARGIN)
28#define CY_ITEM (CY_ICON + 2 * ICON_MARGIN)
29#define ITEM_MARGIN 4 // margin width around an item
30
31#define CX_ITEM_SPACE (CX_ITEM + 2 * ITEM_MARGIN)
32#define CY_ITEM_SPACE (CY_ITEM + 2 * ITEM_MARGIN)
33
34#define CY_TEXT_MARGIN 4 // margin height around text
35
36// limit the number of windows shown in the alt-tab window
37// 120 windows results in (12*40) by (10*40) pixels worth of icons.
38#define MAX_WINDOWS 120
39
40// Global variables
45
47
49
53
60
61int nShift = 0;
62
64
70
71// window style
74
75static int GetRegInt(HKEY hKey, PCWSTR Name, int DefVal)
76{
77 WCHAR buf[sizeof("-2147483648")];
78 DWORD cb = sizeof(buf), type;
80 if (err == ERROR_SUCCESS && cb <= sizeof(buf) - sizeof(*buf))
81 {
82 buf[cb / sizeof(*buf)] = UNICODE_NULL;
83 if (type == REG_SZ || type == REG_EXPAND_SZ)
84 {
85 WCHAR *pszEnd;
86 long Value = wcstol(buf, &pszEnd, 10);
87 return pszEnd > buf ? Value : DefVal;
88 }
89 if ((type == REG_DWORD || type == REG_BINARY) && cb == sizeof(DWORD))
90 {
91 return *(DWORD*)buf;
92 }
93 }
94 return DefVal;
95}
96
97static void LoadCoolSwitchSettings(void)
98{
99 HKEY hKey;
100
102#if DBG
103 && !(GetKeyState(VK_SCROLL) & 1) // If Scroll-Lock is on, always read the settings
104#endif
105 )
106 {
107 return;
108 }
109
111 // TODO: Should read from win.ini instead when IniFileMapping is implemented
112 if (!RegOpenKeyExW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", 0, KEY_READ, &hKey))
113 {
114 CoolSwitch = GetRegInt(hKey, L"CoolSwitch", TRUE);
115 CoolSwitchRows = GetRegInt(hKey, L"CoolSwitchRows", DefSwitchRows);
116 CoolSwitchColumns = GetRegInt(hKey, L"CoolSwitchColumns", DefSwitchColumns);
118 }
119
121 {
124 }
125
126 TRACE("CoolSwitch: %d\n", CoolSwitch);
127 TRACE("CoolSwitchRows: %d\n", CoolSwitchRows);
128 TRACE("CoolSwitchColumns: %d\n", CoolSwitchColumns);
129}
130
132{
133 int x, y;
134 RECT Rect;
135
136 int screenwidth = GetSystemMetrics(SM_CXSCREEN);
137 int screenheight = GetSystemMetrics(SM_CYSCREEN);
138
139 x = (screenwidth - width) / 2;
140 y = (screenheight - height) / 2;
141
142 SetRect(&Rect, x, y, x + width, y + height);
144
145 x = Rect.left;
146 y = Rect.top;
147 width = Rect.right - Rect.left;
148 height = Rect.bottom - Rect.top;
150
151 ptStart.x = x;
152 ptStart.y = y;
153}
154
155void CompleteSwitch(BOOL doSwitch)
156{
157 if (!isOpen)
158 return;
159
160 isOpen = FALSE;
161
162 TRACE("[ATbot] CompleteSwitch Hiding Window.\n");
164
165 if(doSwitch)
166 {
168 return;
169
170 // FIXME: workaround because reactos fails to activate the previous window correctly.
171 //if(selectedWindow != 0)
172 {
174
176
177 TRACE("[ATbot] CompleteSwitch Switching to 0x%08x (%ls)\n", hwnd, windowText);
178
180 }
181 }
182
183 windowCount = 0;
184}
185
187{
188 HICON hIcon = NULL;
189 LRESULT bAlive;
190
192
193 // First try to get the big icon assigned to the window
194#define ICON_TIMEOUT 100 // in milliseconds
197 if (!hIcon)
198 {
199 // If no icon is assigned, try to get the icon assigned to the windows' class
201 if (!hIcon)
202 {
203 // If we still don't have an icon, see if we can do with the small icon,
204 // or a default application icon
205 if (bAlive)
206 {
207 SendMessageTimeoutW(window, WM_GETICON, ICON_SMALL2, 0,
209 (PDWORD_PTR)&hIcon);
210 }
211#undef ICON_TIMEOUT
212 if (!hIcon)
213 {
214 // using windows logo icon as default
215 hIcon = gpsi->hIconWindows;
216 if (!hIcon)
217 {
218 //if all attempts to get icon fails go to the next window
219 return TRUE;
220 }
221 }
222 }
223 }
224
227 windowCount++;
228
229 // If we got to the max number of windows, we won't be able to add any more
230 return (windowCount < MAX_WINDOWS);
231}
232
234{
235 HWND hwndOwner;
236 DWORD ExStyle, OwnerExStyle;
237
238 for (;;)
239 {
240 // A window with WS_EX_APPWINDOW is treated as if it has no owner
243 break;
244
245 // Is the owner visible?
246 // An window with WS_EX_TOOLWINDOW is treated as if it weren't visible
247 hwndOwner = GetWindow(hwnd, GW_OWNER);
248 OwnerExStyle = GetWindowLong(hwndOwner, GWL_EXSTYLE);
249 if (!IsWindowVisible(hwndOwner) || (OwnerExStyle & WS_EX_TOOLWINDOW))
250 break;
251
252 hwnd = hwndOwner;
253 }
254
255 return hwnd;
256}
257
258// c.f. https://devblogs.microsoft.com/oldnewthing/20071008-00/?p=24863
260{
261 LONG_PTR ExStyle, ClassStyle;
262 RECT rc;
263 HWND hwndTry, hwndWalk;
264 WCHAR szClass[64];
265
266 // must be visible
267 if (!IsWindowVisible(hwnd))
268 return FALSE;
269
270 // must not be WS_EX_TOOLWINDOW nor WS_EX_NOACTIVATE
273 return FALSE;
274
275 // must be not empty rect
276 GetWindowRect(hwnd, &rc);
277 if (IsRectEmpty(&rc))
278 return FALSE;
279
280 // check special windows
281 if (!GetClassNameW(hwnd, szClass, _countof(szClass)) ||
282 wcscmp(szClass, L"Shell_TrayWnd") == 0 ||
283 wcscmp(szClass, L"Progman") == 0)
284 {
285 return TRUE;
286 }
287
288 // must not be an IME-related window
289 ClassStyle = GetClassLongPtrW(hwnd, GCL_STYLE);
290 if (ClassStyle & CS_IME)
291 return FALSE;
292
293 // get 'nice' root owner
294 hwndWalk = GetNiceRootOwner(hwnd);
295
296 // walk back from hwndWalk toward hwnd
297 for (;;)
298 {
299 hwndTry = GetLastActivePopup(hwndWalk);
300 if (hwndTry == hwndWalk)
301 break;
302
304 if (IsWindowVisible(hwndTry) && !(ExStyle & WS_EX_TOOLWINDOW))
305 break;
306
307 hwndWalk = hwndTry;
308 }
309
310 return hwnd == hwndTry; // Reached?
311}
312
313static BOOL CALLBACK
315{
316 if (IsAltTabWindow(hwnd))
317 {
319 return FALSE;
320 }
321 return TRUE;
322}
323
325{
326 int xPos = LOWORD(lParam);
327 int yPos = HIWORD(lParam);
328
329 int xIndex = (xPos - DIALOG_MARGIN) / CX_ITEM_SPACE;
330 int yIndex = (yPos - DIALOG_MARGIN) / CY_ITEM_SPACE;
331
332 if (xIndex < 0 || nCols <= xIndex ||
333 yIndex < 0 || nRows <= yIndex)
334 {
335 return;
336 }
337
338 selectedWindow = (yIndex*nCols) + xIndex;
339 if (message == WM_MOUSEMOVE)
340 {
342 //RedrawWindow(switchdialog, NULL, NULL, 0);
343 }
344 else
345 {
346 selectedWindow = (yIndex*nCols) + xIndex;
348 }
349}
350
352{
353 HDC dialogDC;
354 PAINTSTRUCT paint;
355 RECT cRC, textRC;
356 int i, xPos, yPos, CharCount;
357 HFONT dcFont;
358 HICON hIcon;
359 HPEN hPen;
361
362 // check
363 if (nCols == 0 || nItems == 0)
364 return;
365
366 // begin painting
367 dialogDC = BeginPaint(hWnd, &paint);
368 if (dialogDC == NULL)
369 return;
370
371 // fill the client area
372 GetClientRect(hWnd, &cRC);
373 FillRect(dialogDC, &cRC, (HBRUSH)(COLOR_3DFACE + 1));
374
375 // if the selection index exceeded the display items, then
376 // do display item shifting
377 if (selectedWindow >= nItems)
379 else
380 nShift = 0;
381
382 for (i = 0; i < nItems; ++i)
383 {
384 // get the icon to display
385 hIcon = iconList[i + nShift];
386
387 // calculate the position where we start drawing
390
391 // centering
393 {
394 xPos += (itemsW - nItems * CX_ITEM_SPACE) / 2;
395 }
396
397 // if this position is selected,
398 if (selectedWindow == i + nShift)
399 {
400 // create a solid pen
402 hPen = CreatePen(PS_SOLID, 1, Color);
403
404 // draw a rectangle with using the pen
405 SelectObject(dialogDC, hPen);
407 Rectangle(dialogDC, xPos, yPos, xPos + CX_ITEM, yPos + CY_ITEM);
408 Rectangle(dialogDC, xPos + 1, yPos + 1,
409 xPos + CX_ITEM - 1, yPos + CY_ITEM - 1);
410
411 // delete the pen
412 DeleteObject(hPen);
413 }
414
415 // draw icon
416 DrawIconEx(dialogDC, xPos + ICON_MARGIN, yPos + ICON_MARGIN,
418 }
419
420 // set the text rectangle
423
424 // draw the sunken button around text
425 DrawFrameControl(dialogDC, &textRC, DFC_BUTTON,
427
428 // get text
431
432 // draw text
433 dcFont = SelectObject(dialogDC, dialogFont);
435 SetBkMode(dialogDC, TRANSPARENT);
436 DrawTextW(dialogDC, windowText, CharCount, &textRC,
438 SelectObject(dialogDC, dcFont);
439
440 // end painting
441 EndPaint(hWnd, &paint);
442}
443
445{
447 WC_SWITCH,
448 L"",
452 400, 150,
453 NULL, NULL,
454 hInstance, NULL);
455 if (!switchdialog)
456 {
457 TRACE("[ATbot] Task Switcher Window failed to create.\n");
458 return 0;
459 }
460
461 isOpen = FALSE;
462 return 1;
463}
464
466{
467 HDC tDC;
469
471
472 tDC = GetDC(0);
473 GetTextMetrics(tDC, &tm);
474 fontHeight = tm.tmHeight;
475 ReleaseDC(0, tDC);
476
477 return 1;
478}
479
481{
483
486 if (nRows > CoolSwitchRows)
487 {
489 nItems = nRows * nCols;
490 }
491
494
498
500}
501
503{
504 if (!isOpen)
505 {
506 windowCount = 0;
508
509 if (windowCount == 0)
510 return FALSE;
511
512 if (windowCount == 1)
513 {
515 return FALSE;
516 }
517
519 return FALSE;
520
521 selectedWindow = 1;
522
523 TRACE("[ATbot] HotKey Received. Opening window.\n");
526 isOpen = TRUE;
527 }
528 else
529 {
530 TRACE("[ATbot] HotKey Received Rotating.\n");
533 }
534 return TRUE;
535}
536
537void RotateTasks(BOOL bShift)
538{
539 HWND hwndFirst, hwndLast;
540 DWORD Size;
541
542 if (windowCount < 2 || !Esc)
543 return;
544
545 hwndFirst = windowList[0];
546 hwndLast = windowList[windowCount - 1];
547
548 if (bShift)
549 {
550 SetWindowPos(hwndLast, HWND_TOP, 0, 0, 0, 0,
553
554 SwitchToThisWindow(hwndLast, TRUE);
555
556 Size = (windowCount - 1) * sizeof(HWND);
558 windowList[0] = hwndLast;
559 }
560 else
561 {
562 SetWindowPos(hwndFirst, hwndLast, 0, 0, 0, 0,
565
567
568 Size = (windowCount - 1) * sizeof(HWND);
570 windowList[windowCount - 1] = hwndFirst;
571 }
572}
573
574static void MoveLeft(void)
575{
577 if (selectedWindow < 0)
580}
581
582static void MoveRight(void)
583{
586}
587
588static void MoveUp(void)
589{
590 INT iRow = selectedWindow / nCols;
591 INT iCol = selectedWindow % nCols;
592
593 --iRow;
594 if (iRow < 0)
595 iRow = nRows - 1;
596
597 selectedWindow = iRow * nCols + iCol;
601}
602
603static void MoveDown(void)
604{
605 INT iRow = selectedWindow / nCols;
606 INT iCol = selectedWindow % nCols;
607
608 ++iRow;
609 if (iRow >= nRows)
610 iRow = 0;
611
612 selectedWindow = iRow * nCols + iCol;
616}
617
618VOID
620{
621 // for every item of the icon list:
622 INT i;
623 for (i = 0; i < windowCount; ++i)
624 {
625 // destroy the icon
627 iconList[i] = NULL;
628 }
629}
630
632{
633 HWND hwndActive;
634 MSG msg;
635
636 // FIXME: Is loading timing OK?
638
639 if (!CoolSwitch)
640 return 0;
641
642 // Already in the loop.
643 if (switchdialog || Esc) return 0;
644
645 if (lParam == VK_ESCAPE)
646 {
647 Esc = TRUE;
648
649 windowCount = 0;
651
652 if (windowCount < 2)
653 return 0;
654
656
657 hwndActive = GetActiveWindow();
658
659 if (hwndActive == NULL)
660 {
661 Esc = FALSE;
662 return 0;
663 }
664 }
665
666 // Capture current active window.
667 hwndActive = GetActiveWindow();
668 if (hwndActive)
669 SetCapture(hwndActive);
670
671 switch (lParam)
672 {
673 case VK_TAB:
674 if (!GetDialogFont() || !ProcessHotKey())
675 goto Exit;
676 break;
677
678 case VK_ESCAPE:
679 break;
680
681 default:
682 goto Exit;
683 }
684
685 if (!hwndActive)
686 goto Exit;
687
688 // Main message loop:
689 while (1)
690 {
691 for (;;)
692 {
693 if (PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE ))
694 {
695 if (!CallMsgFilterW( &msg, MSGF_NEXTWINDOW )) break;
696 /* remove the message from the queue */
697 PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
698 }
699 else
700 WaitMessage();
701 }
702
703 switch (msg.message)
704 {
705 case WM_KEYUP:
706 {
707 PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
708 if (msg.wParam == VK_MENU)
709 {
711 }
712 else if (msg.wParam == VK_RETURN)
713 {
715 }
716 else if (msg.wParam == VK_ESCAPE)
717 {
718 TRACE("DoAppSwitch VK_ESCAPE 2\n");
720 }
721 goto Exit; //break;
722 }
723
724 case WM_SYSKEYDOWN:
725 {
726 PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
727 if (HIWORD(msg.lParam) & KF_ALTDOWN)
728 {
729 if ( msg.wParam == VK_TAB )
730 {
731 if (Esc) break;
732 if (GetKeyState(VK_SHIFT) < 0)
733 {
734 MoveLeft();
735 }
736 else
737 {
738 MoveRight();
739 }
740 }
741 else if ( msg.wParam == VK_ESCAPE )
742 {
743 if (!Esc) break;
745 }
746 else if ( msg.wParam == VK_LEFT )
747 {
748 MoveLeft();
749 }
750 else if ( msg.wParam == VK_RIGHT )
751 {
752 MoveRight();
753 }
754 else if ( msg.wParam == VK_UP )
755 {
756 MoveUp();
757 }
758 else if ( msg.wParam == VK_DOWN )
759 {
760 MoveDown();
761 }
762 }
763 break;
764 }
765
766 case WM_LBUTTONUP:
767 PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
768 ProcessMouseMessage(msg.message, msg.lParam);
769 goto Exit;
770
771 default:
772 if (PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE ))
773 {
776 }
777 break;
778 }
779 }
780Exit:
783 if (Esc) DestroyAppWindows();
785 selectedWindow = 0;
786 windowCount = 0;
787 Esc = FALSE;
788 return 0;
789}
790
791//
792// Switch System Class Window Proc.
793//
795{
796 PWND pWnd;
797 PALTTABINFO ati;
798 pWnd = ValidateHwnd(hWnd);
799 if (pWnd)
800 {
801 if (!pWnd->fnid)
802 {
804 }
805 }
806
807 switch (uMsg)
808 {
809 case WM_NCCREATE:
810 if (!(ati = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ati))))
811 return 0;
812 SetWindowLongPtrW( hWnd, 0, (LONG_PTR)ati );
813 return TRUE;
814
815 case WM_SHOWWINDOW:
816 if (wParam)
817 {
820 ati->cbSize = sizeof(ALTTABINFO);
821 ati->cItems = nItems;
822 ati->cColumns = nCols;
823 ati->cRows = nRows;
824 if (nCols)
825 {
826 ati->iColFocus = (selectedWindow - nShift) % nCols;
827 ati->iRowFocus = (selectedWindow - nShift) / nCols;
828 }
829 else
830 {
831 ati->iColFocus = 0;
832 ati->iRowFocus = 0;
833 }
834 ati->cxItem = CX_ITEM_SPACE;
835 ati->cyItem = CY_ITEM_SPACE;
836 ati->ptStart = ptStart;
837 }
838 return 0;
839
840 case WM_MOUSEMOVE:
842 return 0;
843
844 case WM_ACTIVATE:
845 if (wParam == WA_INACTIVE)
846 {
848 }
849 return 0;
850
851 case WM_PAINT:
852 OnPaint(hWnd);
853 return 0;
854
855 case WM_DESTROY:
856 isOpen = FALSE;
858 HeapFree( GetProcessHeap(), 0, ati );
859 SetWindowLongPtrW( hWnd, 0, 0 );
862 return 0;
863 }
864 return DefWindowProcW(hWnd, uMsg, wParam, lParam);
865}
866
868{
870}
871
873{
874 return SwitchWndProc_common(hWnd, uMsg, wParam, lParam, TRUE);
875}
#define ICON_TIMEOUT
int yOffset
Definition: appswitch.c:58
static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
Definition: appswitch.c:314
WCHAR windowText[1024]
Definition: appswitch.c:48
int fontHeight
Definition: appswitch.c:46
static HWND GetNiceRootOwner(HWND hwnd)
Definition: appswitch.c:233
const DWORD Style
Definition: appswitch.c:72
static void MoveLeft(void)
Definition: appswitch.c:574
BOOL SettingsLoaded
Definition: appswitch.c:69
int nItems
Definition: appswitch.c:55
static void MoveUp(void)
Definition: appswitch.c:588
int nRows
Definition: appswitch.c:55
void ProcessMouseMessage(UINT message, LPARAM lParam)
Definition: appswitch.c:324
DWORD CreateSwitcherWindow(HINSTANCE hInstance)
Definition: appswitch.c:444
@ DefSwitchRows
Definition: appswitch.c:65
@ DefSwitchColumns
Definition: appswitch.c:65
HWND windowList[MAX_WINDOWS]
Definition: appswitch.c:50
static void MoveRight(void)
Definition: appswitch.c:582
int xOffset
Definition: appswitch.c:58
#define ITEM_MARGIN
Definition: appswitch.c:29
POINT ptStart
Definition: appswitch.c:59
void CompleteSwitch(BOOL doSwitch)
Definition: appswitch.c:155
const DWORD ExStyle
Definition: appswitch.c:73
void OnPaint(HWND hWnd)
Definition: appswitch.c:351
int nCols
Definition: appswitch.c:55
#define CX_ITEM
Definition: appswitch.c:27
LRESULT WINAPI DoAppSwitch(WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:631
int CoolSwitchColumns
Definition: appswitch.c:68
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
Definition: appswitch.c:186
DWORD GetDialogFont(VOID)
Definition: appswitch.c:465
#define CX_ITEM_SPACE
Definition: appswitch.c:31
void ResizeAndCenter(HWND hwnd, int width, int height)
Definition: appswitch.c:131
BOOL IsAltTabWindow(HWND hwnd)
Definition: appswitch.c:259
#define DIALOG_MARGIN
Definition: appswitch.c:21
#define CY_ITEM_SPACE
Definition: appswitch.c:32
int totalH
Definition: appswitch.c:57
void RotateTasks(BOOL bShift)
Definition: appswitch.c:537
static void LoadCoolSwitchSettings(void)
Definition: appswitch.c:97
LRESULT WINAPI SwitchWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:867
static int GetRegInt(HKEY hKey, PCWSTR Name, int DefVal)
Definition: appswitch.c:75
int itemsH
Definition: appswitch.c:56
BOOL ProcessHotKey(VOID)
Definition: appswitch.c:502
BOOL CoolSwitch
Definition: appswitch.c:66
int windowCount
Definition: appswitch.c:52
int nShift
Definition: appswitch.c:61
HICON iconList[MAX_WINDOWS]
Definition: appswitch.c:51
int cyBorder
Definition: appswitch.c:54
#define MAX_WINDOWS
Definition: appswitch.c:38
VOID DestroyAppWindows(VOID)
Definition: appswitch.c:619
int CoolSwitchRows
Definition: appswitch.c:67
#define ICON_MARGIN
Definition: appswitch.c:25
int totalW
Definition: appswitch.c:57
BOOL isOpen
Definition: appswitch.c:44
#define CY_ITEM
Definition: appswitch.c:28
#define CX_ICON
Definition: appswitch.c:23
void PrepareWindow(VOID)
Definition: appswitch.c:480
#define CY_TEXT_MARGIN
Definition: appswitch.c:34
LRESULT WINAPI SwitchWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:872
LRESULT WINAPI SwitchWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: appswitch.c:794
HWND switchdialog
Definition: appswitch.c:41
static void MoveDown(void)
Definition: appswitch.c:603
int selectedWindow
Definition: appswitch.c:43
HFONT dialogFont
Definition: appswitch.c:42
BOOL Esc
Definition: appswitch.c:63
#define CY_ICON
Definition: appswitch.c:24
int itemsW
Definition: appswitch.c:56
int cxBorder
Definition: appswitch.c:54
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:182
#define RegCloseKey(hKey)
Definition: registry.h:49
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSTR Name
Definition: desk.c:124
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define CALLBACK
Definition: compat.h:35
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
pKey DeleteObject()
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
PSERVERINFO gpsi
Definition: imm.c:18
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define FNID_SWITCH
Definition: ntuser.h:865
#define FNID_DESTROY
Definition: ntuser.h:898
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4348
#define REG_SZ
Definition: layer.c:22
static HDC
Definition: imagelist.c:88
static HICON
Definition: imagelist.c:80
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
static IHTMLWindow2 * window
Definition: events.c:77
#define DBG(x)
Definition: moztest.c:12
HICON hIcon
Definition: msconfig.c:44
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define UNICODE_NULL
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
#define WS_EX_DLGMODALFRAME
Definition: pedump.c:645
#define WS_BORDER
Definition: pedump.c:625
#define WS_POPUP
Definition: pedump.c:616
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define WS_DISABLED
Definition: pedump.c:621
#define err(...)
#define REG_DWORD
Definition: sdbapi.c:596
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define _countof(array)
Definition: sndvol32.h:70
static void Exit(void)
Definition: sock.c:1330
#define TRACE(s)
Definition: solgame.cpp:4
Definition: ntuser.h:694
DWORD fnid
Definition: ntuser.h:709
Definition: tftpd.h:60
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
Definition: time.h:68
#define ICON_BIG
Definition: tnclass.cpp:51
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
const uint16_t * PCWSTR
Definition: typedefs.h:57
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
#define WC_SWITCH
Definition: undocuser.h:14
HINSTANCE User32Instance
Definition: dllmain.c:27
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
#define ValidateHwnd(hwnd)
Definition: precomp.h:101
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
#define MoveMemory
Definition: winbase.h:1750
_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
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define DI_NORMAL
Definition: wingdi.h:72
#define TRANSPARENT
Definition: wingdi.h:950
#define NULL_BRUSH
Definition: wingdi.h:901
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:917
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define GetTextMetrics
Definition: wingdi.h:4474
#define PS_SOLID
Definition: wingdi.h:586
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define SW_SHOWNORMAL
Definition: winuser.h:781
#define WM_PAINT
Definition: winuser.h:1639
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define GW_OWNER
Definition: winuser.h:777
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define SW_HIDE
Definition: winuser.h:779
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define COLOR_BTNTEXT
Definition: winuser.h:944
#define GetWindowLongPtrW
Definition: winuser.h:4905
#define VK_TAB
Definition: winuser.h:2218
#define SWP_NOREPOSITION
Definition: winuser.h:1261
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define WM_KEYUP
Definition: winuser.h:1735
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define CS_IME
Definition: winuser.h:667
#define SM_CYSCREEN
Definition: winuser.h:971
#define DT_CENTER
Definition: winuser.h:527
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DT_END_ELLIPSIS
Definition: winuser.h:529
#define DFCS_BUTTONPUSH
Definition: winuser.h:501
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetLastActivePopup(_In_ HWND)
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define WS_EX_APPWINDOW
Definition: winuser.h:383
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define COLOR_HIGHLIGHT
Definition: winuser.h:937
#define SMTO_BLOCK
Definition: winuser.h:1235
#define DT_SINGLELINE
Definition: winuser.h:540
HICON WINAPI CopyIcon(_In_ HICON)
Definition: cursoricon.c:2348
#define SWP_NOMOVE
Definition: winuser.h:1255
#define KF_ALTDOWN
Definition: winuser.h:2468
#define VK_SCROLL
Definition: winuser.h:2299
#define WS_EX_NOACTIVATE
Definition: winuser.h:395
#define DFC_BUTTON
Definition: winuser.h:476
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define VK_UP
Definition: winuser.h:2244
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_MOUSEMOVE
Definition: winuser.h:1794
#define WA_INACTIVE
Definition: winuser.h:2641
#define SWP_ASYNCWINDOWPOS
Definition: winuser.h:1264
BOOL WINAPI CallMsgFilterW(_In_ LPMSG, _In_ INT)
LRESULT WINAPI SendMessageTimeoutW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)
#define WM_NCCREATE
Definition: winuser.h:1702
#define WM_ACTIVATE
Definition: winuser.h:1631
#define WM_SHOWWINDOW
Definition: winuser.h:1647
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define VK_RETURN
Definition: winuser.h:2220
#define HWND_TOP
Definition: winuser.h:1218
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define MSGF_NEXTWINDOW
Definition: winuser.h:1190
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
Definition: cursoricon.c:2365
#define PM_REMOVE
Definition: winuser.h:1207
BOOL WINAPI WaitMessage(void)
Definition: ntwrapper.h:350
HDC WINAPI GetDC(_In_opt_ HWND)
#define GetWindowLong
Definition: winuser.h:5881
#define WM_LBUTTONUP
Definition: winuser.h:1796
#define DT_VCENTER
Definition: winuser.h:543
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GetClassLongPtrW
Definition: winuser.h:4640
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1234
#define VK_LEFT
Definition: winuser.h:2243
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define VK_RIGHT
Definition: winuser.h:2245
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define VK_DOWN
Definition: winuser.h:2246
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define VK_SHIFT
Definition: winuser.h:2221
#define WM_DESTROY
Definition: winuser.h:1628
struct tagALTTABINFO * PALTTABINFO
SHORT WINAPI GetAsyncKeyState(_In_ int)
#define SM_CXSCREEN
Definition: winuser.h:970
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5431
#define GCL_HICON
Definition: winuser.h:674
struct tagALTTABINFO ALTTABINFO
#define VK_ESCAPE
Definition: winuser.h:2233
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define DFCS_PUSHED
Definition: winuser.h:503
#define PM_NOREMOVE
Definition: winuser.h:1206
int WINAPI GetSystemMetrics(_In_ int)
#define WM_SYSKEYDOWN
Definition: winuser.h:1738
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define GCL_STYLE
Definition: winuser.h:678
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2223
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define GWL_EXSTYLE
Definition: winuser.h:862
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2390
#define COLOR_3DFACE
Definition: winuser.h:940
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193