ReactOS 0.4.16-dev-1170-ge326b06
appswitch.c File Reference
#include <user32.h>
Include dependency graph for appswitch.c:

Go to the source code of this file.

Macros

#define DIALOG_MARGIN   8
 
#define CX_ICON   32
 
#define CY_ICON   32
 
#define ICON_MARGIN   4
 
#define CX_ITEM   (CX_ICON + 2 * ICON_MARGIN)
 
#define CY_ITEM   (CY_ICON + 2 * ICON_MARGIN)
 
#define ITEM_MARGIN   4
 
#define CX_ITEM_SPACE   (CX_ITEM + 2 * ITEM_MARGIN)
 
#define CY_ITEM_SPACE   (CY_ITEM + 2 * ITEM_MARGIN)
 
#define CY_TEXT_MARGIN   4
 
#define MAX_WINDOWS   120
 
#define ICON_TIMEOUT   100
 

Enumerations

enum  { DefSwitchRows = 3 , DefSwitchColumns = 7 }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
static int GetRegInt (HKEY hKey, PCWSTR Name, int DefVal)
 
static void LoadCoolSwitchSettings (void)
 
void ResizeAndCenter (HWND hwnd, int width, int height)
 
void CompleteSwitch (BOOL doSwitch)
 
BOOL CALLBACK EnumerateCallback (HWND window, LPARAM lParam)
 
static HWND GetNiceRootOwner (HWND hwnd)
 
BOOL IsAltTabWindow (HWND hwnd)
 
static BOOL CALLBACK EnumWindowsProc (HWND hwnd, LPARAM lParam)
 
void ProcessMouseMessage (UINT message, LPARAM lParam)
 
void OnPaint (HWND hWnd)
 
DWORD CreateSwitcherWindow (HINSTANCE hInstance)
 
DWORD GetDialogFont (VOID)
 
void PrepareWindow (VOID)
 
BOOL ProcessHotKey (VOID)
 
void RotateTasks (BOOL bShift)
 
static void MoveLeft (void)
 
static void MoveRight (void)
 
static void MoveUp (void)
 
static void MoveDown (void)
 
VOID DestroyAppWindows (VOID)
 
LRESULT WINAPI DoAppSwitch (WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI SwitchWndProc_common (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
 
LRESULT WINAPI SwitchWndProcA (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI SwitchWndProcW (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

HWND switchdialog = NULL
 
HFONT dialogFont
 
int selectedWindow = 0
 
BOOL isOpen = FALSE
 
int fontHeight =0
 
WCHAR windowText [1024]
 
HWND windowList [MAX_WINDOWS]
 
HICON iconList [MAX_WINDOWS]
 
int windowCount = 0
 
int cxBorder
 
int cyBorder
 
int nItems
 
int nCols
 
int nRows
 
int itemsW
 
int itemsH
 
int totalW
 
int totalH
 
int xOffset
 
int yOffset
 
POINT ptStart
 
int nShift = 0
 
BOOL Esc = FALSE
 
BOOL CoolSwitch = TRUE
 
int CoolSwitchRows = DefSwitchRows
 
int CoolSwitchColumns = DefSwitchColumns
 
BOOL SettingsLoaded = FALSE
 
const DWORD Style = WS_POPUP | WS_BORDER | WS_DISABLED
 
const DWORD ExStyle = WS_EX_TOPMOST | WS_EX_DLGMODALFRAME | WS_EX_TOOLWINDOW
 

Macro Definition Documentation

◆ CX_ICON

#define CX_ICON   32

Definition at line 24 of file appswitch.c.

◆ CX_ITEM

#define CX_ITEM   (CX_ICON + 2 * ICON_MARGIN)

Definition at line 28 of file appswitch.c.

◆ CX_ITEM_SPACE

#define CX_ITEM_SPACE   (CX_ITEM + 2 * ITEM_MARGIN)

Definition at line 32 of file appswitch.c.

◆ CY_ICON

#define CY_ICON   32

Definition at line 25 of file appswitch.c.

◆ CY_ITEM

#define CY_ITEM   (CY_ICON + 2 * ICON_MARGIN)

Definition at line 29 of file appswitch.c.

◆ CY_ITEM_SPACE

#define CY_ITEM_SPACE   (CY_ITEM + 2 * ITEM_MARGIN)

Definition at line 33 of file appswitch.c.

◆ CY_TEXT_MARGIN

#define CY_TEXT_MARGIN   4

Definition at line 35 of file appswitch.c.

◆ DIALOG_MARGIN

#define DIALOG_MARGIN   8

Definition at line 22 of file appswitch.c.

◆ ICON_MARGIN

#define ICON_MARGIN   4

Definition at line 26 of file appswitch.c.

◆ ICON_TIMEOUT

#define ICON_TIMEOUT   100

◆ ITEM_MARGIN

#define ITEM_MARGIN   4

Definition at line 30 of file appswitch.c.

◆ MAX_WINDOWS

#define MAX_WINDOWS   120

Definition at line 39 of file appswitch.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DefSwitchRows 
DefSwitchColumns 

Definition at line 66 of file appswitch.c.

@ DefSwitchRows
Definition: appswitch.c:66
@ DefSwitchColumns
Definition: appswitch.c:66

Function Documentation

◆ CompleteSwitch()

void CompleteSwitch ( BOOL  doSwitch)

Definition at line 156 of file appswitch.c.

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}
WCHAR windowText[1024]
Definition: appswitch.c:49
HWND windowList[MAX_WINDOWS]
Definition: appswitch.c:51
int windowCount
Definition: appswitch.c:53
BOOL isOpen
Definition: appswitch.c:45
HWND switchdialog
Definition: appswitch.c:42
int selectedWindow
Definition: appswitch.c:44
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1382
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SW_HIDE
Definition: winuser.h:779
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)

Referenced by DoAppSwitch(), ProcessMouseMessage(), and SwitchWndProc_common().

◆ CreateSwitcherWindow()

DWORD CreateSwitcherWindow ( HINSTANCE  hInstance)

Definition at line 440 of file appswitch.c.

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}
HINSTANCE hInstance
Definition: charmap.c:19
#define NULL
Definition: types.h:112
#define L(x)
Definition: ntvdm.h:50
#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 WC_SWITCH
Definition: undocuser.h:12
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
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)
#define CW_USEDEFAULT
Definition: winuser.h:225

