ReactOS 0.4.16-dev-1142-g8029339
appswitch.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: win32ss/user/user32/controls/appswitch.c
5 * PURPOSE: app switching functionality
6 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
7 * David Quintana (gigaherz@gmail.com)
8 * Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
9 */
10
11//
12// TODO:
13// Move to Win32k.
14// Add registry support.
15//
16//
17
18#include <user32.h>
19
21
22#define DIALOG_MARGIN 8 // margin of dialog contents
23
24#define CX_ICON 32 // width of icon
25#define CY_ICON 32 // height of icon
26#define ICON_MARGIN 4 // margin width around an icon
27
28#define CX_ITEM (CX_ICON + 2 * ICON_MARGIN)
29#define CY_ITEM (CY_ICON + 2 * ICON_MARGIN)
30#define ITEM_MARGIN 4 // margin width around an item
31
32#define CX_ITEM_SPACE (CX_ITEM + 2 * ITEM_MARGIN)
33#define CY_ITEM_SPACE (CY_ITEM + 2 * ITEM_MARGIN)
34
35#define CY_TEXT_MARGIN 4 // margin height around text
36
37// limit the number of windows shown in the alt-tab window
38// 120 windows results in (12*40) by (10*40) pixels worth of icons.
39#define MAX_WINDOWS 120
40
41// Global variables
46
48
50
54
61
62int nShift = 0;
63
65
71
72// window style
75
76static int GetRegInt(HKEY hKey, PCWSTR Name, int DefVal)
77{
78 WCHAR buf[sizeof("-2147483648")];
79 DWORD cb = sizeof(buf), type;
81 if (err == ERROR_SUCCESS && cb <= sizeof(buf) - sizeof(*buf))
82 {
83 buf[cb / sizeof(*buf)] = UNICODE_NULL;
84 if (type == REG_SZ || type == REG_EXPAND_SZ)
85 {
86 WCHAR *pszEnd;
87 long Value = wcstol(buf, &pszEnd, 10);
88 return pszEnd > buf ? Value : DefVal;
89 }
90 if ((type == REG_DWORD || type == REG_BINARY) && cb == sizeof(DWORD))
91 {
92 return *(DWORD*)buf;
93 }
94 }
95 return DefVal;
96}
97
98static void LoadCoolSwitchSettings(void)
99{
100 HKEY hKey;
101
103#if DBG
104 && !(GetKeyState(VK_SCROLL) & 1) // If Scroll-Lock is on, always read the settings
105#endif
106 )
107 {
108 return;
109 }
110
112 // TODO: Should read from win.ini instead when IniFileMapping is implemented
113 if (!RegOpenKeyExW(HKEY_CURRENT_USER, L"Control Panel\\Desktop", 0, KEY_READ, &hKey))
114 {
115 CoolSwitch = GetRegInt(hKey, L"CoolSwitch", TRUE);
116 CoolSwitchRows = GetRegInt(hKey, L"CoolSwitchRows", DefSwitchRows);
117 CoolSwitchColumns = GetRegInt(hKey, L"CoolSwitchColumns", DefSwitchColumns);
119 }
120
122 {
125 }
126
127 TRACE("CoolSwitch: %d\n", CoolSwitch);
128 TRACE("CoolSwitchRows: %d\n", CoolSwitchRows);
129 TRACE("CoolSwitchColumns: %d\n", CoolSwitchColumns);
130}
131
133{
134 int x, y;
135 RECT Rect;
136
137 int screenwidth = GetSystemMetrics(SM_CXSCREEN);
138 int screenheight = GetSystemMetrics(SM_CYSCREEN);
139
140 x = (screenwidth - width) / 2;
141 y = (screenheight - height) / 2;
142
143 SetRect(&Rect, x, y, x + width, y + height);
145
146 x = Rect.left;
147 y = Rect.top;
148 width = Rect.right - Rect.left;
149 height = Rect.bottom - Rect.top;
151
152 ptStart.x = x;
153 ptStart.y = y;
154}
155
156void CompleteSwitch(BOOL doSwitch)
157{
158 if (!isOpen)
159 return;
160
161 isOpen = FALSE;
162
163 TRACE("[ATbot] CompleteSwitch Hiding Window.\n");
165
166 if(doSwitch)
167 {
169 return;
170
171 // FIXME: workaround because reactos fails to activate the previous window correctly.
172 //if(selectedWindow != 0)
173 {
175
177
178 TRACE("[ATbot] CompleteSwitch Switching to 0x%08x (%ls)\n", hwnd, windowText);
179
181 }
182 }
183
184 windowCount = 0;
185}
186
188{
189 HICON hIcon = NULL;
190 LRESULT bAlive;
191
193
194 // First try to get the big icon assigned to the window
195#define ICON_TIMEOUT 100 // in milliseconds
198 if (!hIcon)
199 {
200 // If no icon is assigned, try to get the icon assigned to the windows' class
202 if (!hIcon)
203 {
204 // If we still don't have an icon, see if we can do with the small icon,
205 // or a default application icon
206 if (bAlive)
207 {
208 SendMessageTimeoutW(window, WM_GETICON, ICON_SMALL2, 0,
210 (PDWORD_PTR)&hIcon);
211 }
212#undef ICON_TIMEOUT
213 if (!hIcon)
214 {
215 // using windows logo icon as default
216 hIcon = gpsi->hIconWindows;
217 if (!hIcon)
218 {
219 //if all attempts to get icon fails go to the next window
220 return TRUE;
221 }
222 }
223 }
224 }
225
228 windowCount++;
229
230 // If we got to the max number of windows, we won't be able to add any more
231 return (windowCount < MAX_WINDOWS);
232}
233
235{
236 HWND hwndOwner;
237 DWORD ExStyle, OwnerExStyle;
238
239 for (;;)
240 {
241 // A window with WS_EX_APPWINDOW is treated as if it has no owner
244 break;
245
246 // Is the owner visible?
247 // An window with WS_EX_TOOLWINDOW is treated as if it weren't visible
248 hwndOwner = GetWindow(hwnd, GW_OWNER);
249 OwnerExStyle = GetWindowLong(hwndOwner, GWL_EXSTYLE);
250 if (!IsWindowVisible(hwndOwner) || (OwnerExStyle & WS_EX_TOOLWINDOW))
251 break;
252
253 hwnd = hwndOwner;
254 }
255
256 return hwnd;
257}
258
259// c.f. https://devblogs.microsoft.com/oldnewthing/20071008-00/?p=24863
261{
263 RECT rc;
264 HWND hwndTry, hwndWalk;
265 WCHAR szClass[64];
266
267 // must be visible
268 if (!IsWindowVisible(hwnd))
269 return FALSE;
270
271 // must not be WS_EX_TOOLWINDOW nor WS_EX_NOACTIVATE
274 return FALSE;
275
276 // must be not empty rect
277 GetWindowRect(hwnd, &rc);
278 if (IsRectEmpty(&rc))
279 return FALSE;
280
281 // check special windows
282 if (!GetClassNameW(hwnd, szClass, _countof(szClass)) ||
283 wcscmp(szClass, L"Shell_TrayWnd") == 0 ||
284 wcscmp(szClass, L"Progman") == 0)
285 {
286 return TRUE;
287 }
288
289 // get 'nice' root owner
290 hwndWalk = GetNiceRootOwner(hwnd);
291
292 // walk back from hwndWalk toward hwnd
293 for (;;)
294 {
295 hwndTry = GetLastActivePopup(hwndWalk);
296 if (hwndTry == hwndWalk)
297 break;
298
300 if (IsWindowVisible(hwndTry) && !(ExStyle & WS_EX_TOOLWINDOW))
301 break;
302
303 hwndWalk = hwndTry;
304 }
305
306 return hwnd == hwndTry; // Reached?
307}
308
309static BOOL CALLBACK
311{
312 if (IsAltTabWindow(hwnd))
313 {
315 return FALSE;
316 }
317 return TRUE;
318}
319
321{
322 int xPos = LOWORD(lParam);
323 int yPos = HIWORD(lParam);
324
325 int xIndex = (xPos - DIALOG_MARGIN) / CX_ITEM_SPACE;
326 int yIndex = (yPos - DIALOG_MARGIN) / CY_ITEM_SPACE;
327
328 if (xIndex < 0 || nCols <= xIndex ||
329 yIndex < 0 || nRows <= yIndex)
330 {
331 return;
332 }
333
334 selectedWindow = (yIndex*nCols) + xIndex;
335 if (message == WM_MOUSEMOVE)
336 {
338 //RedrawWindow(switchdialog, NULL, NULL, 0);
339 }
340 else
341 {
342 selectedWindow = (yIndex*nCols) + xIndex;
344 }
345}
346
348{
349 HDC dialogDC;
350 PAINTSTRUCT paint;
351 RECT cRC, textRC;
352 int i, xPos, yPos, CharCount;
353 HFONT dcFont;
354 HICON hIcon;
355 HPEN hPen;
357
358 // check
359 if (nCols == 0 || nItems == 0)
360 return;
361
362 // begin painting
363 dialogDC = BeginPaint(hWnd, &paint);
364 if (dialogDC == NULL)
365 return;
366
367 // fill the client area
368 GetClientRect(hWnd, &cRC);
369 FillRect(dialogDC, &cRC, (HBRUSH)(COLOR_3DFACE + 1));
370
371 // if the selection index exceeded the display items, then
372 // do display item shifting
373 if (selectedWindow >= nItems)
375 else
376 nShift = 0;
377
378 for (i = 0; i < nItems; ++i)
379 {
380 // get the icon to display
381 hIcon = iconList[i + nShift];
382
383 // calculate the position where we start drawing
386
387 // centering
389 {
390 xPos += (itemsW - nItems * CX_ITEM_SPACE) / 2;
391 }
392
393 // if this position is selected,
394 if (selectedWindow == i + nShift)
395 {
396 // create a solid pen
398 hPen = CreatePen(PS_SOLID, 1, Color);
399
400 // draw a rectangle with using the pen
401 SelectObject(dialogDC, hPen);
403 Rectangle(dialogDC, xPos, yPos, xPos + CX_ITEM, yPos + CY_ITEM);
404 Rectangle(dialogDC, xPos + 1, yPos + 1,
405 xPos + CX_ITEM - 1, yPos + CY_ITEM - 1);
406
407 // delete the pen
408 DeleteObject(hPen);
409 }
410
411 // draw icon
412 DrawIconEx(dialogDC, xPos + ICON_MARGIN, yPos + ICON_MARGIN,
414 }
415
416 // set the text rectangle
419
420 // draw the sunken button around text
421 DrawFrameControl(dialogDC, &textRC, DFC_BUTTON,
423
424 // get text
427
428 // draw text
429 dcFont = SelectObject(dialogDC, dialogFont);
431 SetBkMode(dialogDC, TRANSPARENT);
432 DrawTextW(dialogDC, windowText, CharCount, &textRC,
434 SelectObject(dialogDC, dcFont);
435
436 // end painting
437 EndPaint(hWnd, &paint);
438}
439
441{
443 WC_SWITCH,
444 L"",
448 400, 150,
449 NULL, NULL,
450 hInstance, NULL);
451 if (!switchdialog)
452 {
453 TRACE("[ATbot] Task Switcher Window failed to create.\n");
454 return 0;
455 }
456
457 isOpen = FALSE;
458 return 1;
459}
460
462{
463 HDC tDC;
465
467
468 tDC = GetDC(0);
469 GetTextMetrics(tDC, &tm);
470 fontHeight = tm.tmHeight;
471 ReleaseDC(0, tDC);
472
473 return 1;
474}
475
477{
479
482 if (nRows > CoolSwitchRows)
483 {
485 nItems = nRows * nCols;
486 }
487
490
494
496}
497
499{
500 if (!isOpen)
501 {
502 windowCount = 0;
504
505 if (windowCount == 0)
506 return FALSE;
507
508 if (windowCount == 1)
509 {
511 return FALSE;
512 }
513
515 return FALSE;
516
517 selectedWindow = 1;
518
519 TRACE("[ATbot] HotKey Received. Opening window.\n");
522 isOpen = TRUE;
523 }
524 else
525 {
526 TRACE("[ATbot] HotKey Received Rotating.\n");
529 }
530 return TRUE;
531}
532
533void RotateTasks(BOOL bShift)
534{
535 HWND hwndFirst, hwndLast;
536 DWORD Size;
537
538 if (windowCount < 2 || !Esc)
539 return;
540
541 hwndFirst = windowList[0];
542 hwndLast = windowList[windowCount - 1];
543
544 if (bShift)
545 {
546 SetWindowPos(hwndLast, HWND_TOP, 0, 0, 0, 0,
549
550 SwitchToThisWindow(hwndLast, TRUE);
551
552 Size = (windowCount - 1) * sizeof(HWND);
554 windowList[0] = hwndLast;
555 }
556 else
557 {
558 SetWindowPos(hwndFirst, hwndLast, 0, 0, 0, 0,
561
563
564 Size = (windowCount - 1) * sizeof(HWND);
566 windowList[windowCount - 1] = hwndFirst;
567 }
568}
569
570static void MoveLeft(void)
571{
573 if (selectedWindow < 0)
576}
577
578static void MoveRight(void)
579{
582}
583
584static void MoveUp(void)
585{
586 INT iRow = selectedWindow / nCols;
587 INT iCol = selectedWindow % nCols;
588
589 --iRow;
590 if (iRow < 0)
591 iRow = nRows - 1;
592
593 selectedWindow = iRow * nCols + iCol;
597}
598
599static void MoveDown(void)
600{
601 INT iRow = selectedWindow / nCols;
602 INT iCol = selectedWindow % nCols;
603
604 ++iRow;
605 if (iRow >= nRows)
606 iRow = 0;
607
608 selectedWindow = iRow * nCols + iCol;
612}
613
614VOID
616{
617 // for every item of the icon list:
618 INT i;
619 for (i = 0; i < windowCount; ++i)
620 {
621 // destroy the icon
623 iconList[i] = NULL;
624 }
625}
626
628{
629 HWND hwndActive;
630 MSG msg;
631
632 // FIXME: Is loading timing OK?
634
635 if (!CoolSwitch)
636 return 0;
637
638 // Already in the loop.
639 if (switchdialog || Esc) return 0;
640
641 if (lParam == VK_ESCAPE)
642 {
643 Esc = TRUE;
644
645 windowCount = 0;
647
648 if (windowCount < 2)
649 return 0;
650
652
653 hwndActive = GetActiveWindow();
654
655 if (hwndActive == NULL)
656 {
657 Esc = FALSE;
658 return 0;
659 }
660 }
661
662 // Capture current active window.
663 hwndActive = GetActiveWindow();
664 if (hwndActive)
665 SetCapture(hwndActive);
666
667 switch (lParam)
668 {
669 case VK_TAB:
670 if (!GetDialogFont() || !ProcessHotKey())
671 goto Exit;
672 break;
673
674 case VK_ESCAPE:
675 break;
676
677 default:
678 goto Exit;
679 }
680
681 if (!hwndActive)
682 goto Exit;
683
684 // Main message loop:
685 while (1)
686 {
687 for (;;)
688 {
689 if (PeekMessageW( &msg, 0, 0, 0, PM_NOREMOVE ))
690 {
691 if (!CallMsgFilterW( &msg, MSGF_NEXTWINDOW )) break;
692 /* remove the message from the queue */
693 PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
694 }
695 else
696 WaitMessage();
697 }
698
699 switch (msg.message)
700 {
701 case WM_KEYUP:
702 {
703 PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
704 if (msg.wParam == VK_MENU)
705 {
707 }
708 else if (msg.wParam == VK_RETURN)
709 {
711 }
712 else if (msg.wParam == VK_ESCAPE)
713 {
714 TRACE("DoAppSwitch VK_ESCAPE 2\n");
716 }
717 goto Exit; //break;
718 }
719
720 case WM_SYSKEYDOWN:
721 {
722 PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
723 if (HIWORD(msg.lParam) & KF_ALTDOWN)
724 {
725 if ( msg.wParam == VK_TAB )
726 {
727 if (Esc) break;
728 if (GetKeyState(VK_SHIFT) < 0)
729 {
730 MoveLeft();
731 }
732 else
733 {
734 MoveRight();
735 }
736 }
737 else if ( msg.wParam == VK_ESCAPE )
738 {
739 if (!Esc) break;
741 }
742 else if ( msg.wParam == VK_LEFT )
743 {
744 MoveLeft();
745 }
746 else if ( msg.wParam == VK_RIGHT )
747 {
748 MoveRight();
749 }
750 else if ( msg.wParam == VK_UP )
751 {
752 MoveUp();
753 }
754 else if ( msg.wParam == VK_DOWN )
755 {
756 MoveDown();
757 }
758 }
759 break;
760 }
761
762 case WM_LBUTTONUP:
763 PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE );
764 ProcessMouseMessage(msg.message, msg.lParam);
765 goto Exit;
766
767 default:
768 if (PeekMessageW( &msg, 0, msg.message, msg.message, PM_REMOVE ))
769 {
772 }
773 break;
774 }
775 }
776Exit:
779 if (Esc) DestroyAppWindows();
781 selectedWindow = 0;
782 windowCount = 0;
783 Esc = FALSE;
784 return 0;
785}
786
787//
788// Switch System Class Window Proc.
789//
791{
792 PWND pWnd;
793 PALTTABINFO ati;
794 pWnd = ValidateHwnd(hWnd);
795 if (pWnd)
796 {
797 if (!pWnd->fnid)
798 {
800 }
801 }
802
803 switch (uMsg)
804 {
805 case WM_NCCREATE:
806 if (!(ati = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ati))))
807 return 0;
808 SetWindowLongPtrW( hWnd, 0, (LONG_PTR)ati );
809 return TRUE;
810
811 case WM_SHOWWINDOW:
812 if (wParam)
813 {
816 ati->cbSize = sizeof(ALTTABINFO);
817 ati->cItems = nItems;
818 ati->cColumns = nCols;
819 ati->cRows = nRows;
820 if (nCols)
821 {
822 ati->iColFocus = (selectedWindow - nShift) % nCols;
823 ati->iRowFocus = (selectedWindow - nShift) / nCols;
824 }
825 else
826 {
827 ati->iColFocus = 0;
828 ati->iRowFocus = 0;
829 }
830 ati->cxItem = CX_ITEM_SPACE;
831 ati->cyItem = CY_ITEM_SPACE;
832 ati->ptStart = ptStart;
833 }
834 return 0;
835
836 case WM_MOUSEMOVE:
838 return 0;
839
840 case WM_ACTIVATE:
841 if (wParam == WA_INACTIVE)
842 {
844 }
845 return 0;
846
847 case WM_PAINT:
848 OnPaint(hWnd);
849 return 0;
850
851 case WM_DESTROY:
852 isOpen = FALSE;
854 HeapFree( GetProcessHeap(), 0, ati );
855 SetWindowLongPtrW( hWnd, 0, 0 );
858 return 0;
859 }
860 return DefWindowProcW(hWnd, uMsg, wParam, lParam);
861}
862
864{
866}
867
869{
870 return SwitchWndProc_common(hWnd, uMsg, wParam, lParam, TRUE);
871}
#define ICON_TIMEOUT
int yOffset
Definition: appswitch.c:59
static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
Definition: appswitch.c:310
WCHAR windowText[1024]
Definition: appswitch.c:49
int fontHeight
Definition: appswitch.c:47
static HWND GetNiceRootOwner(HWND hwnd)
Definition: appswitch.c:234
const DWORD Style
Definition: appswitch.c:73
static void MoveLeft(void)
Definition: appswitch.c:570
BOOL SettingsLoaded
Definition: appswitch.c:70
int nItems
Definition: appswitch.c:56
static void MoveUp(void)
Definition: appswitch.c:584
int nRows
Definition: appswitch.c:56
@ DefSwitchRows
Definition: appswitch.c:66
@ DefSwitchColumns
Definition: appswitch.c:66
void ProcessMouseMessage(UINT message, LPARAM lParam)
Definition: appswitch.c:320
DWORD CreateSwitcherWindow(HINSTANCE hInstance)
Definition: appswitch.c:440
HWND windowList[MAX_WINDOWS]
Definition: appswitch.c:51
static void MoveRight(void)
Definition: appswitch.c:578
int xOffset
Definition: appswitch.c:59
#define ITEM_MARGIN
Definition: appswitch.c:30
POINT ptStart
Definition: appswitch.c:60
void CompleteSwitch(BOOL doSwitch)
Definition: appswitch.c:156
const DWORD ExStyle
Definition: appswitch.c:74
void OnPaint(HWND hWnd)
Definition: appswitch.c:347
int nCols
Definition: appswitch.c:56
#define CX_ITEM
Definition: appswitch.c:28
LRESULT WINAPI DoAppSwitch(WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:627
int CoolSwitchColumns
Definition: appswitch.c:69
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
Definition: appswitch.c:187
DWORD GetDialogFont(VOID)
Definition: appswitch.c:461
#define CX_ITEM_SPACE
Definition: appswitch.c:32
void ResizeAndCenter(HWND hwnd, int width, int height)
Definition: appswitch.c:132
BOOL IsAltTabWindow(HWND hwnd)
Definition: appswitch.c:260
#define DIALOG_MARGIN
Definition: appswitch.c:22
#define CY_ITEM_SPACE
Definition: appswitch.c:33
int totalH
Definition: appswitch.c:58
void RotateTasks(BOOL bShift)
Definition: appswitch.c:533
static void LoadCoolSwitchSettings(void)
Definition: appswitch.c:98
LRESULT WINAPI SwitchWndProcA(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:863
static int GetRegInt(HKEY hKey, PCWSTR Name, int DefVal)
Definition: appswitch.c:76
int itemsH
Definition: appswitch.c:57
BOOL ProcessHotKey(VOID)
Definition: appswitch.c:498
BOOL CoolSwitch
Definition: appswitch.c:67
int windowCount
Definition: appswitch.c:53
int nShift
Definition: appswitch.c:62
HICON iconList[MAX_WINDOWS]
Definition: appswitch.c:52
int cyBorder
Definition: appswitch.c:55
#define MAX_WINDOWS
Definition: appswitch.c:39
VOID DestroyAppWindows(VOID)
Definition: appswitch.c:615
int CoolSwitchRows
Definition: appswitch.c:68
#define ICON_MARGIN
Definition: appswitch.c:26
int totalW
Definition: appswitch.c:58
BOOL isOpen
Definition: appswitch.c:45
#define CY_ITEM
Definition: appswitch.c:29
#define CX_ICON
Definition: appswitch.c:24
void PrepareWindow(VOID)
Definition: appswitch.c:476
#define CY_TEXT_MARGIN
Definition: appswitch.c:35
LRESULT WINAPI SwitchWndProcW(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: appswitch.c:868
LRESULT WINAPI SwitchWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: appswitch.c:790
HWND switchdialog
Definition: appswitch.c:42
static void MoveDown(void)
Definition: appswitch.c:599
int selectedWindow
Definition: appswitch.c:44
HFONT dialogFont
Definition: appswitch.c:43
BOOL Esc
Definition: appswitch.c:64
#define CY_ICON
Definition: appswitch.c:25
int itemsW
Definition: appswitch.c:57
int cxBorder
Definition: appswitch.c:55
#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
PSERVERINFO gpsi
Definition: imm.c:18
#define ValidateHwnd(hwnd)
Definition: precomp.h:113
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
_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:325
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:12
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
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:1740
_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:1631
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:4840
#define VK_TAB
Definition: winuser.h:2210
#define SWP_NOREPOSITION
Definition: winuser.h:1261
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define WM_KEYUP
Definition: winuser.h:1727
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#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:2460
#define VK_SCROLL
Definition: winuser.h:2291
#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:2236
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define SWP_NOSIZE
Definition: winuser.h:1256
#define WM_MOUSEMOVE
Definition: winuser.h:1786
#define WA_INACTIVE
Definition: winuser.h:2633
#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:1694
#define WM_ACTIVATE
Definition: winuser.h:1623
#define WM_SHOWWINDOW
Definition: winuser.h:1639
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define VK_RETURN
Definition: winuser.h:2212
#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:5816
#define WM_LBUTTONUP
Definition: winuser.h:1788
#define DT_VCENTER
Definition: winuser.h:543
#define CW_USEDEFAULT
Definition: winuser.h:225
#define GetClassLongPtrW
Definition: winuser.h:4575
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1234
#define VK_LEFT
Definition: winuser.h:2235
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define VK_RIGHT
Definition: winuser.h:2237
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:2238
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define VK_SHIFT
Definition: winuser.h:2213
#define WM_DESTROY
Definition: winuser.h:1620
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:5366
#define GCL_HICON
Definition: winuser.h:674
struct tagALTTABINFO ALTTABINFO
#define VK_ESCAPE
Definition: winuser.h:2225
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:1730
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2215
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