ReactOS 0.4.16-dev-1305-ge26ad0d
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 23 of file appswitch.c.

◆ CX_ITEM

#define CX_ITEM   (CX_ICON + 2 * ICON_MARGIN)

Definition at line 27 of file appswitch.c.

◆ CX_ITEM_SPACE

#define CX_ITEM_SPACE   (CX_ITEM + 2 * ITEM_MARGIN)

Definition at line 31 of file appswitch.c.

◆ CY_ICON

#define CY_ICON   32

Definition at line 24 of file appswitch.c.

◆ CY_ITEM

#define CY_ITEM   (CY_ICON + 2 * ICON_MARGIN)

Definition at line 28 of file appswitch.c.

◆ CY_ITEM_SPACE

#define CY_ITEM_SPACE   (CY_ITEM + 2 * ITEM_MARGIN)

Definition at line 32 of file appswitch.c.

◆ CY_TEXT_MARGIN

#define CY_TEXT_MARGIN   4

Definition at line 34 of file appswitch.c.

◆ DIALOG_MARGIN

#define DIALOG_MARGIN   8

Definition at line 21 of file appswitch.c.

◆ ICON_MARGIN

#define ICON_MARGIN   4

Definition at line 25 of file appswitch.c.

◆ ICON_TIMEOUT

#define ICON_TIMEOUT   100

◆ ITEM_MARGIN

#define ITEM_MARGIN   4

Definition at line 29 of file appswitch.c.

◆ MAX_WINDOWS

#define MAX_WINDOWS   120

Definition at line 38 of file appswitch.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DefSwitchRows 
DefSwitchColumns 

Definition at line 65 of file appswitch.c.

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

Function Documentation

◆ CompleteSwitch()

void CompleteSwitch ( BOOL  doSwitch)

Definition at line 155 of file appswitch.c.

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}
WCHAR windowText[1024]
Definition: appswitch.c:48
HWND windowList[MAX_WINDOWS]
Definition: appswitch.c:50
int windowCount
Definition: appswitch.c:52
BOOL isOpen
Definition: appswitch.c:44
HWND switchdialog
Definition: appswitch.c:41
int selectedWindow
Definition: appswitch.c:43
#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 444 of file appswitch.c.

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}
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:14
#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 619 of file appswitch.c.

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}
HICON iconList[MAX_WINDOWS]
Definition: appswitch.c:51
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 631 of file appswitch.c.

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}
static BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
Definition: appswitch.c:314
static void MoveLeft(void)
Definition: appswitch.c:574
static void MoveUp(void)
Definition: appswitch.c:588
void ProcessMouseMessage(UINT message, LPARAM lParam)
Definition: appswitch.c:324
static void MoveRight(void)
Definition: appswitch.c:582
void CompleteSwitch(BOOL doSwitch)
Definition: appswitch.c:155
DWORD GetDialogFont(VOID)
Definition: appswitch.c:465
void RotateTasks(BOOL bShift)
Definition: appswitch.c:537
static void LoadCoolSwitchSettings(void)
Definition: appswitch.c:97
BOOL ProcessHotKey(VOID)
Definition: appswitch.c:502
BOOL CoolSwitch
Definition: appswitch.c:66
VOID DestroyAppWindows(VOID)
Definition: appswitch.c:619
static void MoveDown(void)
Definition: appswitch.c:603
BOOL Esc
Definition: appswitch.c:63
#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:2218
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define WM_KEYUP
Definition: winuser.h:1735
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define KF_ALTDOWN
Definition: winuser.h:2468
#define VK_UP
Definition: winuser.h:2244
BOOL WINAPI CallMsgFilterW(_In_ LPMSG, _In_ INT)
#define VK_RETURN
Definition: winuser.h:2220
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:1796
#define VK_LEFT
Definition: winuser.h:2243
#define VK_RIGHT
Definition: winuser.h:2245
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define VK_DOWN
Definition: winuser.h:2246
#define VK_SHIFT
Definition: winuser.h:2221
SHORT WINAPI GetAsyncKeyState(_In_ int)
#define VK_ESCAPE
Definition: winuser.h:2233
BOOL WINAPI DestroyWindow(_In_ HWND)
#define PM_NOREMOVE
Definition: winuser.h:1206
#define WM_SYSKEYDOWN
Definition: winuser.h:1738
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2223

Referenced by DefWndHandleSysCommand().

◆ EnumerateCallback()

BOOL CALLBACK EnumerateCallback ( HWND  window,
LPARAM  lParam 
)