Referenced by ProcessHotKey().

◆ DestroyAppWindows()

VOID DestroyAppWindows ( VOID  )

Definition at line 615 of file appswitch.c.

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}
HICON iconList[MAX_WINDOWS]
Definition: appswitch.c:52
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
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI DestroyIcon(_In_ HICON)
Definition: cursoricon.c:2390

Referenced by DoAppSwitch(), and SwitchWndProc_common().

◆ DoAppSwitch()

LRESULT WINAPI DoAppSwitch ( WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 627 of file appswitch.c.

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}
static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
Definition: appswitch.c:310
static void MoveLeft(void)
Definition: appswitch.c:570
static void MoveUp(void)
Definition: appswitch.c:584
void ProcessMouseMessage(UINT message, LPARAM lParam)
Definition: appswitch.c:320
static void MoveRight(void)
Definition: appswitch.c:578
void CompleteSwitch(BOOL doSwitch)
Definition: appswitch.c:156
DWORD GetDialogFont(VOID)
Definition: appswitch.c:461
void RotateTasks(BOOL bShift)
Definition: appswitch.c:533
static void LoadCoolSwitchSettings(void)
Definition: appswitch.c:98
BOOL ProcessHotKey(VOID)
Definition: appswitch.c:498
BOOL CoolSwitch
Definition: appswitch.c:67
VOID DestroyAppWindows(VOID)
Definition: appswitch.c:615
static void MoveDown(void)
Definition: appswitch.c:599
BOOL Esc
Definition: appswitch.c:64
#define msg(x)
Definition: auth_time.c:54
LPARAM lParam
Definition: combotst.c:139
static void Exit(void)
Definition: sock.c:1330
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define HIWORD(l)
Definition: typedefs.h:247
HWND WINAPI SetCapture(_In_ HWND hWnd)
HWND WINAPI GetActiveWindow(void)
Definition: winpos.c:138
#define VK_TAB
Definition: winuser.h:2210
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define WM_KEYUP
Definition: winuser.h:1727
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define KF_ALTDOWN
Definition: winuser.h:2460
#define VK_UP
Definition: winuser.h:2236
BOOL WINAPI CallMsgFilterW(_In_ LPMSG, _In_ INT)
#define VK_RETURN
Definition: winuser.h:2212
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
#define PM_REMOVE
Definition: winuser.h:1207
BOOL WINAPI WaitMessage(void)
Definition: ntwrapper.h:350
#define WM_LBUTTONUP
Definition: winuser.h:1788
#define VK_LEFT
Definition: winuser.h:2235
#define VK_RIGHT
Definition: winuser.h:2237
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define VK_DOWN
Definition: winuser.h:2238
#define VK_SHIFT
Definition: winuser.h:2213
SHORT WINAPI GetAsyncKeyState(_In_ int)
#define VK_ESCAPE
Definition: winuser.h:2225
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PM_NOREMOVE
Definition: winuser.h:1206
#define WM_SYSKEYDOWN
Definition: winuser.h:1730
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2215

