ReactOS 0.4.16-dev-1386-g6ed46ba
taskswnd.cpp File Reference
#include "precomp.h"
#include <commoncontrols.h>
#include <regstr.h>
#include <shlwapi_undoc.h>
Include dependency graph for taskswnd.cpp:

Go to the source code of this file.

Classes

struct  _TASK_GROUP
 
struct  _TASK_ITEM
 
class  CHardErrorThread
 
class  CTaskToolbar
 
class  CTaskSwitchWnd
 
struct  CTaskSwitchWnd::tagRUDEAPPDATA
 
struct  CTaskSwitchWnd::tagFULLSCREENDATA
 

Macros

#define DUMP_TASKS   0
 
#define DEBUG_SHELL_HOOK   0
 
#define MAX_TASKS_COUNT   (0x7FFF)
 
#define TASK_ITEM_ARRAY_ALLOC   64
 
#define TIMER_ID_VALIDATE_RUDE_APP   5
 
#define VALIDATE_RUDE_INTERVAL   1000
 
#define VALIDATE_RUDE_MAX_COUNT   5
 
#define GET_ICON(type)    SendMessageTimeout(hwnd, WM_GETICON, (type), 0, SMTO_NOTIMEOUTIFNOTHUNG, 100, (PDWORD_PTR)&hIcon)
 

Typedefs

typedef struct _TASK_GROUP TASK_GROUP
 
typedef struct _TASK_GROUPPTASK_GROUP
 
typedef struct _TASK_ITEM TASK_ITEM
 
typedef struct _TASK_ITEMPTASK_ITEM
 

Functions

static BOOL SHELL_GetMonitorRect (_In_opt_ HMONITOR hMonitor, _Out_opt_ PRECT prcDest, _In_ BOOL bWorkAreaOnly)
 
static BOOL SHELL_IsParentOwnerOrSelf (_In_ HWND hwndTarget, _In_ HWND hWnd)
 
static BOOL SHELL_IsRudeWindowActive (_In_ HWND hWnd)
 
static BOOL SHELL_IsRudeWindow (_In_opt_ HMONITOR hMonitor, _In_ HWND hWnd, _In_ BOOL bDontCheckActive)
 
HRESULT CTaskSwitchWnd_CreateInstance (IN HWND hWndParent, IN OUT ITrayWindow *Tray, REFIID riid, void **ppv)
 

Variables

const WCHAR szTaskSwitchWndClass [] = L"MSTaskSwWClass"
 
const WCHAR szRunningApps [] = L"Running Applications"
 

Macro Definition Documentation

◆ DEBUG_SHELL_HOOK

#define DEBUG_SHELL_HOOK   0

Definition at line 29 of file taskswnd.cpp.

◆ DUMP_TASKS

#define DUMP_TASKS   0

Definition at line 28 of file taskswnd.cpp.

◆ GET_ICON

#define GET_ICON (   type)     SendMessageTimeout(hwnd, WM_GETICON, (type), 0, SMTO_NOTIMEOUTIFNOTHUNG, 100, (PDWORD_PTR)&hIcon)

◆ MAX_TASKS_COUNT

#define MAX_TASKS_COUNT   (0x7FFF)

Definition at line 31 of file taskswnd.cpp.

◆ TASK_ITEM_ARRAY_ALLOC

#define TASK_ITEM_ARRAY_ALLOC   64

Definition at line 32 of file taskswnd.cpp.

◆ TIMER_ID_VALIDATE_RUDE_APP

#define TIMER_ID_VALIDATE_RUDE_APP   5

Definition at line 37 of file taskswnd.cpp.

◆ VALIDATE_RUDE_INTERVAL

#define VALIDATE_RUDE_INTERVAL   1000

Definition at line 38 of file taskswnd.cpp.

◆ VALIDATE_RUDE_MAX_COUNT

#define VALIDATE_RUDE_MAX_COUNT   5

Definition at line 39 of file taskswnd.cpp.

Typedef Documentation

◆ PTASK_GROUP

◆ PTASK_ITEM

◆ TASK_GROUP

◆ TASK_ITEM

Function Documentation

◆ CTaskSwitchWnd_CreateInstance()

HRESULT CTaskSwitchWnd_CreateInstance ( IN HWND  hWndParent,
IN OUT ITrayWindow *  Tray,
REFIID  riid,
void **  ppv 
)

Definition at line 2290 of file taskswnd.cpp.

2291{
2292 return ShellObjectCreatorInit<CTaskSwitchWnd>(hWndParent, Tray, riid, ppv);
2293}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

Referenced by CTaskBand::SetSite().

◆ SHELL_GetMonitorRect()

static BOOL SHELL_GetMonitorRect ( _In_opt_ HMONITOR  hMonitor,
_Out_opt_ PRECT  prcDest,
_In_ BOOL  bWorkAreaOnly 
)
static