Definition at line 186 of file appswitch.c.

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}
#define ICON_TIMEOUT
#define MAX_WINDOWS
Definition: appswitch.c:38
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:4640
#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 314 of file appswitch.c.

315{
316 if (IsAltTabWindow(hwnd))
317 {
319 return FALSE;
320 }
321 return TRUE;
322}
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
Definition: appswitch.c:186
BOOL IsAltTabWindow(HWND hwnd)
Definition: appswitch.c:259

Referenced by DoAppSwitch(), and ProcessHotKey().

◆ GetDialogFont()

DWORD GetDialogFont ( VOID  )

Definition at line 465 of file appswitch.c.

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}
int fontHeight
Definition: appswitch.c:46
HFONT dialogFont
Definition: appswitch.c:42
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 233 of file appswitch.c.

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}
const DWORD ExStyle
Definition: appswitch.c:73
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:5881
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 75 of file appswitch.c.

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}
#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 259 of file appswitch.c.

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}
static HWND GetNiceRootOwner(HWND hwnd)
Definition: appswitch.c:233
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define GetWindowLongPtrW
Definition: winuser.h:4905
#define CS_IME
Definition: winuser.h:667
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)
#define GCL_STYLE
Definition: winuser.h:678

Referenced by EnumWindowsProc().

◆ LoadCoolSwitchSettings()

static void LoadCoolSwitchSettings ( void  )
static

Definition at line 97 of file appswitch.c.

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}
BOOL SettingsLoaded
Definition: appswitch.c:69
int CoolSwitchColumns
Definition: appswitch.c:68
static int GetRegInt(HKEY hKey, PCWSTR Name, int DefVal)
Definition: appswitch.c:75
int CoolSwitchRows
Definition: appswitch.c:67
#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:2299

Referenced by DoAppSwitch().

◆ MoveDown()

static void MoveDown ( void  )
static

Definition at line 603 of file appswitch.c.

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

Referenced by DoAppSwitch().

◆ MoveLeft()

static void MoveLeft ( void  )
static

Definition at line 574 of file appswitch.c.

Referenced by DoAppSwitch().

◆ MoveRight()

static void MoveRight ( void  )
static

Definition at line 582 of file appswitch.c.

Referenced by DoAppSwitch().

◆ MoveUp()

static void MoveUp ( void  )
static

Definition at line 588 of file appswitch.c.

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}

Referenced by DoAppSwitch().

◆ OnPaint()

void OnPaint ( HWND  hWnd)

Definition at line 351 of file appswitch.c.

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}
int nItems
Definition: appswitch.c:55
#define ITEM_MARGIN
Definition: appswitch.c:29
#define CX_ITEM
Definition: appswitch.c:27
#define CX_ITEM_SPACE
Definition: appswitch.c:31
#define DIALOG_MARGIN
Definition: appswitch.c:21
#define CY_ITEM_SPACE
Definition: appswitch.c:32
int totalH
Definition: appswitch.c:57
int itemsH
Definition: appswitch.c:56
int nShift
Definition: appswitch.c:61
#define ICON_MARGIN
Definition: appswitch.c:25
int totalW
Definition: appswitch.c:57
#define CY_ITEM
Definition: appswitch.c:28
#define CX_ICON
Definition: appswitch.c:23
#define CY_ICON
Definition: appswitch.c:24
int itemsW
Definition: appswitch.c:56
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 480 of file appswitch.c.

481{
483
486 if (nRows > CoolSwitchRows)
487 {
489 nItems = nRows * nCols;
490 }
491
494
498
500}
void ResizeAndCenter(HWND hwnd, int width, int height)
Definition: appswitch.c:131
#define CY_TEXT_MARGIN
Definition: appswitch.c:34

Referenced by SwitchWndProc_common().

◆ ProcessHotKey()

BOOL ProcessHotKey ( VOID  )

Definition at line 502 of file appswitch.c.

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}
DWORD CreateSwitcherWindow(HINSTANCE hInstance)
Definition: appswitch.c:444
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 324 of file appswitch.c.

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

Referenced by DoAppSwitch(), and SwitchWndProc_common().

◆ ResizeAndCenter()

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