Referenced by DefWndHandleSysCommand().

◆ EnumerateCallback()

BOOL CALLBACK EnumerateCallback ( HWND  window,
LPARAM  lParam 
)

Definition at line 187 of file appswitch.c.

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}
#define ICON_TIMEOUT
#define MAX_WINDOWS
Definition: appswitch.c:39
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:182
PSERVERINFO gpsi
Definition: imm.c:18
static HICON
Definition: imagelist.c:80
static IHTMLWindow2 * window
Definition: events.c:77
HICON hIcon
Definition: msconfig.c:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329
#define ICON_BIG
Definition: tnclass.cpp:51
LONG_PTR LRESULT
Definition: windef.h:209
#define SMTO_BLOCK
Definition: winuser.h:1235
HICON WINAPI CopyIcon(_In_ HICON)
Definition: cursoricon.c:2348
LRESULT WINAPI SendMessageTimeoutW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ UINT, _In_ UINT, _Out_opt_ PDWORD_PTR)
#define GetClassLongPtrW
Definition: winuser.h:4575
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1234
#define GCL_HICON
Definition: winuser.h:674

Referenced by EnumWindowsProc().

◆ EnumWindowsProc()

static BOOL CALLBACK EnumWindowsProc ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 310 of file appswitch.c.

311{
312 if (IsAltTabWindow(hwnd))
313 {
315 return FALSE;
316 }
317 return TRUE;
318}
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
Definition: appswitch.c:187
BOOL IsAltTabWindow(HWND hwnd)
Definition: appswitch.c:260

Referenced by DoAppSwitch(), and ProcessHotKey().

◆ GetDialogFont()

DWORD GetDialogFont ( VOID  )

Definition at line 461 of file appswitch.c.

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}
int fontHeight
Definition: appswitch.c:47
HFONT dialogFont
Definition: appswitch.c:43
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
Definition: time.h:68
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
#define GetTextMetrics
Definition: wingdi.h:4474
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by DoAppSwitch().

◆ GetNiceRootOwner()

static HWND GetNiceRootOwner ( HWND  hwnd)
static

Definition at line 234 of file appswitch.c.

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}
const DWORD ExStyle
Definition: appswitch.c:74
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GW_OWNER
Definition: winuser.h:777
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define GetWindowLong
Definition: winuser.h:5816
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define GWL_EXSTYLE
Definition: winuser.h:862

Referenced by IsAltTabWindow().

◆ GetRegInt()

static int GetRegInt ( HKEY  hKey,
PCWSTR  Name,
int  DefVal 
)
static

Definition at line 76 of file appswitch.c.

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}
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSTR Name
Definition: desk.c:124
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
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define REG_SZ
Definition: layer.c:22
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define REG_BINARY
Definition: nt_native.h:1496
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define UNICODE_NULL
#define err(...)
#define REG_DWORD
Definition: sdbapi.c:596
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193

Referenced by LoadCoolSwitchSettings().

◆ IsAltTabWindow()

BOOL IsAltTabWindow ( HWND  hwnd)

Definition at line 260 of file appswitch.c.

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}
static HWND GetNiceRootOwner(HWND hwnd)
Definition: appswitch.c:234
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetLastActivePopup(_In_ HWND)
#define WS_EX_NOACTIVATE
Definition: winuser.h:395
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)

Referenced by EnumWindowsProc().

◆ LoadCoolSwitchSettings()

static void LoadCoolSwitchSettings ( void  )
static

Definition at line 98 of file appswitch.c.

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}
BOOL SettingsLoaded
Definition: appswitch.c:70
int CoolSwitchColumns
Definition: appswitch.c:69
static int GetRegInt(HKEY hKey, PCWSTR Name, int DefVal)
Definition: appswitch.c:76
int CoolSwitchRows
Definition: appswitch.c:68
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
#define DBG(x)
Definition: moztest.c:12
#define KEY_READ
Definition: nt_native.h:1023
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define VK_SCROLL
Definition: winuser.h:2291

Referenced by DoAppSwitch().

◆ MoveDown()

static void MoveDown ( void  )
static

Definition at line 599 of file appswitch.c.

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}
int nRows
Definition: appswitch.c:56
int nCols
Definition: appswitch.c:56
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by DoAppSwitch().

◆ MoveLeft()

static void MoveLeft ( void  )
static

Definition at line 570 of file appswitch.c.

Referenced by DoAppSwitch().

◆ MoveRight()

static void MoveRight ( void  )
static

