ReactOS 0.4.16-dev-1025-gd3456f5
CTaskSwitchWnd Class Reference
Inheritance diagram for CTaskSwitchWnd:
Collaboration diagram for CTaskSwitchWnd:

Public Member Functions

 CTaskSwitchWnd ()
 
virtual ~CTaskSwitchWnd ()
 
INT GetWndTextFromTaskItem (IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
 
VOID UpdateIndexesAfter (IN INT iIndex, BOOL bInserted)
 
INT UpdateTaskGroupButton (IN PTASK_GROUP TaskGroup)
 
VOID ExpandTaskGroup (IN PTASK_GROUP TaskGroup)
 
HICON GetWndIcon (HWND hwnd)
 
INT UpdateTaskItemButton (IN PTASK_ITEM TaskItem)
 
VOID RemoveIcon (IN PTASK_ITEM TaskItem)
 
PTASK_ITEM FindLastTaskItemOfGroup (IN PTASK_GROUP TaskGroup OPTIONAL, IN PTASK_ITEM NewTaskItem OPTIONAL)
 
INT CalculateTaskItemNewButtonIndex (IN PTASK_ITEM TaskItem)
 
INT AddTaskItemButton (IN OUT PTASK_ITEM TaskItem)
 
BOOL DeleteTaskItemButton (IN OUT PTASK_ITEM TaskItem)
 
PTASK_GROUP AddToTaskGroup (IN HWND hWnd)
 
VOID RemoveTaskFromTaskGroup (IN OUT PTASK_ITEM TaskItem)
 
PTASK_ITEM FindTaskItem (IN HWND hWnd)
 
PTASK_ITEM FindOtherTaskItem (IN HWND hWnd)
 
PTASK_ITEM AllocTaskItem ()
 
VOID FreeTaskItem (IN OUT PTASK_ITEM TaskItem)
 
VOID DeleteTaskItem (IN OUT PTASK_ITEM TaskItem)
 
VOID CheckActivateTaskItem (IN OUT PTASK_ITEM TaskItem)
 
PTASK_ITEM FindTaskItemByIndex (IN INT Index)
 
PTASK_GROUP FindTaskGroupByIndex (IN INT Index)
 
BOOL AddTask (IN HWND hWnd)
 
BOOL ActivateTaskItem (IN OUT PTASK_ITEM TaskItem OPTIONAL)
 
BOOL ActivateTask (IN HWND hWnd)
 
BOOL DeleteTask (IN HWND hWnd)
 
VOID DeleteAllTasks ()
 
VOID FlashTaskItem (IN OUT PTASK_ITEM TaskItem)
 
BOOL FlashTask (IN HWND hWnd)
 
VOID RedrawTaskItem (IN OUT PTASK_ITEM TaskItem)
 
BOOL RedrawTask (IN HWND hWnd)
 
VOID UpdateButtonsSize (IN BOOL bRedrawDisabled)
 
BOOL CALLBACK EnumWindowsProc (IN HWND hWnd)
 
BOOL RefreshWindowList ()
 
LRESULT OnThemeChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCreate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDestroy (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
VOID SendPulseToTray (BOOL bDelete, HWND hwndActive)
 
BOOL HandleAppCommand (IN WPARAM wParam, IN LPARAM lParam)
 
LRESULT OnShellHook (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
VOID HandleTaskItemClick (IN OUT PTASK_ITEM TaskItem)
 
VOID HandleTaskGroupClick (IN OUT PTASK_GROUP TaskGroup)
 
BOOL HandleButtonClick (IN WORD wIndex)
 
VOID HandleTaskItemRightClick (IN OUT PTASK_ITEM TaskItem)
 
VOID HandleTaskGroupRightClick (IN OUT PTASK_GROUP TaskGroup)
 
BOOL HandleButtonRightClick (IN WORD wIndex)
 
LRESULT HandleItemPaint (IN OUT NMTBCUSTOMDRAW *nmtbcd)
 
LRESULT HandleToolbarNotification (IN const NMHDR *nmh)
 
LRESULT OnEraseBackground (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcHitTest (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCommand (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNotify (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnUpdateTaskbarPos (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnTaskbarSettingsChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnContextMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnKludgeItemRect (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMouseActivate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnTimer (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetFont (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSettingChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCopyData (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
HRESULT Initialize (IN HWND hWndParent, IN OUT ITrayWindow *tray)
 
STDMETHODIMP GetWindow (HWND *phwnd) override
 
STDMETHODIMP ContextSensitiveHelp (BOOL fEnterMode) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
- Public Member Functions inherited from ATL::CWindowImpl< CTaskSwitchWnd, CWindow, CControlWinTraits >
HWND Create (HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
HWND UnsubclassWindow (BOOL bForce=FALSE)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< TBase >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CWindow
 CWindow (HWND hWnd=NULL)
 
 operator HWND () const
 
UINT ArrangeIconicWindows ()
 
void Attach (HWND hWndNew)
 
HDC BeginPaint (LPPAINTSTRUCT lpPaint)
 
BOOL BringWindowToTop ()
 
BOOL CenterWindow (HWND hWndCenter=NULL)
 
BOOL ChangeClipboardChain (HWND hWndNewNext)
 
BOOL CheckDlgButton (int nIDButton, UINT nCheck)
 
BOOL CheckRadioButton (int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 
HWND ChildWindowFromPoint (POINT point) const
 
HWND ChildWindowFromPointEx (POINT point, UINT uFlags) const
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (LPRECT lpRect) const
 
HWND Create (LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
BOOL CreateCaret (HBITMAP pBitmap)
 
BOOL CreateGrayCaret (int nWidth, int nHeight)
 
BOOL CreateSolidCaret (int nWidth, int nHeight)
 
HDWP DeferWindowPos (HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
 
BOOL DestroyWindow ()
 
HWND Detach ()
 
int DlgDirList (LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType)
 
int DlgDirListComboBox (LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType)
 
BOOL DlgDirSelect (LPTSTR lpString, int nCount, int nIDListBox)
 
BOOL DlgDirSelectComboBox (LPTSTR lpString, int nCount, int nIDComboBox)
 
void DragAcceptFiles (BOOL bAccept=TRUE)
 
BOOL DrawMenuBar ()
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL EnableWindow (BOOL bEnable=TRUE)
 
void EndPaint (LPPAINTSTRUCT lpPaint)
 
BOOL FlashWindow (BOOL bInvert)
 
BOOL GetClientRect (LPRECT lpRect) const
 
HDC GetDC ()
 
HDC GetDCEx (HRGN hRgnClip, DWORD flags)
 
HWND GetDescendantWindow (int nID) const
 
HRESULT GetDlgControl (int nID, REFIID iid, void **ppCtrl)
 
int GetDlgCtrlID () const
 
HRESULT GetDlgHost (int nID, REFIID iid, void **ppHost)
 
HWND GetDlgItem (_In_ int nID) const
 
UINT GetDlgItemInt (_In_ int nID, _Out_opt_ BOOL *lpTrans=NULL, _In_ BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (_In_ int nID, _Out_writes_to_(nMaxCount, return+1) LPTSTR lpStr, _In_ int nMaxCount) const
 
BOOL GetDlgItemText (_In_ int nID, _Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
DWORD GetExStyle () const
 
HFONT GetFont () const
 
DWORD GetHotKey () const
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
HWND GetLastActivePopup () const
 
HMENU GetMenu () const
 
HWND GetNextDlgGroupItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
HWND GetNextDlgTabItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
CWindow GetParent () const
 
BOOL GetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo)
 
BOOL GetScrollPos (int nBar)
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
DWORD GetStyle () const
 
HMENU GetSystemMenu (BOOL bRevert)
 
HWND GetTopLevelParent () const
 
HWND GetTopLevelWindow () const
 
HWND GetTopWindow () const
 
BOOL GetUpdateRect (LPRECT lpRect, BOOL bErase=FALSE)
 
int GetUpdateRgn (HRGN hRgn, BOOL bErase=FALSE)
 
HWND GetWindow (UINT nCmd) const
 
DWORD GetWindowContextHelpId () const
 
HDC GetWindowDC ()
 
LONG GetWindowLong (int nIndex) const
 
LONG_PTR GetWindowLongPtr (int nIndex) const
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
DWORD GetWindowProcessID ()
 
BOOL GetWindowRect (LPRECT lpRect) const
 
int GetWindowRgn (HRGN hRgn)
 
int GetWindowText (_Out_writes_to_(nMaxCount, return+1) LPTSTR lpszStringBuf, _In_ int nMaxCount) const
 
BOOL GetWindowText (_Inout_ _Outref_result_maybenull_ _Post_z_ BSTR &bstrText) const
 
int GetWindowTextLength () const
 
DWORD GetWindowThreadID ()
 
WORD GetWindowWord (int nIndex) const
 
void GotoDlgCtrl (HWND hWndCtrl) const
 
BOOL HideCaret ()
 
BOOL HiliteMenuItem (HMENU hMenu, UINT uHiliteItem, UINT uHilite)
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsChild (const HWND hWnd) const
 
BOOL IsDialogMessage (LPMSG lpMsg)
 
UINT IsDlgButtonChecked (int nIDButton) const
 
BOOL IsIconic () const
 
BOOL IsParentDialog ()
 
BOOL IsWindow () const
 
BOOL IsWindowEnabled () const
 
BOOL IsWindowVisible () const
 
BOOL IsWindowUnicode ()
 
BOOL IsZoomed () const
 
BOOL KillTimer (UINT_PTR nIDEvent)
 
BOOL LockWindowUpdate (BOOL bLock=TRUE)
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
 
int MapWindowPoints (HWND hWndTo, LPRECT lpRect) const
 
int MessageBox (LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
 
void NextDlgCtrl () const
 
BOOL OpenClipboard ()
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void PrevDlgCtrl () const
 
void Print (HDC hDC, DWORD dwFlags) const
 
void PrintClient (HDC hDC, DWORD dwFlags) const
 
BOOL RedrawWindow (LPCRECT lpRectUpdate=NULL, HRGN hRgnUpdate=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
int ReleaseDC (HDC hDC)
 
BOOL ResizeClient (int nWidth, int nHeight, BOOL bRedraw=FALSE)
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScrollWindow (int xAmount, int yAmount, LPCRECT lpRect=NULL, LPCRECT lpClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags)
 
LRESULT SendDlgItemMessage (int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void SendMessageToDescendants (UINT message, WPARAM wParam=0, LPARAM lParam=0, BOOL bDeep=TRUE)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
HWND SetActiveWindow ()
 
HWND SetCapture ()
 
HWND SetClipboardViewer ()
 
int SetDlgCtrlID (int nID)
 
BOOL SetDlgItemInt (int nID, UINT nValue, BOOL bSigned=TRUE)
 
BOOL SetDlgItemText (int nID, LPCTSTR lpszString)
 
HWND SetFocus ()
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
int SetHotKey (WORD wVirtualKeyCode, WORD wModifiers)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
BOOL SetMenu (HMENU hMenu)
 
HWND SetParent (HWND hWndNewParent)
 
void SetRedraw (BOOL bRedraw=TRUE)
 
int SetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw=TRUE)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
 
BOOL SetWindowContextHelpId (DWORD dwContextHelpId)
 
LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong)
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetWindowText (LPCTSTR lpszString)
 
WORD SetWindowWord (int nIndex, WORD wNewWord)
 
BOOL ShowCaret ()
 
BOOL ShowOwnedPopups (BOOL bShow=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL ShowWindow (int nCmdShow)
 
BOOL ShowWindowAsync (int nCmdShow)
 
BOOL UpdateWindow ()
 
BOOL ValidateRect (LPCRECT lpRect)
 
BOOL ValidateRgn (HRGN hRgn)
 
BOOL WinHelp (LPCTSTR lpszHelp, UINT nCmd=HELP_CONTEXT, DWORD dwData=0)
 
- Public Member Functions inherited from ATL::CMessageMap
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)=0
 
HRESULT GetWindow ([out] HWND *phwnd)
 
HRESULT ContextSensitiveHelp ([in] BOOL fEnterMode)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 

Static Public Member Functions

static BOOL CALLBACK s_EnumWindowsProc (IN HWND hWnd, IN LPARAM lParam)
 
static BOOL InvokeRegistryAppKeyCommand (UINT uAppCmd)
 
static VOID CALLBACK SendAsyncProc (HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
 
- Static Public Member Functions inherited from ATL::CComCoClass< CTaskSwitchWnd >
static LPCTSTR WINAPI GetObjectDescription ()
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CTaskSwitchWnd, CWindow, CControlWinTraits >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Private Attributes

CTaskToolbar m_TaskBar
 
CComPtr< ITrayWindow > m_Tray
 
UINT m_ShellHookMsg
 
WORD m_TaskItemCount
 
WORD m_AllocatedTaskItems
 
PTASK_GROUP m_TaskGroups
 
PTASK_ITEM m_TaskItems
 
PTASK_ITEM m_ActiveTaskItem
 
HTHEME m_Theme
 
UINT m_ButtonsPerLine
 
WORD m_ButtonCount
 
HIMAGELIST m_ImageList
 
BOOL m_IsGroupingEnabled
 
BOOL m_IsDestroying
 
SIZE m_ButtonSize
 
UINT m_uHardErrorMsg
 
CHardErrorThread m_HardErrorThread
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 297 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CTaskSwitchWnd()

CTaskSwitchWnd::CTaskSwitchWnd ( )
inline

Definition at line 331 of file taskswnd.cpp.

331 :
338 m_Theme(NULL),
340 m_ButtonCount(0),
344 {
347 }
UINT m_ShellHookMsg
Definition: taskswnd.cpp:307
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:314
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:313
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:327
BOOL m_IsDestroying
Definition: taskswnd.cpp:323
WORD m_ButtonCount
Definition: taskswnd.cpp:318
HTHEME m_Theme
Definition: taskswnd.cpp:316
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:312
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:322
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:310
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:320
WORD m_TaskItemCount
Definition: taskswnd.cpp:309
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:317
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define L(x)
Definition: ntvdm.h:50
#define ZeroMemory
Definition: winbase.h:1743
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)

◆ ~CTaskSwitchWnd()

virtual CTaskSwitchWnd::~CTaskSwitchWnd ( )
inlinevirtual

Definition at line 348 of file taskswnd.cpp.

348{ }

Member Function Documentation

◆ ActivateTask()

BOOL CTaskSwitchWnd::ActivateTask ( IN HWND  hWnd)
inline

Definition at line 1141 of file taskswnd.cpp.

1142 {
1143 PTASK_ITEM TaskItem;
1144
1145 if (!hWnd)
1146 {
1147 return ActivateTaskItem(NULL);
1148 }
1149
1150 TaskItem = FindTaskItem(hWnd);
1151 if (TaskItem == NULL)
1152 {
1153 TaskItem = FindOtherTaskItem(hWnd);
1154 }
1155
1156 if (TaskItem == NULL)
1157 {
1158 WARN("Activate window 0x%p, could not find task\n", hWnd);
1160 }
1161
1162 return ActivateTaskItem(TaskItem);
1163 }
HWND hWnd
Definition: settings.c:17
#define WARN(fmt,...)
Definition: precomp.h:61
PTASK_ITEM FindOtherTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:884
BOOL ActivateTaskItem(IN OUT PTASK_ITEM TaskItem OPTIONAL)
Definition: taskswnd.cpp:1130
BOOL RefreshWindowList()
Definition: taskswnd.cpp:1408
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:867

Referenced by HandleTaskItemRightClick(), and OnShellHook().

◆ ActivateTaskItem()

BOOL CTaskSwitchWnd::ActivateTaskItem ( IN OUT PTASK_ITEM TaskItem  OPTIONAL)
inline

Definition at line 1130 of file taskswnd.cpp.

1131 {
1132 if (TaskItem != NULL)
1133 {
1134 TRACE("Activate window 0x%p on button %d\n", TaskItem->hWnd, TaskItem->Index);
1135 }
1136
1137 CheckActivateTaskItem(TaskItem);
1138 return FALSE;
1139 }
VOID CheckActivateTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1010
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ActivateTask().

◆ AddTask()

BOOL CTaskSwitchWnd::AddTask ( IN HWND  hWnd)
inline

Definition at line 1101 of file taskswnd.cpp.

1102 {
1103 PTASK_ITEM TaskItem;
1104
1105 if (!::IsWindow(hWnd) || m_Tray->IsSpecialHWND(hWnd))
1106 return FALSE;
1107
1108 TaskItem = FindTaskItem(hWnd);
1109 if (TaskItem == NULL)
1110 {
1111 TRACE("Add window 0x%p\n", hWnd);
1112 TaskItem = AllocTaskItem();
1113 if (TaskItem != NULL)
1114 {
1115 ZeroMemory(TaskItem, sizeof(*TaskItem));
1116 TaskItem->hWnd = hWnd;
1117 TaskItem->Index = -1;
1118 TaskItem->Group = AddToTaskGroup(hWnd);
1119
1120 if (!m_IsDestroying)
1121 {
1122 AddTaskItemButton(TaskItem);
1123 }
1124 }
1125 }
1126
1127 return TaskItem != NULL;
1128 }
BOOL IsWindow() const
Definition: atlwin.h:947
PTASK_GROUP AddToTaskGroup(IN HWND hWnd)
Definition: taskswnd.cpp:777
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:305
PTASK_ITEM AllocTaskItem()
Definition: taskswnd.cpp:925
INT AddTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:682
PTASK_GROUP Group
Definition: taskswnd.cpp:84
HWND hWnd
Definition: taskswnd.cpp:83

Referenced by EnumWindowsProc(), and OnShellHook().

◆ AddTaskItemButton()

INT CTaskSwitchWnd::AddTaskItemButton ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 682 of file taskswnd.cpp.

683 {
684 WCHAR windowText[255];
685 TBBUTTON tbBtn = { 0 };
686 INT iIndex;
687 HICON icon;
688
689 if (TaskItem->Index >= 0)
690 {
691 return UpdateTaskItemButton(TaskItem);
692 }
693
694 if (TaskItem->Group != NULL &&
695 TaskItem->Group->IsCollapsed)
696 {
697 /* The task group is collapsed, we only need to update the group button */
698 return UpdateTaskGroupButton(TaskItem->Group);
699 }
700
701 icon = GetWndIcon(TaskItem->hWnd);
702 if (!icon)
703 icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
704 TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, -1, icon);
705
706 tbBtn.iBitmap = TaskItem->IconIndex;
709 tbBtn.dwData = TaskItem->Index;
710
712 {
713 tbBtn.iString = (DWORD_PTR) windowText;
714 }
715
716 /* Find out where to insert the new button */
717 iIndex = CalculateTaskItemNewButtonIndex(TaskItem);
718 ASSERT(iIndex >= 0);
719 tbBtn.idCommand = iIndex;
720
722
723 if (m_TaskBar.InsertButton(iIndex, &tbBtn))
724 {
725 UpdateIndexesAfter(iIndex, TRUE);
726
727 TRACE("Added button %d for hwnd 0x%p\n", iIndex, TaskItem->hWnd);
728
729 TaskItem->Index = iIndex;
731
732 /* Update button sizes and fix the button wrapping */
734 return iIndex;
735 }
736
738
739 return -1;
740 }
WCHAR windowText[1024]
Definition: appswitch.c:49
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:526
INT GetWndTextFromTaskItem(IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
Definition: taskswnd.cpp:350
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1256
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:303
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:410
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:473
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:491
INT CalculateTaskItemNewButtonIndex(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:638
VOID BeginUpdate()
Definition: taskswnd.cpp:237
VOID EndUpdate()
Definition: taskswnd.cpp:242
#define TRUE
Definition: types.h:120
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2839
#define ASSERT(a)
Definition: mode.c:44
static HICON
Definition: imagelist.c:80
#define BTNS_SHOWTEXT
Definition: commctrl.h:1006
#define TBSTATE_ELLIPSES
Definition: commctrl.h:978
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define BTNS_CHECK
Definition: commctrl.h:1000
#define BTNS_NOPREFIX
Definition: commctrl.h:1005
#define _countof(array)
Definition: sndvol32.h:70
BYTE fsState
Definition: commctrl.h:951
INT_PTR iString
Definition: commctrl.h:959
int idCommand
Definition: commctrl.h:950
DWORD_PTR dwData
Definition: commctrl.h:958
int iBitmap
Definition: commctrl.h:949
BYTE fsStyle
Definition: commctrl.h:952
#define DWORD_PTR
Definition: treelist.c:76
int32_t INT
Definition: typedefs.h:58
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2540
#define LR_SHARED
Definition: winuser.h:1111
#define LR_DEFAULTSIZE
Definition: winuser.h:1105
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by AddTask().

◆ AddToTaskGroup()

PTASK_GROUP CTaskSwitchWnd::AddToTaskGroup ( IN HWND  hWnd)
inline

Definition at line 777 of file taskswnd.cpp.

778 {
779 DWORD dwProcessId;
780 PTASK_GROUP TaskGroup, *PrevLink;
781
783 &dwProcessId))
784 {
785 TRACE("Cannot get process id of hwnd 0x%p\n", hWnd);
786 return NULL;
787 }
788
789 /* Try to find an existing task group */
790 TaskGroup = m_TaskGroups;
791 PrevLink = &m_TaskGroups;
792 while (TaskGroup != NULL)
793 {
794 if (TaskGroup->dwProcessId == dwProcessId)
795 {
796 TaskGroup->dwTaskCount++;
797 return TaskGroup;
798 }
799
800 PrevLink = &TaskGroup->Next;
801 TaskGroup = TaskGroup->Next;
802 }
803
804 /* Allocate a new task group */
805 TaskGroup = (PTASK_GROUP) HeapAlloc(hProcessHeap,
807 sizeof(*TaskGroup));
808 if (TaskGroup != NULL)
809 {
810 TaskGroup->dwTaskCount = 1;
811 TaskGroup->dwProcessId = dwProcessId;
812 TaskGroup->Index = -1;
813
814 /* Add the task group to the list */
815 *PrevLink = TaskGroup;
816 }
817
818 return TaskGroup;
819 }
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
unsigned long DWORD
Definition: ntddk_ex.h:95
HANDLE hProcessHeap
Definition: kbswitch.c:37
struct _TASK_GROUP * Next
Definition: taskswnd.cpp:65
DWORD dwTaskCount
Definition: taskswnd.cpp:67
DWORD dwProcessId
Definition: taskswnd.cpp:68
struct _TASK_GROUP * PTASK_GROUP
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)

Referenced by AddTask().

◆ AllocTaskItem()

PTASK_ITEM CTaskSwitchWnd::AllocTaskItem ( )
inline

Definition at line 925 of file taskswnd.cpp.

926 {
928 {
929 /* We need the most significant bit in 16 bit command IDs to indicate whether it
930 is a task group or task item. WM_COMMAND limits command IDs to 16 bits! */
931 return NULL;
932 }
933
935
936 if (m_TaskItemCount == 0)
937 {
939 0,
941 if (m_TaskItems != NULL)
942 {
944 }
945 else
946 return NULL;
947 }
949 {
950 PTASK_ITEM NewArray;
951 SIZE_T NewArrayLength, ActiveTaskItemIndex;
952
954
956 0,
958 NewArrayLength * sizeof(*m_TaskItems));
959 if (NewArray != NULL)
960 {
961 if (m_ActiveTaskItem != NULL)
962 {
963 /* Fixup the ActiveTaskItem pointer */
964 ActiveTaskItemIndex = m_ActiveTaskItem - m_TaskItems;
965 m_ActiveTaskItem = NewArray + ActiveTaskItemIndex;
966 }
967 m_AllocatedTaskItems = (WORD) NewArrayLength;
968 m_TaskItems = NewArray;
969 }
970 else
971 return NULL;
972 }
973
974 return m_TaskItems + m_TaskItemCount++;
975 }
#define HeapReAlloc
Definition: compat.h:734
unsigned short WORD
Definition: ntddk_ex.h:93
struct _TASK_ITEM * PTASK_ITEM
#define TASK_ITEM_ARRAY_ALLOC
Definition: taskswnd.cpp:32
#define MAX_TASKS_COUNT
Definition: taskswnd.cpp:31
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by AddTask().

◆ CalculateTaskItemNewButtonIndex()

INT CTaskSwitchWnd::CalculateTaskItemNewButtonIndex ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 638 of file taskswnd.cpp.

639 {
640 PTASK_GROUP TaskGroup;
641 PTASK_ITEM LastTaskItem;
642
643 /* NOTE: This routine assumes that the group is *not* collapsed! */
644
645 TaskGroup = TaskItem->Group;
647 {
648 if (TaskGroup != NULL)
649 {
650 ASSERT(TaskGroup->Index < 0);
651 ASSERT(!TaskGroup->IsCollapsed);
652
653 if (TaskGroup->dwTaskCount > 1)
654 {
655 LastTaskItem = FindLastTaskItemOfGroup(TaskGroup, TaskItem);
656 if (LastTaskItem != NULL)
657 {
658 /* Since the group is expanded the task items must have an index */
659 ASSERT(LastTaskItem->Index >= 0);
660
661 return LastTaskItem->Index + 1;
662 }
663 }
664 }
665 else
666 {
667 /* Find the last NULL group button. NULL groups are added at the end of the
668 task item list when grouping is enabled */
669 LastTaskItem = FindLastTaskItemOfGroup(NULL, TaskItem);
670 if (LastTaskItem != NULL)
671 {
672 ASSERT(LastTaskItem->Index >= 0);
673
674 return LastTaskItem->Index + 1;
675 }
676 }
677 }
678
679 return m_ButtonCount;
680 }
PTASK_ITEM FindLastTaskItemOfGroup(IN PTASK_GROUP TaskGroup OPTIONAL, IN PTASK_ITEM NewTaskItem OPTIONAL)
Definition: taskswnd.cpp:600
DWORD IsCollapsed
Definition: taskswnd.cpp:76

Referenced by AddTaskItemButton().

◆ CheckActivateTaskItem()

VOID CTaskSwitchWnd::CheckActivateTaskItem ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 1010 of file taskswnd.cpp.

1011 {
1012 PTASK_ITEM CurrentTaskItem;
1013 PTASK_GROUP TaskGroup = NULL;
1014
1015 CurrentTaskItem = m_ActiveTaskItem;
1016
1017 if (TaskItem != NULL)
1018 TaskGroup = TaskItem->Group;
1019
1020 if (m_IsGroupingEnabled &&
1021 TaskGroup != NULL &&
1022 TaskGroup->IsCollapsed)
1023 {
1024 /* FIXME */
1025 return;
1026 }
1027
1028 if (CurrentTaskItem != NULL)
1029 {
1030 PTASK_GROUP CurrentTaskGroup;
1031
1032 if (CurrentTaskItem == TaskItem)
1033 return;
1034
1035 CurrentTaskGroup = CurrentTaskItem->Group;
1036
1037 if (m_IsGroupingEnabled &&
1038 CurrentTaskGroup != NULL &&
1039 CurrentTaskGroup->IsCollapsed)
1040 {
1041 if (CurrentTaskGroup == TaskGroup)
1042 return;
1043
1044 /* FIXME */
1045 }
1046 else
1047 {
1049 if (CurrentTaskItem->Index >= 0)
1050 {
1051 UpdateTaskItemButton(CurrentTaskItem);
1052 }
1053 }
1054 }
1055
1056 m_ActiveTaskItem = TaskItem;
1057
1058 if (TaskItem != NULL && TaskItem->Index >= 0)
1059 {
1060 UpdateTaskItemButton(TaskItem);
1061 }
1062 else if (TaskItem == NULL)
1063 {
1064 TRACE("Active TaskItem now NULL\n");
1065 }
1066 }

Referenced by ActivateTaskItem().

◆ ContextSensitiveHelp()

STDMETHODIMP CTaskSwitchWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inlineoverride

Implements IOleWindow.

Definition at line 2031 of file taskswnd.cpp.

2032 {
2033 return E_NOTIMPL;
2034 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DeleteAllTasks()

VOID CTaskSwitchWnd::DeleteAllTasks ( )
inline

Definition at line 1182 of file taskswnd.cpp.

1183 {
1184 PTASK_ITEM CurrentTask;
1185
1186 if (m_TaskItemCount > 0)
1187 {
1188 CurrentTask = m_TaskItems + m_TaskItemCount;
1189 do
1190 {
1191 DeleteTaskItem(--CurrentTask);
1192 } while (CurrentTask != m_TaskItems);
1193 }
1194 }
VOID DeleteTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:995

Referenced by OnDestroy().

◆ DeleteTask()

BOOL CTaskSwitchWnd::DeleteTask ( IN HWND  hWnd)
inline

Definition at line 1165 of file taskswnd.cpp.

1166 {
1167 PTASK_ITEM TaskItem;
1168
1169 TaskItem = FindTaskItem(hWnd);
1170 if (TaskItem != NULL)
1171 {
1172 TRACE("Delete window 0x%p on button %d\n", hWnd, TaskItem->Index);
1173 DeleteTaskItem(TaskItem);
1174 return TRUE;
1175 }
1176 //else
1177 //TRACE("Failed to delete window 0x%p\n", hWnd);
1178
1179 return FALSE;
1180 }

Referenced by OnShellHook().

◆ DeleteTaskItem()

VOID CTaskSwitchWnd::DeleteTaskItem ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 995 of file taskswnd.cpp.

996 {
997 if (!m_IsDestroying)
998 {
999 /* Delete the task button from the toolbar */
1000 DeleteTaskItemButton(TaskItem);
1001 }
1002
1003 /* Remove the task from it's group */
1004 RemoveTaskFromTaskGroup(TaskItem);
1005
1006 /* Free the task item */
1007 FreeTaskItem(TaskItem);
1008 }
VOID FreeTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:977
VOID RemoveTaskFromTaskGroup(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:821
BOOL DeleteTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:742

Referenced by DeleteAllTasks(), and DeleteTask().

◆ DeleteTaskItemButton()

BOOL CTaskSwitchWnd::DeleteTaskItemButton ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 742 of file taskswnd.cpp.

743 {
744 PTASK_GROUP TaskGroup;
745 INT iIndex;
746
747 TaskGroup = TaskItem->Group;
748
749 if (TaskItem->Index >= 0)
750 {
751 if ((TaskGroup != NULL && !TaskGroup->IsCollapsed) ||
752 TaskGroup == NULL)
753 {
755
756 RemoveIcon(TaskItem);
757 iIndex = TaskItem->Index;
758 if (m_TaskBar.DeleteButton(iIndex))
759 {
760 TaskItem->Index = -1;
762
763 UpdateIndexesAfter(iIndex, FALSE);
764
765 /* Update button sizes and fix the button wrapping */
767 return TRUE;
768 }
769
771 }
772 }
773
774 return FALSE;
775 }
VOID RemoveIcon(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:572

Referenced by DeleteTaskItem().

◆ EnumWindowsProc()

BOOL CALLBACK CTaskSwitchWnd::EnumWindowsProc ( IN HWND  hWnd)
inline

Definition at line 1391 of file taskswnd.cpp.

1392 {
1393 if (m_Tray->IsTaskWnd(hWnd))
1394 {
1395 TRACE("Adding task for %p...\n", hWnd);
1396 AddTask(hWnd);
1397 }
1398 return TRUE;
1399 }
BOOL AddTask(IN HWND hWnd)
Definition: taskswnd.cpp:1101

◆ ExpandTaskGroup()

VOID CTaskSwitchWnd::ExpandTaskGroup ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 482 of file taskswnd.cpp.

483 {
484 ASSERT(TaskGroup->dwTaskCount > 0);
485 ASSERT(TaskGroup->IsCollapsed);
486 ASSERT(TaskGroup->Index >= 0);
487
488 /* FIXME: Implement */
489 }

Referenced by RemoveTaskFromTaskGroup().

◆ FindLastTaskItemOfGroup()

PTASK_ITEM CTaskSwitchWnd::FindLastTaskItemOfGroup ( IN PTASK_GROUP TaskGroup  OPTIONAL,
IN PTASK_ITEM NewTaskItem  OPTIONAL 
)
inline

Definition at line 600 of file taskswnd.cpp.

603 {
604 PTASK_ITEM TaskItem, LastTaskItem, FoundTaskItem = NULL;
605 DWORD dwTaskCount;
606
608
609 TaskItem = m_TaskItems;
610 LastTaskItem = TaskItem + m_TaskItemCount;
611
612 dwTaskCount = (TaskGroup != NULL ? TaskGroup->dwTaskCount : MAX_TASKS_COUNT);
613
614 ASSERT(dwTaskCount > 0);
615
616 while (TaskItem != LastTaskItem)
617 {
618 if (TaskItem->Group == TaskGroup)
619 {
620 if ((NewTaskItem != NULL && TaskItem != NewTaskItem) || NewTaskItem == NULL)
621 {
622 FoundTaskItem = TaskItem;
623 }
624
625 if (--dwTaskCount == 0)
626 {
627 /* We found the last task item in the group! */
628 break;
629 }
630 }
631
632 TaskItem++;
633 }
634
635 return FoundTaskItem;
636 }

Referenced by CalculateTaskItemNewButtonIndex().

◆ FindOtherTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindOtherTaskItem ( IN HWND  hWnd)
inline

Definition at line 884 of file taskswnd.cpp.

885 {
886 PTASK_ITEM LastItem, TaskItem;
887 PTASK_GROUP TaskGroup;
888 DWORD dwProcessId;
889
890 if (!GetWindowThreadProcessId(hWnd, &dwProcessId))
891 {
892 return NULL;
893 }
894
895 /* Try to find another task that belongs to the same
896 process as the given window */
897 TaskItem = m_TaskItems;
898 LastItem = TaskItem + m_TaskItemCount;
899 while (TaskItem != LastItem)
900 {
901 TaskGroup = TaskItem->Group;
902 if (TaskGroup != NULL)
903 {
904 if (TaskGroup->dwProcessId == dwProcessId)
905 return TaskItem;
906 }
907 else
908 {
909 DWORD dwProcessIdTask;
910
911 if (GetWindowThreadProcessId(TaskItem->hWnd,
912 &dwProcessIdTask) &&
913 dwProcessIdTask == dwProcessId)
914 {
915 return TaskItem;
916 }
917 }
918
919 TaskItem++;
920 }
921
922 return NULL;
923 }

Referenced by ActivateTask().

◆ FindTaskGroupByIndex()

PTASK_GROUP CTaskSwitchWnd::FindTaskGroupByIndex ( IN INT  Index)
inline

Definition at line 1085 of file taskswnd.cpp.

1086 {
1087 PTASK_GROUP CurrentGroup;
1088
1089 CurrentGroup = m_TaskGroups;
1090 while (CurrentGroup != NULL)
1091 {
1092 if (CurrentGroup->Index == Index)
1093 break;
1094
1095 CurrentGroup = CurrentGroup->Next;
1096 }
1097
1098 return CurrentGroup;
1099 }
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by HandleButtonClick(), HandleButtonRightClick(), and HandleItemPaint().

◆ FindTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindTaskItem ( IN HWND  hWnd)
inline

Definition at line 867 of file taskswnd.cpp.

868 {
869 PTASK_ITEM TaskItem, LastItem;
870
871 TaskItem = m_TaskItems;
872 LastItem = TaskItem + m_TaskItemCount;
873 while (TaskItem != LastItem)
874 {
875 if (TaskItem->hWnd == hWnd)
876 return TaskItem;
877
878 TaskItem++;
879 }
880
881 return NULL;
882 }

Referenced by ActivateTask(), AddTask(), DeleteTask(), FlashTask(), OnKludgeItemRect(), and RedrawTask().

◆ FindTaskItemByIndex()

PTASK_ITEM CTaskSwitchWnd::FindTaskItemByIndex ( IN INT  Index)
inline

Definition at line 1068 of file taskswnd.cpp.

1069 {
1070 PTASK_ITEM TaskItem, LastItem;
1071
1072 TaskItem = m_TaskItems;
1073 LastItem = TaskItem + m_TaskItemCount;
1074 while (TaskItem != LastItem)
1075 {
1076 if (TaskItem->Index == Index)
1077 return TaskItem;
1078
1079 TaskItem++;
1080 }
1081
1082 return NULL;
1083 }

Referenced by HandleButtonClick(), HandleButtonRightClick(), and HandleItemPaint().

◆ FlashTask()

BOOL CTaskSwitchWnd::FlashTask ( IN HWND  hWnd)
inline

Definition at line 1202 of file taskswnd.cpp.

1203 {
1204 PTASK_ITEM TaskItem;
1205
1206 TaskItem = FindTaskItem(hWnd);
1207 if (TaskItem != NULL)
1208 {
1209 TRACE("Flashing window 0x%p on button %d\n", hWnd, TaskItem->Index);
1210 FlashTaskItem(TaskItem);
1211 return TRUE;
1212 }
1213
1214 return FALSE;
1215 }
VOID FlashTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1196

Referenced by OnShellHook().

◆ FlashTaskItem()

VOID CTaskSwitchWnd::FlashTaskItem ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 1196 of file taskswnd.cpp.

1197 {
1198 TaskItem->RenderFlashed = 1;
1199 UpdateTaskItemButton(TaskItem);
1200 }

Referenced by FlashTask().

◆ FreeTaskItem()

VOID CTaskSwitchWnd::FreeTaskItem ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 977 of file taskswnd.cpp.

978 {
979 WORD wIndex;
980
981 if (TaskItem == m_ActiveTaskItem)
983
984 wIndex = (WORD) (TaskItem - m_TaskItems);
985 if (wIndex + 1 < m_TaskItemCount)
986 {
987 MoveMemory(TaskItem,
988 TaskItem + 1,
989 (m_TaskItemCount - wIndex - 1) * sizeof(*TaskItem));
990 }
991
993 }
#define MoveMemory
Definition: winbase.h:1740

Referenced by DeleteTaskItem().

◆ GetWindow()

STDMETHODIMP CTaskSwitchWnd::GetWindow ( HWND phwnd)
inlineoverride

Implements IOleWindow.

Definition at line 2022 of file taskswnd.cpp.

2023 {
2024 if (!phwnd)
2025 return E_INVALIDARG;
2026 *phwnd = m_hWnd;
2027 return S_OK;
2028 }
HWND m_hWnd
Definition: atlwin.h:273
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52

◆ GetWndIcon()

HICON CTaskSwitchWnd::GetWndIcon ( HWND  hwnd)
inline

Definition at line 491 of file taskswnd.cpp.

492 {
493 HICON hIcon = NULL;
494
495 /* Retrieve icon by sending a message */
496#define GET_ICON(type) \
497 SendMessageTimeout(hwnd, WM_GETICON, (type), 0, SMTO_NOTIMEOUTIFNOTHUNG, 100, (PDWORD_PTR)&hIcon)
498
499 LRESULT bAlive = GET_ICON(g_TaskbarSettings.bSmallIcons ? ICON_SMALL2 : ICON_BIG);
500 if (hIcon)
501 return hIcon;
502
503 if (bAlive)
504 {
505 bAlive = GET_ICON(ICON_SMALL);
506 if (hIcon)
507 return hIcon;
508 }
509
510 if (bAlive)
511 {
513 if (hIcon)
514 return hIcon;
515 }
516#undef GET_ICON
517
518 /* If we failed, retrieve icon from the window class */
520 if (hIcon)
521 return hIcon;
522
524 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
HICON hIcon
Definition: msconfig.c:44
BOOL bSmallIcons
Definition: precomp.h:223
#define GET_ICON(type)
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LRESULT
Definition: windef.h:209
#define GCLP_HICONSM
Definition: winuser.h:683
#define GCLP_HICON
Definition: winuser.h:682
#define GetClassLongPtr
Definition: winuser.h:5802

Referenced by AddTaskItemButton(), and UpdateTaskItemButton().

◆ GetWndTextFromTaskItem()

INT CTaskSwitchWnd::GetWndTextFromTaskItem ( IN PTASK_ITEM  TaskItem,
LPWSTR  szBuf,
DWORD  cchBuf 
)
inline

Definition at line 350 of file taskswnd.cpp.

351 {
352 /* Get the window text without sending a message so we don't hang if an
353 application isn't responding! */
354 return InternalGetWindowText(TaskItem->hWnd, szBuf, cchBuf);
355 }
INT WINAPI InternalGetWindowText(_In_ HWND hWnd, _Out_writes_to_(cchMaxCount, return+1) LPWSTR pString, _In_ int cchMaxCount)

Referenced by AddTaskItemButton(), and UpdateTaskItemButton().

◆ HandleAppCommand()

BOOL CTaskSwitchWnd::HandleAppCommand ( IN WPARAM  wParam,
IN LPARAM  lParam 
)
inline

Definition at line 1518 of file taskswnd.cpp.

1519 {
1520 const UINT uAppCmd = GET_APPCOMMAND_LPARAM(lParam);
1521 if (InvokeRegistryAppKeyCommand(uAppCmd))
1522 return TRUE;
1523 switch (uAppCmd)
1524 {
1525 case APPCOMMAND_VOLUME_MUTE:
1526 case APPCOMMAND_VOLUME_DOWN:
1527 case APPCOMMAND_VOLUME_UP:
1528 // TODO: Try IMMDeviceEnumerator::GetDefaultAudioEndpoint first and then fall back to mixer.
1529 FIXME("Call the mixer API to change the global volume\n");
1530 return TRUE;
1531 case APPCOMMAND_BROWSER_SEARCH:
1532 return SHFindFiles(NULL, NULL);
1533 }
1534 return FALSE;
1535 }
#define FIXME(fmt,...)
Definition: precomp.h:53
static BOOL InvokeRegistryAppKeyCommand(UINT uAppCmd)
Definition: taskswnd.cpp:1481
LPARAM lParam
Definition: combotst.c:139
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2468

Referenced by OnShellHook().

◆ HandleButtonClick()

BOOL CTaskSwitchWnd::HandleButtonClick ( IN WORD  wIndex)
inline

Definition at line 1659 of file taskswnd.cpp.

1660 {
1661 PTASK_ITEM TaskItem;
1662 PTASK_GROUP TaskGroup;
1663
1665 {
1666 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1667 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1668 {
1669 HandleTaskGroupClick(TaskGroup);
1670 return TRUE;
1671 }
1672 }
1673
1674 TaskItem = FindTaskItemByIndex((INT) wIndex);
1675 if (TaskItem != NULL)
1676 {
1677 SendPulseToTray(FALSE, TaskItem->hWnd);
1678 HandleTaskItemClick(TaskItem);
1679 return TRUE;
1680 }
1681
1682 return FALSE;
1683 }
VOID SendPulseToTray(BOOL bDelete, HWND hwndActive)
Definition: taskswnd.cpp:1475
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1085
VOID HandleTaskGroupClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1654
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1068
VOID HandleTaskItemClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1622

Referenced by OnCommand().

◆ HandleButtonRightClick()

BOOL CTaskSwitchWnd::HandleButtonRightClick ( IN WORD  wIndex)
inline

Definition at line 1712 of file taskswnd.cpp.

1713 {
1714 PTASK_ITEM TaskItem;
1715 PTASK_GROUP TaskGroup;
1717 {
1718 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1719 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1720 {
1721 HandleTaskGroupRightClick(TaskGroup);
1722 return TRUE;
1723 }
1724 }
1725
1726 TaskItem = FindTaskItemByIndex((INT) wIndex);
1727
1728 if (TaskItem != NULL)
1729 {
1730 HandleTaskItemRightClick(TaskItem);
1731 return TRUE;
1732 }
1733
1734 return FALSE;
1735 }
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1707
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1691

Referenced by OnContextMenu().

◆ HandleItemPaint()

LRESULT CTaskSwitchWnd::HandleItemPaint ( IN OUT NMTBCUSTOMDRAW nmtbcd)
inline

Definition at line 1738 of file taskswnd.cpp.

1739 {
1740 LRESULT Ret = CDRF_DODEFAULT;
1741 PTASK_GROUP TaskGroup;
1742 PTASK_ITEM TaskItem;
1743
1744 TaskItem = FindTaskItemByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1745 TaskGroup = FindTaskGroupByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1746 if (TaskGroup == NULL && TaskItem != NULL)
1747 {
1748 ASSERT(TaskItem != NULL);
1749
1750 if (TaskItem != NULL && ::IsWindow(TaskItem->hWnd))
1751 {
1752 /* Make the entire button flashing if necessary */
1753 if (nmtbcd->nmcd.uItemState & CDIS_MARKED)
1754 {
1755 Ret = TBCDRF_NOBACKGROUND;
1756 if (!m_Theme)
1757 {
1758 SelectObject(nmtbcd->nmcd.hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
1759 Rectangle(nmtbcd->nmcd.hdc,
1760 nmtbcd->nmcd.rc.left,
1761 nmtbcd->nmcd.rc.top,
1762 nmtbcd->nmcd.rc.right,
1763 nmtbcd->nmcd.rc.bottom);
1764 }
1765 else
1766 {
1767 DrawThemeBackground(m_Theme, nmtbcd->nmcd.hdc, TDP_FLASHBUTTON, 0, &nmtbcd->nmcd.rc, 0);
1768 }
1769 nmtbcd->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
1770 return Ret;
1771 }
1772 }
1773 }
1774 else if (TaskGroup != NULL)
1775 {
1776 /* FIXME: Implement painting for task groups */
1777 }
1778 return Ret;
1779 }
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
#define CDRF_DODEFAULT
Definition: commctrl.h:268
#define TBCDRF_NOBACKGROUND
Definition: commctrl.h:1040
#define CDIS_MARKED
Definition: commctrl.h:298
@ TDP_FLASHBUTTON
Definition: vssym32.h:578
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_HIGHLIGHT
Definition: winuser.h:937
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:938

Referenced by HandleToolbarNotification().

◆ HandleTaskGroupClick()

VOID CTaskSwitchWnd::HandleTaskGroupClick ( IN OUT PTASK_GROUP  TaskGroup)
inline

Definition at line 1654 of file taskswnd.cpp.

1655 {
1656 /* TODO: Show task group menu */
1657 }

Referenced by HandleButtonClick().

◆ HandleTaskGroupRightClick()

VOID CTaskSwitchWnd::HandleTaskGroupRightClick ( IN OUT PTASK_GROUP  TaskGroup)
inline

Definition at line 1707 of file taskswnd.cpp.

1708 {
1709 /* TODO: Show task group right click menu */
1710 }

Referenced by HandleButtonRightClick().

◆ HandleTaskItemClick()

VOID CTaskSwitchWnd::HandleTaskItemClick ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 1622 of file taskswnd.cpp.

1623 {
1624 BOOL bIsMinimized;
1625 BOOL bIsActive;
1626
1627 if (::IsWindow(TaskItem->hWnd))
1628 {
1629 bIsMinimized = ::IsIconic(TaskItem->hWnd);
1630 bIsActive = (TaskItem == m_ActiveTaskItem);
1631
1632 TRACE("Active TaskItem %p, selected TaskItem %p\n", m_ActiveTaskItem, TaskItem);
1633 if (m_ActiveTaskItem)
1634 TRACE("Active TaskItem hWnd=%p, TaskItem hWnd %p\n", m_ActiveTaskItem->hWnd, TaskItem->hWnd);
1635
1636 TRACE("Valid button clicked. HWND=%p, IsMinimized=%s, IsActive=%s...\n",
1637 TaskItem->hWnd, bIsMinimized ? "Yes" : "No", bIsActive ? "Yes" : "No");
1638
1639 if (!bIsMinimized && bIsActive)
1640 {
1641 if (!::IsHungAppWindow(TaskItem->hWnd))
1642 ::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE);
1643 TRACE("Valid button clicked. App window Minimized.\n");
1644 }
1645 else
1646 {
1647 ::SwitchToThisWindow(TaskItem->hWnd, TRUE);
1648
1649 TRACE("Valid button clicked. App window Restored.\n");
1650 }
1651 }
1652 }
BOOL IsIconic() const
Definition: atlwin.h:932
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
BOOL WINAPI IsHungAppWindow(HWND hwnd)
Definition: window.c:1857
#define SW_MINIMIZE
Definition: winuser.h:787
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)

Referenced by HandleButtonClick().

◆ HandleTaskItemRightClick()

VOID CTaskSwitchWnd::HandleTaskItemRightClick ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 1691 of file taskswnd.cpp.

1692 {
1693 POINT pt;
1694 GetCursorPos(&pt);
1695
1696 SetForegroundWindow(TaskItem->hWnd);
1697
1698 ActivateTask(TaskItem->hWnd);
1699
1700 if (GetForegroundWindow() != TaskItem->hWnd)
1701 ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
1702
1703 ::SendMessageCallbackW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y),
1704 SendAsyncProc, (ULONG_PTR)TaskItem);
1705 }
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1141
static VOID CALLBACK SendAsyncProc(HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
Definition: taskswnd.cpp:1686
#define pt(x, y)
Definition: drawing.c:79
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WM_POPUPSYSTEMMENU
Definition: undocuser.h:61
#define MAKELPARAM(l, h)
Definition: winuser.h:4019
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3032
BOOL WINAPI SendMessageCallbackW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ SENDASYNCPROC, _In_ ULONG_PTR)

Referenced by HandleButtonRightClick().

◆ HandleToolbarNotification()

LRESULT CTaskSwitchWnd::HandleToolbarNotification ( IN const NMHDR nmh)
inline

Definition at line 1781 of file taskswnd.cpp.

1782 {
1783 LRESULT Ret = 0;
1784
1785 switch (nmh->code)
1786 {
1787 case NM_CUSTOMDRAW:
1788 {
1789 LPNMTBCUSTOMDRAW nmtbcd = (LPNMTBCUSTOMDRAW) nmh;
1790
1791 switch (nmtbcd->nmcd.dwDrawStage)
1792 {
1793
1794 case CDDS_ITEMPREPAINT:
1795 Ret = HandleItemPaint(nmtbcd);
1796 break;
1797
1798 case CDDS_PREPAINT:
1799 Ret = CDRF_NOTIFYITEMDRAW;
1800 break;
1801
1802 default:
1803 Ret = CDRF_DODEFAULT;
1804 break;
1805 }
1806 break;
1807 }
1808 }
1809
1810 return Ret;
1811 }
LRESULT HandleItemPaint(IN OUT NMTBCUSTOMDRAW *nmtbcd)
Definition: taskswnd.cpp:1738
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:285
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:275
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define CDDS_PREPAINT
Definition: commctrl.h:280
struct _NMTBCUSTOMDRAW * LPNMTBCUSTOMDRAW
NMCUSTOMDRAW nmcd
Definition: commctrl.h:1017

Referenced by OnNotify().

◆ Initialize()

HRESULT CTaskSwitchWnd::Initialize ( IN HWND  hWndParent,
IN OUT ITrayWindow *  tray 
)
inline

Definition at line 2009 of file taskswnd.cpp.

2010 {
2011 m_Tray = tray;
2014 if (!m_hWnd)
2015 return E_FAIL;
2016 return S_OK;
2017 }
@ Create
Definition: registry.c:563
#define E_FAIL
Definition: ddrawi.h:102
#define WS_CHILD
Definition: pedump.c:617
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
BOOL bGroupButtons
Definition: precomp.h:219
const WCHAR szRunningApps[]
Definition: taskswnd.cpp:35

◆ InvokeRegistryAppKeyCommand()

static BOOL CTaskSwitchWnd::InvokeRegistryAppKeyCommand ( UINT  uAppCmd)
inlinestatic

Definition at line 1481 of file taskswnd.cpp.

1482 {
1483 BOOL bResult = FALSE;
1484 WCHAR szBuf[MAX_PATH * 2];
1485 wsprintfW(szBuf, L"%s\\AppKey\\%u", REGSTR_PATH_EXPLORER, uAppCmd);
1486 HUSKEY hKey;
1488 return bResult;
1489
1490 DWORD cb = sizeof(szBuf);
1491 if (!bResult && SHRegQueryUSValueW(hKey, L"ShellExecute", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1492 {
1493 bResult = TRUE;
1494 }
1495 cb = sizeof(szBuf);
1496 if (!bResult && SHRegQueryUSValueW(hKey, L"Association", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1497 {
1498 bResult = TRUE;
1499 cb = _countof(szBuf);
1501 *szBuf = UNICODE_NULL;
1502 }
1503 cb = sizeof(szBuf);
1504 if (!bResult && SHRegQueryUSValueW(hKey, L"RegisteredApp", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1505 {
1506 bResult = TRUE;
1508 *szBuf = UNICODE_NULL; // Don't execute again
1509 }
1511
1512 // Note: Tweak UI uses an empty string for its "Do nothing" option.
1513 if (bResult && *szBuf)
1515 return bResult;
1516 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAX_PATH
Definition: compat.h:34
LONG WINAPI SHRegOpenUSKeyW(LPCWSTR Path, REGSAM AccessType, HUSKEY hRelativeUSKey, PHUSKEY phNewUSKey, BOOL fIgnoreHKCU)
Definition: reg.c:123
LONG WINAPI SHRegCloseUSKey(HUSKEY hUSKey)
Definition: reg.c:190
LONG WINAPI SHRegQueryUSValueW(HUSKEY hUSKey, LPCWSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData, BOOL fIgnoreHKCU, LPVOID pvDefaultData, DWORD dwDefaultDataSize)
Definition: reg.c:504
EXTERN_C HRESULT WINAPI SHRunIndirectRegClientCommand(_In_opt_ HWND hWnd, _In_ PCWSTR pszClientType)
Definition: utils.cpp:265
FxAutoRegKey hKey
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define KEY_READ
Definition: nt_native.h:1023
#define UNICODE_NULL
#define REGSTR_PATH_EXPLORER
Definition: regstr.h:33
EXTERN_C VOID WINAPI ShellExec_RunDLLW(_In_opt_ HWND hwnd, _In_opt_ HINSTANCE hInstance, _In_ PCWSTR pszCmdLine, _In_ INT nCmdShow)
Definition: shlexec.cpp:3165
@ ASSOCSTR_EXECUTABLE
Definition: shlwapi.h:613
@ ASSOCF_NOTRUNCATE
Definition: shlwapi.h:597
#define AssocQueryString
Definition: shlwapi.h:733
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define SW_SHOW
Definition: winuser.h:786

Referenced by HandleAppCommand().

◆ OnCommand()

LRESULT CTaskSwitchWnd::OnCommand ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1856 of file taskswnd.cpp.

1857 {
1858 LRESULT Ret = TRUE;
1859 if (lParam != 0 && (HWND) lParam == m_TaskBar.m_hWnd)
1860 {
1862 }
1863 return Ret;
1864 }
BOOL HandleButtonClick(IN WORD wIndex)
Definition: taskswnd.cpp:1659
WPARAM wParam
Definition: combotst.c:138
#define LOWORD(l)
Definition: pedump.c:82

◆ OnContextMenu()

LRESULT CTaskSwitchWnd::OnContextMenu ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1913 of file taskswnd.cpp.

1914 {
1915 LRESULT Ret = 0;
1916 INT_PTR iBtn = -1;
1917
1918 if (m_TaskBar.m_hWnd != NULL)
1919 {
1920 POINT pt;
1921
1922 pt.x = GET_X_LPARAM(lParam);
1923 pt.y = GET_Y_LPARAM(lParam);
1924
1926
1927 iBtn = m_TaskBar.HitTest(&pt);
1928 if (iBtn >= 0)
1929 {
1931 }
1932 }
1933 if (iBtn < 0)
1934 {
1935 /* Not on a taskbar button, so forward message to tray */
1936 Ret = SendMessage(m_Tray->GetHWND(), uMsg, wParam, lParam);
1937 }
1938 return Ret;
1939 }
BOOL HandleButtonRightClick(IN WORD wIndex)
Definition: taskswnd.cpp:1712
int32_t INT_PTR
Definition: typedefs.h:64
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define SendMessage
Definition: winuser.h:5863
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

◆ OnCopyData()

LRESULT CTaskSwitchWnd::OnCopyData ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1993 of file taskswnd.cpp.

1994 {
1996 if (cpData->dwData == m_uHardErrorMsg)
1997 {
1998 /* A hard error balloon message */
2000 ERR("Got balloon data 0x%x, 0x%x, '%S', '%S'\n", pData->Status, pData->dwType, (WCHAR*)((ULONG_PTR)pData + pData->TitleOffset), (WCHAR*)((ULONG_PTR)pData + pData->MessageOffset));
2001 if (pData->cbHeaderSize == sizeof(BALLOON_HARD_ERROR_DATA))
2003 return TRUE;
2004 }
2005
2006 return FALSE;
2007 }
void StartThread(PBALLOON_HARD_ERROR_DATA pData)
Definition: taskswnd.cpp:180
CHardErrorThread m_HardErrorThread
Definition: taskswnd.cpp:328
#define ULONG_PTR
Definition: config.h:101
ULONG_PTR dwData
Definition: winuser.h:3012
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
struct _BALLOON_HARD_ERROR_DATA * PBALLOON_HARD_ERROR_DATA
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT

◆ OnCreate()

LRESULT CTaskSwitchWnd::OnCreate ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1430 of file taskswnd.cpp.

1431 {
1433 return FALSE;
1434
1435 SetWindowTheme(m_TaskBar.m_hWnd, L"TaskBand", NULL);
1436
1439 ILC_COLOR32 | ILC_MASK, 0, 1000);
1440 m_TaskBar.SetImageList(m_ImageList);
1441
1442 /* Set proper spacing between buttons */
1443 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1444
1445 /* Register the shell hook */
1447
1448 TRACE("ShellHookMsg got assigned number %d\n", m_ShellHookMsg);
1449
1450 RegisterShellHook(m_hWnd, 3); /* 1 if no NT! We're targeting NT so we don't care! */
1451
1453
1454 /* Recalculate the button size */
1456
1457#if DUMP_TASKS != 0
1458 SetTimer(hwnd, 1, 5000, NULL);
1459#endif
1460 return TRUE;
1461 }
INT UpdateTbButtonSpacing(IN BOOL bHorizontal, IN BOOL bThemed, IN UINT uiRows=0, IN UINT uiBtnsPerLine=0)
Definition: taskswnd.cpp:205
BOOL Initialize(HWND hWndParent)
Definition: taskswnd.cpp:284
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define ILC_COLOR32
Definition: commctrl.h:358
#define ILC_MASK
Definition: commctrl.h:351
BOOL WINAPI RegisterShellHook(HWND hWnd, DWORD dwType)
Definition: shellord.c:510
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
#define SM_CYSMICON
Definition: winuser.h:1024
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define SM_CXSMICON
Definition: winuser.h:1023
#define SM_CYICON
Definition: winuser.h:984
#define SM_CXICON
Definition: winuser.h:983
int WINAPI GetSystemMetrics(_In_ int)

◆ OnDestroy()

LRESULT CTaskSwitchWnd::OnDestroy ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1463 of file taskswnd.cpp.

1464 {
1466
1467 /* Unregister the shell hook */
1469
1472 return TRUE;
1473 }
VOID DeleteAllTasks()
Definition: taskswnd.cpp:1182
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:965

◆ OnEraseBackground()

LRESULT CTaskSwitchWnd::OnEraseBackground ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1813 of file taskswnd.cpp.

1814 {
1815 HDC hdc = (HDC) wParam;
1816
1817 if (!IsAppThemed())
1818 {
1819 bHandled = FALSE;
1820 return 0;
1821 }
1822
1823 RECT rect;
1826
1827 return TRUE;
1828 }
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
BOOL WINAPI IsAppThemed(void)
Definition: system.c:611
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

◆ OnKludgeItemRect()

LRESULT CTaskSwitchWnd::OnKludgeItemRect ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1941 of file taskswnd.cpp.

1942 {
1943 PTASK_ITEM TaskItem = FindTaskItem((HWND) wParam);
1944 if (TaskItem)
1945 {
1946 RECT* prcMinRect = (RECT*) lParam;
1947 RECT rcItem, rcToolbar;
1948 m_TaskBar.GetItemRect(TaskItem->Index, &rcItem);
1949 m_TaskBar.GetWindowRect(&rcToolbar);
1950
1951 OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top);
1952
1953 *prcMinRect = rcItem;
1954 return TRUE;
1955 }
1956 return FALSE;
1957 }
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)

◆ OnMouseActivate()

LRESULT CTaskSwitchWnd::OnMouseActivate ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1959 of file taskswnd.cpp.

1960 {
1961 return MA_NOACTIVATE;
1962 }
#define MA_NOACTIVATE
Definition: winuser.h:2514

◆ OnNcHitTest()

LRESULT CTaskSwitchWnd::OnNcHitTest ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1845 of file taskswnd.cpp.

1846 {
1847 LRESULT Ret = TRUE;
1848 /* We want the tray window to be draggable everywhere, so make the control
1849 appear transparent */
1850 Ret = DefWindowProc(uMsg, wParam, lParam);
1851 if (Ret != HTVSCROLL && Ret != HTHSCROLL)
1852 Ret = HTTRANSPARENT;
1853 return Ret;
1854 }
#define DefWindowProc
Definition: ros2win.h:31
#define HTVSCROLL
Definition: winuser.h:2493
#define HTHSCROLL
Definition: winuser.h:2492
#define HTTRANSPARENT
Definition: winuser.h:2484

◆ OnNotify()

LRESULT CTaskSwitchWnd::OnNotify ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1866 of file taskswnd.cpp.

1867 {
1868 LRESULT Ret = TRUE;
1869 const NMHDR *nmh = (const NMHDR *) lParam;
1870
1871 if (nmh->hwndFrom == m_TaskBar.m_hWnd)
1872 {
1873 Ret = HandleToolbarNotification(nmh);
1874 }
1875 return Ret;
1876 }
LRESULT HandleToolbarNotification(IN const NMHDR *nmh)
Definition: taskswnd.cpp:1781
HWND hwndFrom
Definition: winuser.h:3168

◆ OnSetFont()

LRESULT CTaskSwitchWnd::OnSetFont ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1977 of file taskswnd.cpp.

1978 {
1979 return m_TaskBar.SendMessageW(uMsg, wParam, lParam);
1980 }

◆ OnSettingChanged()

LRESULT CTaskSwitchWnd::OnSettingChanged ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1982 of file taskswnd.cpp.

1983 {
1984 if (wParam == SPI_SETNONCLIENTMETRICS)
1985 {
1986 /* Don't update the font, this will be done when we get a WM_SETFONT from our parent */
1988 }
1989
1990 return 0;
1991 }

◆ OnShellHook()

LRESULT CTaskSwitchWnd::OnShellHook ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1537 of file taskswnd.cpp.

1538 {
1539 BOOL Ret = FALSE;
1540
1541 /* In case the shell hook wasn't registered properly, ignore WM_NULLs*/
1542 if (uMsg == 0)
1543 {
1544 bHandled = FALSE;
1545 return 0;
1546 }
1547
1548 TRACE("Received shell hook message: wParam=%08lx, lParam=%08lx\n", wParam, lParam);
1549
1550 switch ((INT) wParam)
1551 {
1552 case HSHELL_APPCOMMAND:
1553 Ret = HandleAppCommand(0, lParam);
1554 break;
1555
1558 AddTask((HWND) lParam);
1559 break;
1560
1562 /* The window still exists! Delay destroying it a bit */
1565 break;
1566
1568 case HSHELL_WINDOWACTIVATED:
1571 break;
1572
1573 case HSHELL_FLASH:
1575 break;
1576
1577 case HSHELL_REDRAW:
1579 break;
1580
1581 case HSHELL_TASKMAN:
1582 ::PostMessage(m_Tray->GetHWND(), TWM_OPENSTARTMENU, 0, 0);
1583 break;
1584
1586 ::SwitchToThisWindow(m_Tray->GetHWND(), TRUE);
1587 ::SetForegroundWindow(m_Tray->GetHWND());
1588 break;
1589
1590 case HSHELL_LANGUAGE:
1591 case HSHELL_SYSMENU:
1592 case HSHELL_ENDTASK:
1593 case HSHELL_ACCESSIBILITYSTATE:
1594 case HSHELL_WINDOWREPLACED:
1595 case HSHELL_WINDOWREPLACING:
1596
1597 case HSHELL_GETMINRECT:
1598 default:
1599 {
1600#if DEBUG_SHELL_HOOK
1601 int i, found;
1602 for (i = 0, found = 0; i != _countof(hshell_msg); i++)
1603 {
1604 if (hshell_msg[i].msg == (INT) wParam)
1605 {
1606 TRACE("Shell message %ws unhandled (lParam = 0x%p)!\n", hshell_msg[i].msg_name, lParam);
1607 found = 1;
1608 break;
1609 }
1610 }
1611 if (found)
1612 break;
1613#endif
1614 TRACE("Shell message %d unhandled (lParam = 0x%p)!\n", (INT) wParam, lParam);
1615 break;
1616 }
1617 }
1618
1619 return Ret;
1620 }
#define msg(x)
Definition: auth_time.c:54
#define TWM_OPENSTARTMENU
Definition: precomp.h:133
BOOL HandleAppCommand(IN WPARAM wParam, IN LPARAM lParam)
Definition: taskswnd.cpp:1518
BOOL FlashTask(IN HWND hWnd)
Definition: taskswnd.cpp:1202
BOOL RedrawTask(IN HWND hWnd)
Definition: taskswnd.cpp:1242
BOOL DeleteTask(IN HWND hWnd)
Definition: taskswnd.cpp:1165
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
#define HSHELL_RUDEAPPACTIVATED
Definition: winuser.h:1292
#define HSHELL_ACTIVATESHELLWINDOW
Definition: winuser.h:1268
#define HSHELL_WINDOWDESTROYED
Definition: winuser.h:1267
#define HSHELL_WINDOWCREATED
Definition: winuser.h:1266
#define HSHELL_FLASH
Definition: winuser.h:1291
#define PostMessage
Definition: winuser.h:5852

◆ OnSize()

LRESULT CTaskSwitchWnd::OnSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1830 of file taskswnd.cpp.

1831 {
1832 SIZE szClient;
1833
1834 szClient.cx = LOWORD(lParam);
1835 szClient.cy = HIWORD(lParam);
1836 if (m_TaskBar.m_hWnd != NULL)
1837 {
1838 m_TaskBar.SetWindowPos(NULL, 0, 0, szClient.cx, szClient.cy, SWP_NOZORDER);
1839
1841 }
1842 return TRUE;
1843 }
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1288
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
#define HIWORD(l)
Definition: typedefs.h:247
#define SWP_NOZORDER
Definition: winuser.h:1258

◆ OnTaskbarSettingsChanged()

LRESULT CTaskSwitchWnd::OnTaskbarSettingsChanged ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1885 of file taskswnd.cpp.

1886 {
1887 BOOL bSettingsChanged = FALSE;
1888 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
1889
1890 if (newSettings->bGroupButtons != g_TaskbarSettings.bGroupButtons)
1891 {
1892 bSettingsChanged = TRUE;
1895 }
1896
1897 if (newSettings->bSmallIcons != g_TaskbarSettings.bSmallIcons)
1898 {
1899 bSettingsChanged = TRUE;
1901 }
1902
1903 if (bSettingsChanged)
1904 {
1905 /* Refresh each task item view */
1908 }
1909
1910 return 0;
1911 }

◆ OnThemeChanged()

LRESULT CTaskSwitchWnd::OnThemeChanged ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1415 of file taskswnd.cpp.

1416 {
1417 TRACE("OmThemeChanged\n");
1418
1419 if (m_Theme)
1421
1422 if (IsThemeActive())
1423 m_Theme = OpenThemeData(m_hWnd, L"TaskBand");
1424 else
1425 m_Theme = NULL;
1426
1427 return TRUE;
1428 }
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:850
BOOL WINAPI IsThemeActive(void)
Definition: system.c:621

◆ OnTimer()

LRESULT CTaskSwitchWnd::OnTimer ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1964 of file taskswnd.cpp.

1965 {
1966#if DUMP_TASKS != 0
1967 switch (wParam)
1968 {
1969 case 1:
1970 DumpTasks();
1971 break;
1972 }
1973#endif
1974 return TRUE;
1975 }

◆ OnUpdateTaskbarPos()

LRESULT CTaskSwitchWnd::OnUpdateTaskbarPos ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 1878 of file taskswnd.cpp.

1879 {
1880 /* Update the button spacing */
1881 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1882 return TRUE;
1883 }

◆ RedrawTask()

BOOL CTaskSwitchWnd::RedrawTask ( IN HWND  hWnd)
inline

Definition at line 1242 of file taskswnd.cpp.

1243 {
1244 PTASK_ITEM TaskItem;
1245
1246 TaskItem = FindTaskItem(hWnd);
1247 if (TaskItem != NULL)
1248 {
1249 RedrawTaskItem(TaskItem);
1250 return TRUE;
1251 }
1252
1253 return FALSE;
1254 }
VOID RedrawTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1217

Referenced by OnShellHook().

◆ RedrawTaskItem()

VOID CTaskSwitchWnd::RedrawTaskItem ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 1217 of file taskswnd.cpp.

1218 {
1219 PTASK_GROUP TaskGroup;
1220
1221 TaskGroup = TaskItem->Group;
1222 if (m_IsGroupingEnabled && TaskGroup != NULL)
1223 {
1224 if (TaskGroup->IsCollapsed && TaskGroup->Index >= 0)
1225 {
1226 UpdateTaskGroupButton(TaskGroup);
1227 }
1228 else if (TaskItem->Index >= 0)
1229 {
1230 goto UpdateTaskItem;
1231 }
1232 }
1233 else if (TaskItem->Index >= 0)
1234 {
1235 UpdateTaskItem:
1236 TaskItem->RenderFlashed = 0;
1237 UpdateTaskItemButton(TaskItem);
1238 }
1239 }

Referenced by RedrawTask().

◆ RefreshWindowList()

BOOL CTaskSwitchWnd::RefreshWindowList ( )
inline

Definition at line 1408 of file taskswnd.cpp.

1409 {
1410 TRACE("Refreshing window list...\n");
1411 /* Add all windows to the toolbar */
1412 return EnumWindows(s_EnumWindowsProc, (LPARAM)this);
1413 }
static BOOL CALLBACK s_EnumWindowsProc(IN HWND hWnd, IN LPARAM lParam)
Definition: taskswnd.cpp:1401
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)

Referenced by ActivateTask(), OnCreate(), and OnTaskbarSettingsChanged().

◆ RemoveIcon()

VOID CTaskSwitchWnd::RemoveIcon ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 572 of file taskswnd.cpp.

573 {
574 TBBUTTONINFO tbbi;
575 PTASK_ITEM currentTaskItem, LastItem;
576
577 if (TaskItem->IconIndex == -1)
578 return;
579
580 tbbi.cbSize = sizeof(tbbi);
581 tbbi.dwMask = TBIF_IMAGE;
582
583 currentTaskItem = m_TaskItems;
584 LastItem = currentTaskItem + m_TaskItemCount;
585 while (currentTaskItem != LastItem)
586 {
587 if (currentTaskItem->IconIndex > TaskItem->IconIndex)
588 {
589 currentTaskItem->IconIndex--;
590 tbbi.iImage = currentTaskItem->IconIndex;
591
592 m_TaskBar.SetButtonInfo(currentTaskItem->Index, &tbbi);
593 }
594 currentTaskItem++;
595 }
596
597 ImageList_Remove(m_ImageList, TaskItem->IconIndex);
598 }
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
Definition: imagelist.c:2628
#define TBIF_IMAGE
Definition: commctrl.h:1219
#define TBBUTTONINFO
Definition: commctrl.h:1254
INT IconIndex
Definition: taskswnd.cpp:86

Referenced by DeleteTaskItemButton().

◆ RemoveTaskFromTaskGroup()

VOID CTaskSwitchWnd::RemoveTaskFromTaskGroup ( IN OUT PTASK_ITEM  TaskItem)
inline

Definition at line 821 of file taskswnd.cpp.

822 {
823 PTASK_GROUP TaskGroup, CurrentGroup, *PrevLink;
824
825 TaskGroup = TaskItem->Group;
826 if (TaskGroup != NULL)
827 {
828 DWORD dwNewTaskCount = --TaskGroup->dwTaskCount;
829 if (dwNewTaskCount == 0)
830 {
831 /* Find the previous pointer in the chain */
832 CurrentGroup = m_TaskGroups;
833 PrevLink = &m_TaskGroups;
834 while (CurrentGroup != TaskGroup)
835 {
836 PrevLink = &CurrentGroup->Next;
837 CurrentGroup = CurrentGroup->Next;
838 }
839
840 /* Remove the group from the list */
841 ASSERT(TaskGroup == CurrentGroup);
842 *PrevLink = TaskGroup->Next;
843
844 /* Free the task group */
846 0,
847 TaskGroup);
848 }
849 else if (TaskGroup->IsCollapsed &&
850 TaskGroup->Index >= 0)
851 {
852 if (dwNewTaskCount > 1)
853 {
854 /* FIXME: Check if we should expand the group */
855 /* Update the task group button */
856 UpdateTaskGroupButton(TaskGroup);
857 }
858 else
859 {
860 /* Expand the group of one task button to a task button */
861 ExpandTaskGroup(TaskGroup);
862 }
863 }
864 }
865 }
VOID ExpandTaskGroup(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:482
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by DeleteTaskItem().

◆ s_EnumWindowsProc()

static BOOL CALLBACK CTaskSwitchWnd::s_EnumWindowsProc ( IN HWND  hWnd,
IN LPARAM  lParam 
)
inlinestatic

Definition at line 1401 of file taskswnd.cpp.

1402 {
1404
1405 return This->EnumWindowsProc(hWnd);
1406 }

Referenced by RefreshWindowList().

◆ SendAsyncProc()

static VOID CALLBACK CTaskSwitchWnd::SendAsyncProc ( HWND  hwnd,
UINT  uMsg,
DWORD_PTR  dwData,
LRESULT  lResult 
)
inlinestatic

Definition at line 1686 of file taskswnd.cpp.

1687 {
1688 ::PostMessageW(hwnd, WM_NULL, 0, 0);
1689 }
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NULL
Definition: winuser.h:1618

Referenced by HandleTaskItemRightClick().

◆ SendPulseToTray()

VOID CTaskSwitchWnd::SendPulseToTray ( BOOL  bDelete,
HWND  hwndActive 
)
inline

Definition at line 1475 of file taskswnd.cpp.

1476 {
1477 HWND hwndTray = m_Tray->GetHWND();
1478 ::SendMessage(hwndTray, TWM_PULSE, bDelete, (LPARAM)hwndActive);
1479 }
#define TWM_PULSE
Definition: precomp.h:135

Referenced by HandleButtonClick(), and OnShellHook().

◆ UpdateButtonsSize()

VOID CTaskSwitchWnd::UpdateButtonsSize ( IN BOOL  bRedrawDisabled)
inline

Definition at line 1256 of file taskswnd.cpp.

1257 {
1258 RECT rcClient;
1259 UINT uiRows, uiMax, uiMin, uiBtnsPerLine, ui;
1260 LONG NewBtnSize;
1261 BOOL Horizontal;
1262
1263 /* Update the size of the image list if needed */
1264 int cx, cy;
1268 {
1272
1273 /* SetIconSize removes all icons so we have to reinsert them */
1274 PTASK_ITEM TaskItem = m_TaskItems;
1275 PTASK_ITEM LastTaskItem = m_TaskItems + m_TaskItemCount;
1276 while (TaskItem != LastTaskItem)
1277 {
1278 TaskItem->IconIndex = -1;
1279 UpdateTaskItemButton(TaskItem);
1280
1281 TaskItem++;
1282 }
1283 m_TaskBar.SetImageList(m_ImageList);
1284 }
1285
1286 if (GetClientRect(&rcClient) && !IsRectEmpty(&rcClient))
1287 {
1288 if (m_ButtonCount > 0)
1289 {
1290 Horizontal = m_Tray->IsHorizontal();
1291
1292 if (Horizontal)
1293 {
1294 TBMETRICS tbm = { 0 };
1295 tbm.cbSize = sizeof(tbm);
1297 m_TaskBar.GetMetrics(&tbm);
1298
1299 if (m_ButtonSize.cy + tbm.cyButtonSpacing != 0)
1300 uiRows = (rcClient.bottom + tbm.cyButtonSpacing) / (m_ButtonSize.cy + tbm.cyButtonSpacing);
1301 else
1302 uiRows = 1;
1303
1304 if (uiRows == 0)
1305 uiRows = 1;
1306
1307 uiBtnsPerLine = (m_ButtonCount + uiRows - 1) / uiRows;
1308 }
1309 else
1310 {
1311 uiBtnsPerLine = 1;
1312 uiRows = m_ButtonCount;
1313 }
1314
1315 if (!bRedrawDisabled)
1317
1318 /* We might need to update the button spacing */
1319 int cxButtonSpacing = m_TaskBar.UpdateTbButtonSpacing(
1320 Horizontal, m_Theme != NULL,
1321 uiRows, uiBtnsPerLine);
1322
1323 /* Determine the minimum and maximum width of a button */
1325 if (Horizontal)
1326 {
1328
1329 /* Calculate the ideal width and make sure it's within the allowed range */
1330 NewBtnSize = (rcClient.right - (uiBtnsPerLine * cxButtonSpacing)) / uiBtnsPerLine;
1331
1332 if (NewBtnSize < (LONG) uiMin)
1333 NewBtnSize = uiMin;
1334 if (NewBtnSize >(LONG)uiMax)
1335 NewBtnSize = uiMax;
1336
1337 /* Recalculate how many buttons actually fit into one line */
1338 uiBtnsPerLine = rcClient.right / (NewBtnSize + cxButtonSpacing);
1339 if (uiBtnsPerLine == 0)
1340 uiBtnsPerLine++;
1341 }
1342 else
1343 {
1344 NewBtnSize = uiMax = rcClient.right;
1345 }
1346
1347 m_ButtonSize.cx = NewBtnSize;
1348
1349 m_ButtonsPerLine = uiBtnsPerLine;
1350
1351 for (ui = 0; ui != m_ButtonCount; ui++)
1352 {
1353 TBBUTTONINFOW tbbi = { 0 };
1354 tbbi.cbSize = sizeof(tbbi);
1356 tbbi.cx = (INT) NewBtnSize;
1357 tbbi.fsState = TBSTATE_ENABLED;
1358
1359 /* Check if we're updating a button that is the last one in the
1360 line. If so, we need to set the TBSTATE_WRAP flag! */
1361 if (Horizontal)
1362 {
1363 if ((ui + 1) % uiBtnsPerLine == 0)
1364 tbbi.fsState |= TBSTATE_WRAP;
1365 }
1366 else
1367 {
1368 tbbi.fsState |= TBSTATE_WRAP;
1369 }
1370
1371 if (m_ActiveTaskItem != NULL &&
1373 {
1374 tbbi.fsState |= TBSTATE_CHECKED;
1375 }
1376
1377 m_TaskBar.SetButtonInfo(ui, &tbbi);
1378 }
1379 }
1380 else
1381 {
1382 m_ButtonsPerLine = 0;
1383 m_ButtonSize.cx = 0;
1384 }
1385 }
1386
1387 // FIXME: This seems to be enabling redraws prematurely, but moving it to its right place doesn't work!
1389 }
BOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl, INT cx, INT cy)
Definition: imagelist.c:3132
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
Definition: imagelist.c:2055
UINT ui
Definition: oleauto.h:49
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TBIF_SIZE
Definition: commctrl.h:1225
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TBMF_BUTTONSPACING
Definition: commctrl.h:1289
#define TBIF_BYINDEX
Definition: commctrl.h:1226
#define TBSTATE_WRAP
Definition: commctrl.h:977
#define TBSTATE_CHECKED
Definition: commctrl.h:972
#define TBIF_STATE
Definition: commctrl.h:1221
DWORD dwMask
Definition: commctrl.h:1243
int cyButtonSpacing
Definition: commctrl.h:1299
DWORD dwMask
Definition: commctrl.h:1293
UINT cbSize
Definition: commctrl.h:1292
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
#define SM_CXMINIMIZED
Definition: winuser.h:1031
#define SM_CXEDGE
Definition: winuser.h:1019
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define SM_CXSIZE
Definition: winuser.h:1002

Referenced by AddTaskItemButton(), DeleteTaskItemButton(), OnCreate(), OnSettingChanged(), OnSize(), and OnTaskbarSettingsChanged().

◆ UpdateIndexesAfter()

VOID CTaskSwitchWnd::UpdateIndexesAfter ( IN INT  iIndex,
BOOL  bInserted 
)
inline

Definition at line 410 of file taskswnd.cpp.

411 {
412 PTASK_GROUP CurrentGroup;
413 PTASK_ITEM CurrentTaskItem, LastTaskItem;
414 INT NewIndex;
415
416 int offset = bInserted ? +1 : -1;
417
419 {
420 /* Update all affected groups */
421 CurrentGroup = m_TaskGroups;
422 while (CurrentGroup != NULL)
423 {
424 if (CurrentGroup->IsCollapsed &&
425 CurrentGroup->Index >= iIndex)
426 {
427 /* Update the toolbar buttons */
428 NewIndex = CurrentGroup->Index + offset;
429 if (m_TaskBar.SetButtonCommandId(CurrentGroup->Index + offset, NewIndex))
430 {
431 CurrentGroup->Index = NewIndex;
432 }
433 else
434 CurrentGroup->Index = -1;
435 }
436
437 CurrentGroup = CurrentGroup->Next;
438 }
439 }
440
441 /* Update all affected task items */
442 CurrentTaskItem = m_TaskItems;
443 LastTaskItem = CurrentTaskItem + m_TaskItemCount;
444 while (CurrentTaskItem != LastTaskItem)
445 {
446 CurrentGroup = CurrentTaskItem->Group;
447 if (CurrentGroup != NULL)
448 {
449 if (!CurrentGroup->IsCollapsed &&
450 CurrentTaskItem->Index >= iIndex)
451 {
452 goto UpdateTaskItemBtn;
453 }
454 }
455 else if (CurrentTaskItem->Index >= iIndex)
456 {
457 UpdateTaskItemBtn:
458 /* Update the toolbar buttons */
459 NewIndex = CurrentTaskItem->Index + offset;
460 if (m_TaskBar.SetButtonCommandId(CurrentTaskItem->Index + offset, NewIndex))
461 {
462 CurrentTaskItem->Index = NewIndex;
463 }
464 else
465 CurrentTaskItem->Index = -1;
466 }
467
468 CurrentTaskItem++;
469 }
470 }
BOOL SetButtonCommandId(IN INT iButtonIndex, IN INT iCommandId)
Definition: taskswnd.cpp:248
GLintptr offset
Definition: glext.h:5920

Referenced by AddTaskItemButton(), and DeleteTaskItemButton().

◆ UpdateTaskGroupButton()

INT CTaskSwitchWnd::UpdateTaskGroupButton ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 473 of file taskswnd.cpp.

474 {
475 ASSERT(TaskGroup->Index >= 0);
476
477 /* FIXME: Implement */
478
479 return TaskGroup->Index;
480 }

Referenced by AddTaskItemButton(), RedrawTaskItem(), and RemoveTaskFromTaskGroup().

◆ UpdateTaskItemButton()

INT CTaskSwitchWnd::UpdateTaskItemButton ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 526 of file taskswnd.cpp.

527 {
528 TBBUTTONINFO tbbi = { 0 };
529 HICON icon;
530 WCHAR windowText[255];
531
532 ASSERT(TaskItem->Index >= 0);
533
534 tbbi.cbSize = sizeof(tbbi);
535 tbbi.dwMask = TBIF_BYINDEX | TBIF_STATE | TBIF_TEXT | TBIF_IMAGE;
536 tbbi.fsState = TBSTATE_ENABLED;
537 if (m_ActiveTaskItem == TaskItem)
538 tbbi.fsState |= TBSTATE_CHECKED;
539
540 if (TaskItem->RenderFlashed)
541 tbbi.fsState |= TBSTATE_MARKED;
542
543 /* Check if we're updating a button that is the last one in the
544 line. If so, we need to set the TBSTATE_WRAP flag! */
545 if (!m_Tray->IsHorizontal() || (m_ButtonsPerLine != 0 &&
546 (TaskItem->Index + 1) % m_ButtonsPerLine == 0))
547 {
548 tbbi.fsState |= TBSTATE_WRAP;
549 }
550
552 {
553 tbbi.pszText = windowText;
554 }
555
556 icon = GetWndIcon(TaskItem->hWnd);
557 if (!icon)
558 icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
559 TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, TaskItem->IconIndex, icon);
560 tbbi.iImage = TaskItem->IconIndex;
561
562 if (!m_TaskBar.SetButtonInfo(TaskItem->Index, &tbbi))
563 {
564 TaskItem->Index = -1;
565 return -1;
566 }
567
568 TRACE("Updated button %d for hwnd 0x%p\n", TaskItem->Index, TaskItem->hWnd);
569 return TaskItem->Index;
570 }
#define TBIF_TEXT
Definition: commctrl.h:1220
#define TBSTATE_MARKED
Definition: commctrl.h:979

Referenced by AddTaskItemButton(), CheckActivateTaskItem(), FlashTaskItem(), RedrawTaskItem(), and UpdateButtonsSize().

Member Data Documentation

◆ m_ActiveTaskItem

PTASK_ITEM CTaskSwitchWnd::m_ActiveTaskItem
private

◆ m_AllocatedTaskItems

WORD CTaskSwitchWnd::m_AllocatedTaskItems
private

Definition at line 310 of file taskswnd.cpp.

Referenced by AllocTaskItem().

◆ m_ButtonCount

WORD CTaskSwitchWnd::m_ButtonCount
private

◆ m_ButtonSize

SIZE CTaskSwitchWnd::m_ButtonSize
private

Definition at line 325 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and UpdateButtonsSize().

◆ m_ButtonsPerLine

UINT CTaskSwitchWnd::m_ButtonsPerLine
private

Definition at line 317 of file taskswnd.cpp.

Referenced by UpdateButtonsSize(), and UpdateTaskItemButton().

◆ m_HardErrorThread

CHardErrorThread CTaskSwitchWnd::m_HardErrorThread
private

Definition at line 328 of file taskswnd.cpp.

Referenced by OnCopyData().

◆ m_ImageList

HIMAGELIST CTaskSwitchWnd::m_ImageList
private

◆ m_IsDestroying

BOOL CTaskSwitchWnd::m_IsDestroying
private

Definition at line 323 of file taskswnd.cpp.

Referenced by AddTask(), DeleteTaskItem(), and OnDestroy().

◆ m_IsGroupingEnabled

◆ m_ShellHookMsg

UINT CTaskSwitchWnd::m_ShellHookMsg
private

Definition at line 307 of file taskswnd.cpp.

Referenced by OnCreate().

◆ m_TaskBar

◆ m_TaskGroups

PTASK_GROUP CTaskSwitchWnd::m_TaskGroups
private

◆ m_TaskItemCount

◆ m_TaskItems

◆ m_Theme

HTHEME CTaskSwitchWnd::m_Theme
private

◆ m_Tray

◆ m_uHardErrorMsg

UINT CTaskSwitchWnd::m_uHardErrorMsg
private

Definition at line 327 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and OnCopyData().


The documentation for this class was generated from the following file: