ReactOS 0.4.17-dev-806-gffa4164
taskswnd.cpp File Reference
#include "precomp.h"
#include "mediabtns.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 18 of file taskswnd.cpp.

◆ DUMP_TASKS

#define DUMP_TASKS   0

Definition at line 17 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 20 of file taskswnd.cpp.

◆ TASK_ITEM_ARRAY_ALLOC

#define TASK_ITEM_ARRAY_ALLOC   64

Definition at line 21 of file taskswnd.cpp.

◆ TIMER_ID_VALIDATE_RUDE_APP

#define TIMER_ID_VALIDATE_RUDE_APP   5

Definition at line 26 of file taskswnd.cpp.

◆ VALIDATE_RUDE_INTERVAL

#define VALIDATE_RUDE_INTERVAL   1000

Definition at line 27 of file taskswnd.cpp.

◆ VALIDATE_RUDE_MAX_COUNT

#define VALIDATE_RUDE_MAX_COUNT   5

Definition at line 28 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 2301 of file taskswnd.cpp.

2302{
2303 return ShellObjectCreatorInit<CTaskSwitchWnd>(hWndParent, Tray, riid, ppv);
2304}
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 31 of file taskswnd.cpp.

35{
36 MONITORINFO mi = { sizeof(mi) };
37 if (!hMonitor || !::GetMonitorInfoW(hMonitor, &mi))
38 {
39 if (!prcDest)
40 return FALSE;
41
42 if (bWorkAreaOnly)
43 ::SystemParametersInfoW(SPI_GETWORKAREA, 0, prcDest, 0);
44 else
45 ::SetRect(prcDest, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
46
47 return FALSE;
48 }
49
50 if (prcDest)
51 *prcDest = (bWorkAreaOnly ? mi.rcWork : mi.rcMonitor);
52 return TRUE;
53}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static MONITORINFO mi
Definition: win.c:9400
RECT rcMonitor
Definition: winuser.h:3893
#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 56 of file taskswnd.cpp.

57{
58 for (; hWnd; hWnd = ::GetParent(hWnd))
59 {
60 if (hWnd == hwndTarget)
61 return TRUE;
62 }
63 return FALSE;
64}
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 76 of file taskswnd.cpp.

77{
79 return FALSE;
80
81 RECT rcMonitor;
82 SHELL_GetMonitorRect(hMonitor, &rcMonitor, FALSE);
83
85
86 RECT rcWnd;
87 enum { CHECK_STYLE = WS_THICKFRAME | WS_DLGFRAME | WS_BORDER };
88 if ((style & CHECK_STYLE) == CHECK_STYLE)
89 {
90 ::GetClientRect(hWnd, &rcWnd); // Ignore frame
91 ::MapWindowPoints(hWnd, NULL, (PPOINT)&rcWnd, sizeof(RECT) / sizeof(POINT));
92 }
93 else
94 {
95 ::GetWindowRect(hWnd, &rcWnd);
96 }
97
98 RECT rcUnion;
99 ::UnionRect(&rcUnion, &rcWnd, &rcMonitor);
100
101 return ::EqualRect(&rcUnion, &rcWnd) && (bDontCheckActive || SHELL_IsRudeWindowActive(hWnd));
102}
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:67
static BOOL SHELL_GetMonitorRect(_In_opt_ HMONITOR hMonitor, _Out_opt_ PRECT prcDest, _In_ BOOL bWorkAreaOnly)
Definition: taskswnd.cpp:31
#define GetWindowLongPtrW
Definition: winuser.h:4983
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 67 of file taskswnd.cpp.

68{
69 HWND hwndFore = ::GetForegroundWindow();
71 return dwThreadId == ::GetWindowThreadProcessId(hwndFore, NULL) ||
73}
DWORD dwThreadId
Definition: fdebug.c:31
static BOOL SHELL_IsParentOwnerOrSelf(_In_ HWND hwndTarget, _In_ HWND hWnd)
Definition: taskswnd.cpp:56
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 107 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd::Initialize().

◆ szTaskSwitchWndClass

const WCHAR szTaskSwitchWndClass[] = L"MSTaskSwWClass"

Definition at line 106 of file taskswnd.cpp.