Definition at line 578 of file appswitch.c.

Referenced by DoAppSwitch().

◆ MoveUp()

static void MoveUp ( void  )
static

Definition at line 584 of file appswitch.c.

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}

Referenced by DoAppSwitch().

◆ OnPaint()

void OnPaint ( HWND  hWnd)

Definition at line 347 of file appswitch.c.

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}
int nItems
Definition: appswitch.c:56
#define ITEM_MARGIN
Definition: appswitch.c:30
#define CX_ITEM
Definition: appswitch.c:28
#define CX_ITEM_SPACE
Definition: appswitch.c:32
#define DIALOG_MARGIN
Definition: appswitch.c:22
#define CY_ITEM_SPACE
Definition: appswitch.c:33
int totalH
Definition: appswitch.c:58
int itemsH
Definition: appswitch.c:57
int nShift
Definition: appswitch.c:62
#define ICON_MARGIN
Definition: appswitch.c:26
int totalW
Definition: appswitch.c:58
#define CY_ITEM
Definition: appswitch.c:29
#define CX_ICON
Definition: appswitch.c:24
#define CY_ICON
Definition: appswitch.c:25
int itemsW
Definition: appswitch.c:57
HWND hWnd
Definition: settings.c:17
pKey DeleteObject()
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
DWORD COLORREF
Definition: windef.h:300
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 PS_SOLID
Definition: wingdi.h:586
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_BTNTEXT
Definition: winuser.h:944
#define DT_CENTER
Definition: winuser.h:527
#define DT_END_ELLIPSIS
Definition: winuser.h:529
#define DFCS_BUTTONPUSH
Definition: winuser.h:501
BOOL WINAPI DrawFrameControl(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define COLOR_HIGHLIGHT
Definition: winuser.h:937
#define DT_SINGLELINE
Definition: winuser.h:540
#define DFC_BUTTON
Definition: winuser.h:476
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
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 DT_VCENTER
Definition: winuser.h:543
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define DFCS_PUSHED
Definition: winuser.h:503
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define COLOR_3DFACE
Definition: winuser.h:940

Referenced by SwitchWndProc_common().

◆ PrepareWindow()

void PrepareWindow ( VOID  )

Definition at line 476 of file appswitch.c.

477{
479
482 if (nRows > CoolSwitchRows)
483 {
485 nItems = nRows * nCols;
486 }
487
490
494
496}
void ResizeAndCenter(HWND hwnd, int width, int height)
Definition: appswitch.c:132
#define CY_TEXT_MARGIN
Definition: appswitch.c:35

Referenced by SwitchWndProc_common().

◆ ProcessHotKey()

BOOL ProcessHotKey ( VOID  )

Definition at line 498 of file appswitch.c.

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}
DWORD CreateSwitcherWindow(HINSTANCE hInstance)
Definition: appswitch.c:440
HINSTANCE User32Instance
Definition: dllmain.c:27
#define SW_SHOWNORMAL
Definition: winuser.h:781

Referenced by DoAppSwitch().

◆ ProcessMouseMessage()

void ProcessMouseMessage ( UINT  message,
LPARAM  lParam 
)

Definition at line 320 of file appswitch.c.

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}
#define LOWORD(l)
Definition: pedump.c:82
Definition: tftpd.h:60
#define WM_MOUSEMOVE
Definition: winuser.h:1786

Referenced by DoAppSwitch(), and SwitchWndProc_common().

◆ ResizeAndCenter()

void ResizeAndCenter ( HWND  hwnd,
int  width,
int  height 
)

Definition at line 132 of file appswitch.c.

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}
const DWORD Style
Definition: appswitch.c:73
POINT ptStart
Definition: appswitch.c:60
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
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
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define SM_CYSCREEN
Definition: winuser.h:971
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define SM_CXSCREEN
Definition: winuser.h:970
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)

Referenced by PrepareWindow().

◆ RotateTasks()

void RotateTasks ( BOOL  bShift)

Definition at line 533 of file appswitch.c.

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}
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define MoveMemory
Definition: winbase.h:1741
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SWP_NOREPOSITION
Definition: winuser.h:1261
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SWP_NOSIZE
Definition: winuser.h:1256
#define SWP_ASYNCWINDOWPOS
Definition: winuser.h:1264
#define HWND_TOP
Definition: winuser.h:1218
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260

Referenced by DoAppSwitch().

◆ SwitchWndProc_common()

LRESULT WINAPI SwitchWndProc_common ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL  unicode 
)