Definition at line 42 of file taskswnd.cpp.

46{
47 MONITORINFO mi = { sizeof(mi) };
48 if (!hMonitor || !::GetMonitorInfoW(hMonitor, &mi))
49 {
50 if (!prcDest)
51 return FALSE;
52
53 if (bWorkAreaOnly)
54 ::SystemParametersInfoW(SPI_GETWORKAREA, 0, prcDest, 0);
55 else
56 ::SetRect(prcDest, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
57
58 return FALSE;
59 }
60
61 if (prcDest)
62 *prcDest = (bWorkAreaOnly ? mi.rcWork : mi.rcMonitor);
63 return TRUE;
64}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static MONITORINFO mi
Definition: win.c:7338
RECT rcMonitor
Definition: winuser.h:3861
#define SM_CYSCREEN
Definition: winuser.h:971
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define SM_CXSCREEN
Definition: winuser.h:970
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
int WINAPI GetSystemMetrics(_In_ int)

Referenced by CTaskSwitchWnd::FullScreenEnumProc(), and SHELL_IsRudeWindow().

◆ SHELL_IsParentOwnerOrSelf()

static BOOL SHELL_IsParentOwnerOrSelf ( _In_ HWND  hwndTarget,
_In_ HWND  hWnd 
)
static

Definition at line 67 of file taskswnd.cpp.

68{
69 for (; hWnd; hWnd = ::GetParent(hWnd))
70 {
71 if (hWnd == hwndTarget)
72 return TRUE;
73 }
74 return FALSE;
75}
HWND hWnd
Definition: settings.c:17
HWND WINAPI GetParent(_In_ HWND)

Referenced by SHELL_IsRudeWindowActive().

◆ SHELL_IsRudeWindow()

static BOOL SHELL_IsRudeWindow ( _In_opt_ HMONITOR  hMonitor,
_In_ HWND  hWnd,
_In_ BOOL  bDontCheckActive 
)
static

Definition at line 87 of file taskswnd.cpp.

88{
90 return FALSE;
91
92 RECT rcMonitor;
93 SHELL_GetMonitorRect(hMonitor, &rcMonitor, FALSE);
94
96
97 RECT rcWnd;
98 enum { CHECK_STYLE = WS_THICKFRAME | WS_DLGFRAME | WS_BORDER };
99 if ((style & CHECK_STYLE) == CHECK_STYLE)
100 {
101 ::GetClientRect(hWnd, &rcWnd); // Ignore frame
102 ::MapWindowPoints(hWnd, NULL, (PPOINT)&rcWnd, sizeof(RECT) / sizeof(POINT));
103 }
104 else
105 {
106 ::GetWindowRect(hWnd, &rcWnd);
107 }
108
109 RECT rcUnion;
110 ::UnionRect(&rcUnion, &rcWnd, &rcMonitor);
111
112 return ::EqualRect(&rcUnion, &rcWnd) && (bDontCheckActive || SHELL_IsRudeWindowActive(hWnd));
113}
Arabic default style
Definition: afstyles.h:94
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_BORDER
Definition: pedump.c:625
#define WS_DLGFRAME
Definition: pedump.c:626
#define WS_THICKFRAME
Definition: pedump.c:630
static BOOL SHELL_IsRudeWindowActive(_In_ HWND hWnd)
Definition: taskswnd.cpp:78
static BOOL SHELL_GetMonitorRect(_In_opt_ HMONITOR hMonitor, _Out_opt_ PRECT prcDest, _In_ BOOL bWorkAreaOnly)
Definition: taskswnd.cpp:42
#define GetWindowLongPtrW
Definition: winuser.h:4905
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI UnionRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define GWL_STYLE
Definition: winuser.h:863
BOOL WINAPI IsWindowVisible(_In_ HWND)

Referenced by CTaskSwitchWnd::IsRudeEnumProc().

◆ SHELL_IsRudeWindowActive()

static BOOL SHELL_IsRudeWindowActive ( _In_ HWND  hWnd)
static

Definition at line 78 of file taskswnd.cpp.

79{
80 HWND hwndFore = ::GetForegroundWindow();
82 return dwThreadId == ::GetWindowThreadProcessId(hwndFore, NULL) ||
84}
DWORD dwThreadId
Definition: fdebug.c:31
static BOOL SHELL_IsParentOwnerOrSelf(_In_ HWND hwndTarget, _In_ HWND hWnd)
Definition: taskswnd.cpp:67
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392

Referenced by CTaskSwitchWnd::HandleFullScreenApp(), and SHELL_IsRudeWindow().

Variable Documentation

◆ szRunningApps

const WCHAR szRunningApps[] = L"Running Applications"

Definition at line 118 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd::Initialize().

◆ szTaskSwitchWndClass

const WCHAR szTaskSwitchWndClass[] = L"MSTaskSwWClass"

Definition at line 117 of file taskswnd.cpp.