Definition at line 131 of file appswitch.c.

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}
const DWORD Style
Definition: appswitch.c:72
POINT ptStart
Definition: appswitch.c:59
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 537 of file appswitch.c.

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}
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define MoveMemory
Definition: winbase.h:1750
#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 794 of file appswitch.c.

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 {
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}
void OnPaint(HWND hWnd)
Definition: appswitch.c:351
void PrepareWindow(VOID)
Definition: appswitch.c:480
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 FNID_SWITCH
Definition: ntuser.h:865
#define FNID_DESTROY
Definition: ntuser.h:898
BOOL NTAPI NtUserSetWindowFNID(HWND hWnd, WORD fnID)
Definition: window.c:4348
Definition: ntuser.h:694
DWORD fnid
Definition: ntuser.h:709
DWORD cbSize
Definition: winuser.h:3773
POINT ptStart
Definition: winuser.h:3781
#define ValidateHwnd(hwnd)
Definition: precomp.h:101
#define WM_PAINT
Definition: winuser.h:1639
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WA_INACTIVE
Definition: winuser.h:2641
#define WM_NCCREATE
Definition: winuser.h:1702
#define WM_ACTIVATE
Definition: winuser.h:1631
#define WM_SHOWWINDOW
Definition: winuser.h:1647
#define WM_DESTROY
Definition: winuser.h:1628
struct tagALTTABINFO * PALTTABINFO
#define SetWindowLongPtrW
Definition: winuser.h:5431
struct tagALTTABINFO ALTTABINFO

Referenced by SwitchWndProcA(), and SwitchWndProcW().

◆ SwitchWndProcA()

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

Definition at line 867 of file appswitch.c.

868{
870}
LRESULT WINAPI SwitchWndProc_common(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL unicode)
Definition: appswitch.c:794

Referenced by RegisterClientPFN().

◆ SwitchWndProcW()

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

Definition at line 872 of file appswitch.c.

873{
874 return SwitchWndProc_common(hWnd, uMsg, wParam, lParam, TRUE);
875}

Referenced by RegisterClientPFN().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )

Variable Documentation

◆ CoolSwitch

BOOL CoolSwitch = TRUE

Definition at line 66 of file appswitch.c.

Referenced by DoAppSwitch(), and LoadCoolSwitchSettings().

◆ CoolSwitchColumns

int CoolSwitchColumns = DefSwitchColumns

Definition at line 68 of file appswitch.c.

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

◆ CoolSwitchRows

int CoolSwitchRows = DefSwitchRows

Definition at line 67 of file appswitch.c.

Referenced by LoadCoolSwitchSettings(), and PrepareWindow().

◆ cxBorder

int cxBorder

Definition at line 54 of file appswitch.c.

Referenced by C1_DrawDragBorder(), and T1_DrawDragBorder().

◆ cyBorder

int cyBorder

Definition at line 54 of file appswitch.c.

Referenced by C1_DrawDragBorder(), and T1_DrawDragBorder().

◆ dialogFont

HFONT dialogFont

Definition at line 42 of file appswitch.c.

Referenced by GetDialogFont(), and OnPaint().

◆ Esc

BOOL Esc = FALSE

Definition at line 63 of file appswitch.c.

Referenced by DoAppSwitch(), and RotateTasks().

◆ ExStyle

◆ fontHeight

int fontHeight =0

Definition at line 46 of file appswitch.c.

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

◆ iconList

HICON iconList[MAX_WINDOWS]

Definition at line 51 of file appswitch.c.

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

◆ isOpen

BOOL isOpen = FALSE

◆ itemsH

int itemsH

Definition at line 56 of file appswitch.c.

Referenced by OnPaint(), and PrepareWindow().

◆ itemsW

int itemsW

Definition at line 56 of file appswitch.c.

Referenced by OnPaint(), and PrepareWindow().

◆ nCols

◆ nItems

◆ nRows

◆ nShift

int nShift = 0

Definition at line 61 of file appswitch.c.

Referenced by OnPaint(), and SwitchWndProc_common().

◆ ptStart

◆ selectedWindow

◆ SettingsLoaded

BOOL SettingsLoaded = FALSE

Definition at line 69 of file appswitch.c.

Referenced by LoadCoolSwitchSettings().

◆ Style

◆ switchdialog

◆ totalH

int totalH

Definition at line 57 of file appswitch.c.

Referenced by OnPaint(), and PrepareWindow().

◆ totalW

int totalW

Definition at line 57 of file appswitch.c.

Referenced by OnPaint(), and PrepareWindow().

◆ windowCount

◆ windowList

HWND windowList[MAX_WINDOWS]

Definition at line 50 of file appswitch.c.

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

◆ windowText

◆ xOffset

◆ yOffset