Definition at line 790 of file appswitch.c.

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 {
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}
void OnPaint(HWND hWnd)
Definition: appswitch.c:347
void PrepareWindow(VOID)
Definition: appswitch.c:476
WPARAM wParam
Definition: combotst.c:138
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define ValidateHwnd(hwnd)
Definition: precomp.h:110
#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
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
Definition: ntuser.h:694
DWORD fnid
Definition: ntuser.h:709
DWORD cbSize
Definition: winuser.h:3708
POINT ptStart
Definition: winuser.h:3716
#define WM_PAINT
Definition: winuser.h:1631
#define GetWindowLongPtrW
Definition: winuser.h:4840
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WA_INACTIVE
Definition: winuser.h:2633
#define WM_NCCREATE
Definition: winuser.h:1694
#define WM_ACTIVATE
Definition: winuser.h:1623
#define WM_SHOWWINDOW
Definition: winuser.h:1639
#define WM_DESTROY
Definition: winuser.h:1620
struct tagALTTABINFO * PALTTABINFO
#define SetWindowLongPtrW
Definition: winuser.h:5366
struct tagALTTABINFO ALTTABINFO

Referenced by SwitchWndProcA(), and SwitchWndProcW().

◆ SwitchWndProcA()

LRESULT WINAPI SwitchWndProcA ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 863 of file appswitch.c.

864{
866}
LRESULT WINAPI SwitchWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: appswitch.c:790

Referenced by RegisterClientPFN().

◆ SwitchWndProcW()

LRESULT WINAPI SwitchWndProcW ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 868 of file appswitch.c.

869{
870 return SwitchWndProc_common(hWnd, uMsg, wParam, lParam, TRUE);
871}

Referenced by RegisterClientPFN().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )

Variable Documentation

◆ CoolSwitch

BOOL CoolSwitch = TRUE

Definition at line 67 of file appswitch.c.

Referenced by DoAppSwitch(), and LoadCoolSwitchSettings().

◆ CoolSwitchColumns

int CoolSwitchColumns = DefSwitchColumns

Definition at line 69 of file appswitch.c.

Referenced by LoadCoolSwitchSettings(), OnPaint(), and PrepareWindow().

◆ CoolSwitchRows

int CoolSwitchRows = DefSwitchRows

Definition at line 68 of file appswitch.c.

Referenced by LoadCoolSwitchSettings(), and PrepareWindow().

◆ cxBorder

int cxBorder

Definition at line 55 of file appswitch.c.

Referenced by C1_DrawDragBorder(), and T1_DrawDragBorder().

◆ cyBorder

int cyBorder

Definition at line 55 of file appswitch.c.

Referenced by C1_DrawDragBorder(), and T1_DrawDragBorder().

◆ dialogFont

HFONT dialogFont

Definition at line 43 of file appswitch.c.

Referenced by GetDialogFont(), and OnPaint().

◆ Esc

BOOL Esc = FALSE

Definition at line 64 of file appswitch.c.

Referenced by DoAppSwitch(), and RotateTasks().

◆ ExStyle

◆ fontHeight

int fontHeight =0

Definition at line 47 of file appswitch.c.

Referenced by add_font(), GetDialogFont(), PrepareWindow(), and realize_font().

◆ iconList

HICON iconList[MAX_WINDOWS]

Definition at line 52 of file appswitch.c.

Referenced by DestroyAppWindows(), EnumerateCallback(), and OnPaint().

◆ isOpen

BOOL isOpen = FALSE

◆ itemsH

int itemsH

Definition at line 57 of file appswitch.c.

Referenced by OnPaint(), and PrepareWindow().

◆ itemsW

int itemsW

Definition at line 57 of file appswitch.c.

Referenced by OnPaint(), and PrepareWindow().

◆ nCols

◆ nItems

◆ nRows

◆ nShift

int nShift = 0

Definition at line 62 of file appswitch.c.

Referenced by OnPaint(), and SwitchWndProc_common().

◆ ptStart

◆ selectedWindow

◆ SettingsLoaded

BOOL SettingsLoaded = FALSE

Definition at line 70 of file appswitch.c.

Referenced by LoadCoolSwitchSettings().

◆ Style

◆ switchdialog

◆ totalH

int totalH

Definition at line 58 of file appswitch.c.

Referenced by OnPaint(), and PrepareWindow().

◆ totalW

int totalW

Definition at line 58 of file appswitch.c.

Referenced by OnPaint(), and PrepareWindow().

◆ windowCount

◆ windowList

HWND windowList[MAX_WINDOWS]

Definition at line 51 of file appswitch.c.

Referenced by CompleteSwitch(), EnumerateCallback(), OnPaint(), ProcessHotKey(), and RotateTasks().

◆ windowText

◆ xOffset

◆ yOffset