ReactOS 0.4.15-dev-8434-g155a7c7
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)
 
HRESULT WINAPI GetWindow (HWND *phwnd)
 
HRESULT WINAPI ContextSensitiveHelp (BOOL fEnterMode)
 
- 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 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 295 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CTaskSwitchWnd()

CTaskSwitchWnd::CTaskSwitchWnd ( )
inline

Definition at line 329 of file taskswnd.cpp.

329 :
336 m_Theme(NULL),
338 m_ButtonCount(0),
342 {
345 }
UINT m_ShellHookMsg
Definition: taskswnd.cpp:305
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:312
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:311
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:325
BOOL m_IsDestroying
Definition: taskswnd.cpp:321
WORD m_ButtonCount
Definition: taskswnd.cpp:316
HTHEME m_Theme
Definition: taskswnd.cpp:314
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:310
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:320
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:308
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:318
WORD m_TaskItemCount
Definition: taskswnd.cpp:307
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:315
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define L(x)
Definition: ntvdm.h:50
#define ZeroMemory
Definition: winbase.h:1712
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)

◆ ~CTaskSwitchWnd()

virtual CTaskSwitchWnd::~CTaskSwitchWnd ( )
inlinevirtual

Definition at line 346 of file taskswnd.cpp.

346{ }

Member Function Documentation

◆ ActivateTask()

BOOL CTaskSwitchWnd::ActivateTask ( IN HWND  hWnd)
inline

Definition at line 1139 of file taskswnd.cpp.

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

Referenced by HandleTaskItemRightClick(), and OnShellHook().

◆ ActivateTaskItem()

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

Definition at line 1128 of file taskswnd.cpp.

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

Referenced by ActivateTask().

◆ AddTask()

BOOL CTaskSwitchWnd::AddTask ( IN HWND  hWnd)
inline

Definition at line 1099 of file taskswnd.cpp.

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

Referenced by EnumWindowsProc(), and OnShellHook().

◆ AddTaskItemButton()

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

Definition at line 680 of file taskswnd.cpp.

681 {
682 WCHAR windowText[255];
683 TBBUTTON tbBtn = { 0 };
684 INT iIndex;
685 HICON icon;
686
687 if (TaskItem->Index >= 0)
688 {
689 return UpdateTaskItemButton(TaskItem);
690 }
691
692 if (TaskItem->Group != NULL &&
693 TaskItem->Group->IsCollapsed)
694 {
695 /* The task group is collapsed, we only need to update the group button */
696 return UpdateTaskGroupButton(TaskItem->Group);
697 }
698
699 icon = GetWndIcon(TaskItem->hWnd);
700 if (!icon)
701 icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
702 TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, -1, icon);
703
704 tbBtn.iBitmap = TaskItem->IconIndex;
707 tbBtn.dwData = TaskItem->Index;
708
710 {
711 tbBtn.iString = (DWORD_PTR) windowText;
712 }
713
714 /* Find out where to insert the new button */
715 iIndex = CalculateTaskItemNewButtonIndex(TaskItem);
716 ASSERT(iIndex >= 0);
717 tbBtn.idCommand = iIndex;
718
720
721 if (m_TaskBar.InsertButton(iIndex, &tbBtn))
722 {
723 UpdateIndexesAfter(iIndex, TRUE);
724
725 TRACE("Added button %d for hwnd 0x%p\n", iIndex, TaskItem->hWnd);
726
727 TaskItem->Index = iIndex;
729
730 /* Update button sizes and fix the button wrapping */
732 return iIndex;
733 }
734
736
737 return -1;
738 }
WCHAR windowText[1024]
Definition: appswitch.c:49
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:524
INT GetWndTextFromTaskItem(IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
Definition: taskswnd.cpp:348
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1254
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:301
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:408
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:471
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:489
INT CalculateTaskItemNewButtonIndex(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:636
VOID BeginUpdate()
Definition: taskswnd.cpp:235
VOID EndUpdate()
Definition: taskswnd.cpp:240
#define TRUE
Definition: types.h:120
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2779
#define ASSERT(a)
Definition: mode.c:44
static HICON
Definition: imagelist.c:84
#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:2247
#define LR_SHARED
Definition: winuser.h:1100
#define LR_DEFAULTSIZE
Definition: winuser.h:1094
#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 775 of file taskswnd.cpp.

776 {
777 DWORD dwProcessId;
778 PTASK_GROUP TaskGroup, *PrevLink;
779
781 &dwProcessId))
782 {
783 TRACE("Cannot get process id of hwnd 0x%p\n", hWnd);
784 return NULL;
785 }
786
787 /* Try to find an existing task group */
788 TaskGroup = m_TaskGroups;
789 PrevLink = &m_TaskGroups;
790 while (TaskGroup != NULL)
791 {
792 if (TaskGroup->dwProcessId == dwProcessId)
793 {
794 TaskGroup->dwTaskCount++;
795 return TaskGroup;
796 }
797
798 PrevLink = &TaskGroup->Next;
799 TaskGroup = TaskGroup->Next;
800 }
801
802 /* Allocate a new task group */
803 TaskGroup = (PTASK_GROUP) HeapAlloc(hProcessHeap,
805 sizeof(*TaskGroup));
806 if (TaskGroup != NULL)
807 {
808 TaskGroup->dwTaskCount = 1;
809 TaskGroup->dwProcessId = dwProcessId;
810 TaskGroup->Index = -1;
811
812 /* Add the task group to the list */
813 *PrevLink = TaskGroup;
814 }
815
816 return TaskGroup;
817 }
#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:63
DWORD dwTaskCount
Definition: taskswnd.cpp:65
DWORD dwProcessId
Definition: taskswnd.cpp:66
struct _TASK_GROUP * PTASK_GROUP
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)

Referenced by AddTask().

◆ AllocTaskItem()

PTASK_ITEM CTaskSwitchWnd::AllocTaskItem ( )
inline

Definition at line 923 of file taskswnd.cpp.

924 {
926 {
927 /* We need the most significant bit in 16 bit command IDs to indicate whether it
928 is a task group or task item. WM_COMMAND limits command IDs to 16 bits! */
929 return NULL;
930 }
931
933
934 if (m_TaskItemCount == 0)
935 {
937 0,
939 if (m_TaskItems != NULL)
940 {
942 }
943 else
944 return NULL;
945 }
947 {
948 PTASK_ITEM NewArray;
949 SIZE_T NewArrayLength, ActiveTaskItemIndex;
950
952
954 0,
956 NewArrayLength * sizeof(*m_TaskItems));
957 if (NewArray != NULL)
958 {
959 if (m_ActiveTaskItem != NULL)
960 {
961 /* Fixup the ActiveTaskItem pointer */
962 ActiveTaskItemIndex = m_ActiveTaskItem - m_TaskItems;
963 m_ActiveTaskItem = NewArray + ActiveTaskItemIndex;
964 }
965 m_AllocatedTaskItems = (WORD) NewArrayLength;
966 m_TaskItems = NewArray;
967 }
968 else
969 return NULL;
970 }
971
972 return m_TaskItems + m_TaskItemCount++;
973 }
#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:30
#define MAX_TASKS_COUNT
Definition: taskswnd.cpp:29
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by AddTask().

◆ CalculateTaskItemNewButtonIndex()

INT CTaskSwitchWnd::CalculateTaskItemNewButtonIndex ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 636 of file taskswnd.cpp.

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

Referenced by AddTaskItemButton().

◆ CheckActivateTaskItem()

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

Definition at line 1008 of file taskswnd.cpp.

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

Referenced by ActivateTaskItem().

◆ ContextSensitiveHelp()

HRESULT WINAPI CTaskSwitchWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inline

Implements IOleWindow.

Definition at line 1990 of file taskswnd.cpp.

1991 {
1992 return E_NOTIMPL;
1993 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DeleteAllTasks()

VOID CTaskSwitchWnd::DeleteAllTasks ( )
inline

Definition at line 1180 of file taskswnd.cpp.

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

Referenced by OnDestroy().

◆ DeleteTask()

BOOL CTaskSwitchWnd::DeleteTask ( IN HWND  hWnd)
inline

Definition at line 1163 of file taskswnd.cpp.

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

Referenced by OnShellHook().

◆ DeleteTaskItem()

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

Definition at line 993 of file taskswnd.cpp.

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

Referenced by DeleteAllTasks(), and DeleteTask().

◆ DeleteTaskItemButton()

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

Definition at line 740 of file taskswnd.cpp.

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

Referenced by DeleteTaskItem().

◆ EnumWindowsProc()

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

Definition at line 1389 of file taskswnd.cpp.

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

◆ ExpandTaskGroup()

VOID CTaskSwitchWnd::ExpandTaskGroup ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 480 of file taskswnd.cpp.

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

Referenced by RemoveTaskFromTaskGroup().

◆ FindLastTaskItemOfGroup()

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

Definition at line 598 of file taskswnd.cpp.

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

Referenced by CalculateTaskItemNewButtonIndex().

◆ FindOtherTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindOtherTaskItem ( IN HWND  hWnd)
inline

Definition at line 882 of file taskswnd.cpp.

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

Referenced by ActivateTask().

◆ FindTaskGroupByIndex()

PTASK_GROUP CTaskSwitchWnd::FindTaskGroupByIndex ( IN INT  Index)
inline

Definition at line 1083 of file taskswnd.cpp.

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

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

◆ FindTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindTaskItem ( IN HWND  hWnd)
inline

Definition at line 865 of file taskswnd.cpp.

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

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

◆ FindTaskItemByIndex()

PTASK_ITEM CTaskSwitchWnd::FindTaskItemByIndex ( IN INT  Index)
inline

Definition at line 1066 of file taskswnd.cpp.

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

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

◆ FlashTask()

BOOL CTaskSwitchWnd::FlashTask ( IN HWND  hWnd)
inline

Definition at line 1200 of file taskswnd.cpp.

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

Referenced by OnShellHook().

◆ FlashTaskItem()

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

Definition at line 1194 of file taskswnd.cpp.

1195 {
1196 TaskItem->RenderFlashed = 1;
1197 UpdateTaskItemButton(TaskItem);
1198 }

Referenced by FlashTask().

◆ FreeTaskItem()

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

Definition at line 975 of file taskswnd.cpp.

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

Referenced by DeleteTaskItem().

◆ GetWindow()

HRESULT WINAPI CTaskSwitchWnd::GetWindow ( HWND phwnd)
inline

Implements IOleWindow.

Definition at line 1982 of file taskswnd.cpp.

1983 {
1984 if (!phwnd)
1985 return E_INVALIDARG;
1986 *phwnd = m_hWnd;
1987 return S_OK;
1988 }
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 489 of file taskswnd.cpp.

490 {
491 HICON hIcon = NULL;
492
493 /* Retrieve icon by sending a message */
494#define GET_ICON(type) \
495 SendMessageTimeout(hwnd, WM_GETICON, (type), 0, SMTO_NOTIMEOUTIFNOTHUNG, 100, (PDWORD_PTR)&hIcon)
496
497 LRESULT bAlive = GET_ICON(g_TaskbarSettings.bSmallIcons ? ICON_SMALL2 : ICON_BIG);
498 if (hIcon)
499 return hIcon;
500
501 if (bAlive)
502 {
503 bAlive = GET_ICON(ICON_SMALL);
504 if (hIcon)
505 return hIcon;
506 }
507
508 if (bAlive)
509 {
511 if (hIcon)
512 return hIcon;
513 }
514#undef GET_ICON
515
516 /* If we failed, retrieve icon from the window class */
518 if (hIcon)
519 return hIcon;
520
522 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
HICON hIcon
Definition: msconfig.c:44
BOOL bSmallIcons
Definition: precomp.h:222
#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:675
#define GCLP_HICON
Definition: winuser.h:674
#define GetClassLongPtr
Definition: winuser.h:5791

Referenced by AddTaskItemButton(), and UpdateTaskItemButton().

◆ GetWndTextFromTaskItem()

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

Definition at line 348 of file taskswnd.cpp.

349 {
350 /* Get the window text without sending a message so we don't hang if an
351 application isn't responding! */
352 return InternalGetWindowText(TaskItem->hWnd, szBuf, cchBuf);
353 }
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 1479 of file taskswnd.cpp.

1480 {
1481 BOOL Ret = FALSE;
1482
1483 switch (GET_APPCOMMAND_LPARAM(lParam))
1484 {
1485 case APPCOMMAND_BROWSER_SEARCH:
1486 Ret = SHFindFiles(NULL,
1487 NULL);
1488 break;
1489
1490 case APPCOMMAND_BROWSER_HOME:
1491 case APPCOMMAND_LAUNCH_MAIL:
1492 default:
1493 TRACE("Shell app command %d unhandled!\n", (INT) GET_APPCOMMAND_LPARAM(lParam));
1494 break;
1495 }
1496
1497 return Ret;
1498 }
LPARAM lParam
Definition: combotst.c:139
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2462

Referenced by OnShellHook().

◆ HandleButtonClick()

BOOL CTaskSwitchWnd::HandleButtonClick ( IN WORD  wIndex)
inline

Definition at line 1622 of file taskswnd.cpp.

1623 {
1624 PTASK_ITEM TaskItem;
1625 PTASK_GROUP TaskGroup;
1626
1628 {
1629 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1630 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1631 {
1632 HandleTaskGroupClick(TaskGroup);
1633 return TRUE;
1634 }
1635 }
1636
1637 TaskItem = FindTaskItemByIndex((INT) wIndex);
1638 if (TaskItem != NULL)
1639 {
1640 SendPulseToTray(FALSE, TaskItem->hWnd);
1641 HandleTaskItemClick(TaskItem);
1642 return TRUE;
1643 }
1644
1645 return FALSE;
1646 }
VOID SendPulseToTray(BOOL bDelete, HWND hwndActive)
Definition: taskswnd.cpp:1473
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1083
VOID HandleTaskGroupClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1617
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1066
VOID HandleTaskItemClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1585

Referenced by OnCommand().

◆ HandleButtonRightClick()

BOOL CTaskSwitchWnd::HandleButtonRightClick ( IN WORD  wIndex)
inline

Definition at line 1675 of file taskswnd.cpp.

1676 {
1677 PTASK_ITEM TaskItem;
1678 PTASK_GROUP TaskGroup;
1680 {
1681 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1682 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1683 {
1684 HandleTaskGroupRightClick(TaskGroup);
1685 return TRUE;
1686 }
1687 }
1688
1689 TaskItem = FindTaskItemByIndex((INT) wIndex);
1690
1691 if (TaskItem != NULL)
1692 {
1693 HandleTaskItemRightClick(TaskItem);
1694 return TRUE;
1695 }
1696
1697 return FALSE;
1698 }
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1670
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1654

Referenced by OnContextMenu().

◆ HandleItemPaint()

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

Definition at line 1701 of file taskswnd.cpp.

1702 {
1703 LRESULT Ret = CDRF_DODEFAULT;
1704 PTASK_GROUP TaskGroup;
1705 PTASK_ITEM TaskItem;
1706
1707 TaskItem = FindTaskItemByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1708 TaskGroup = FindTaskGroupByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1709 if (TaskGroup == NULL && TaskItem != NULL)
1710 {
1711 ASSERT(TaskItem != NULL);
1712
1713 if (TaskItem != NULL && ::IsWindow(TaskItem->hWnd))
1714 {
1715 /* Make the entire button flashing if necessary */
1716 if (nmtbcd->nmcd.uItemState & CDIS_MARKED)
1717 {
1718 Ret = TBCDRF_NOBACKGROUND;
1719 if (!m_Theme)
1720 {
1721 SelectObject(nmtbcd->nmcd.hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
1722 Rectangle(nmtbcd->nmcd.hdc,
1723 nmtbcd->nmcd.rc.left,
1724 nmtbcd->nmcd.rc.top,
1725 nmtbcd->nmcd.rc.right,
1726 nmtbcd->nmcd.rc.bottom);
1727 }
1728 else
1729 {
1730 DrawThemeBackground(m_Theme, nmtbcd->nmcd.hdc, TDP_FLASHBUTTON, 0, &nmtbcd->nmcd.rc, 0);
1731 }
1732 nmtbcd->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
1733 return Ret;
1734 }
1735 }
1736 }
1737 else if (TaskGroup != NULL)
1738 {
1739 /* FIXME: Implement painting for task groups */
1740 }
1741 return Ret;
1742 }
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:926
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:927

Referenced by HandleToolbarNotification().

◆ HandleTaskGroupClick()

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

Definition at line 1617 of file taskswnd.cpp.

1618 {
1619 /* TODO: Show task group menu */
1620 }

Referenced by HandleButtonClick().

◆ HandleTaskGroupRightClick()

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

Definition at line 1670 of file taskswnd.cpp.

1671 {
1672 /* TODO: Show task group right click menu */
1673 }

Referenced by HandleButtonRightClick().

◆ HandleTaskItemClick()

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

Definition at line 1585 of file taskswnd.cpp.

1586 {
1587 BOOL bIsMinimized;
1588 BOOL bIsActive;
1589
1590 if (::IsWindow(TaskItem->hWnd))
1591 {
1592 bIsMinimized = ::IsIconic(TaskItem->hWnd);
1593 bIsActive = (TaskItem == m_ActiveTaskItem);
1594
1595 TRACE("Active TaskItem %p, selected TaskItem %p\n", m_ActiveTaskItem, TaskItem);
1596 if (m_ActiveTaskItem)
1597 TRACE("Active TaskItem hWnd=%p, TaskItem hWnd %p\n", m_ActiveTaskItem->hWnd, TaskItem->hWnd);
1598
1599 TRACE("Valid button clicked. HWND=%p, IsMinimized=%s, IsActive=%s...\n",
1600 TaskItem->hWnd, bIsMinimized ? "Yes" : "No", bIsActive ? "Yes" : "No");
1601
1602 if (!bIsMinimized && bIsActive)
1603 {
1604 if (!::IsHungAppWindow(TaskItem->hWnd))
1605 ::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE);
1606 TRACE("Valid button clicked. App window Minimized.\n");
1607 }
1608 else
1609 {
1610 ::SwitchToThisWindow(TaskItem->hWnd, TRUE);
1611
1612 TRACE("Valid button clicked. App window Restored.\n");
1613 }
1614 }
1615 }
BOOL IsIconic() const
Definition: atlwin.h:932
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
BOOL WINAPI IsHungAppWindow(HWND hwnd)
Definition: window.c:1847
#define SW_MINIMIZE
Definition: winuser.h:776
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)

Referenced by HandleButtonClick().

◆ HandleTaskItemRightClick()

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

Definition at line 1654 of file taskswnd.cpp.

1655 {
1656 POINT pt;
1657 GetCursorPos(&pt);
1658
1659 SetForegroundWindow(TaskItem->hWnd);
1660
1661 ActivateTask(TaskItem->hWnd);
1662
1663 if (GetForegroundWindow() != TaskItem->hWnd)
1664 ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
1665
1666 ::SendMessageCallbackW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y),
1667 SendAsyncProc, (ULONG_PTR)TaskItem);
1668 }
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1139
static VOID CALLBACK SendAsyncProc(HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
Definition: taskswnd.cpp:1649
#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:4008
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2714
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 1744 of file taskswnd.cpp.

1745 {
1746 LRESULT Ret = 0;
1747
1748 switch (nmh->code)
1749 {
1750 case NM_CUSTOMDRAW:
1751 {
1752 LPNMTBCUSTOMDRAW nmtbcd = (LPNMTBCUSTOMDRAW) nmh;
1753
1754 switch (nmtbcd->nmcd.dwDrawStage)
1755 {
1756
1757 case CDDS_ITEMPREPAINT:
1758 Ret = HandleItemPaint(nmtbcd);
1759 break;
1760
1761 case CDDS_PREPAINT:
1762 Ret = CDRF_NOTIFYITEMDRAW;
1763 break;
1764
1765 default:
1766 Ret = CDRF_DODEFAULT;
1767 break;
1768 }
1769 break;
1770 }
1771 }
1772
1773 return Ret;
1774 }
LRESULT HandleItemPaint(IN OUT NMTBCUSTOMDRAW *nmtbcd)
Definition: taskswnd.cpp:1701
#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 1972 of file taskswnd.cpp.

1973 {
1974 m_Tray = tray;
1977 if (!m_hWnd)
1978 return E_FAIL;
1979 return S_OK;
1980 }
@ 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:218
const WCHAR szRunningApps[]
Definition: taskswnd.cpp:33

◆ OnCommand()

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

Definition at line 1819 of file taskswnd.cpp.

1820 {
1821 LRESULT Ret = TRUE;
1822 if (lParam != 0 && (HWND) lParam == m_TaskBar.m_hWnd)
1823 {
1825 }
1826 return Ret;
1827 }
BOOL HandleButtonClick(IN WORD wIndex)
Definition: taskswnd.cpp:1622
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 1876 of file taskswnd.cpp.

1877 {
1878 LRESULT Ret = 0;
1879 INT_PTR iBtn = -1;
1880
1881 if (m_TaskBar.m_hWnd != NULL)
1882 {
1883 POINT pt;
1884
1885 pt.x = GET_X_LPARAM(lParam);
1886 pt.y = GET_Y_LPARAM(lParam);
1887
1889
1890 iBtn = m_TaskBar.HitTest(&pt);
1891 if (iBtn >= 0)
1892 {
1894 }
1895 }
1896 if (iBtn < 0)
1897 {
1898 /* Not on a taskbar button, so forward message to tray */
1899 Ret = SendMessage(m_Tray->GetHWND(), uMsg, wParam, lParam);
1900 }
1901 return Ret;
1902 }
BOOL HandleButtonRightClick(IN WORD wIndex)
Definition: taskswnd.cpp:1675
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:5852
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

◆ OnCopyData()

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

Definition at line 1956 of file taskswnd.cpp.

1957 {
1959 if (cpData->dwData == m_uHardErrorMsg)
1960 {
1961 /* A hard error balloon message */
1963 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));
1964 if (pData->cbHeaderSize == sizeof(BALLOON_HARD_ERROR_DATA))
1966 return TRUE;
1967 }
1968
1969 return FALSE;
1970 }
void StartThread(PBALLOON_HARD_ERROR_DATA pData)
Definition: taskswnd.cpp:178
CHardErrorThread m_HardErrorThread
Definition: taskswnd.cpp:326
#define ULONG_PTR
Definition: config.h:101
ULONG_PTR dwData
Definition: winuser.h:3001
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 1428 of file taskswnd.cpp.

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

◆ OnDestroy()

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

Definition at line 1461 of file taskswnd.cpp.

1462 {
1464
1465 /* Unregister the shell hook */
1467
1470 return TRUE;
1471 }
VOID DeleteAllTasks()
Definition: taskswnd.cpp:1180
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950

◆ OnEraseBackground()

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

Definition at line 1776 of file taskswnd.cpp.

1777 {
1778 HDC hdc = (HDC) wParam;
1779
1780 if (!IsAppThemed())
1781 {
1782 bHandled = FALSE;
1783 return 0;
1784 }
1785
1786 RECT rect;
1789
1790 return TRUE;
1791 }
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
BOOL WINAPI IsAppThemed(void)
Definition: system.c:596
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
& 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 1904 of file taskswnd.cpp.

1905 {
1906 PTASK_ITEM TaskItem = FindTaskItem((HWND) wParam);
1907 if (TaskItem)
1908 {
1909 RECT* prcMinRect = (RECT*) lParam;
1910 RECT rcItem, rcToolbar;
1911 m_TaskBar.GetItemRect(TaskItem->Index, &rcItem);
1912 m_TaskBar.GetWindowRect(&rcToolbar);
1913
1914 OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top);
1915
1916 *prcMinRect = rcItem;
1917 return TRUE;
1918 }
1919 return FALSE;
1920 }
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 1922 of file taskswnd.cpp.

1923 {
1924 return MA_NOACTIVATE;
1925 }
#define MA_NOACTIVATE
Definition: winuser.h:2503

◆ OnNcHitTest()

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

Definition at line 1808 of file taskswnd.cpp.

1809 {
1810 LRESULT Ret = TRUE;
1811 /* We want the tray window to be draggable everywhere, so make the control
1812 appear transparent */
1813 Ret = DefWindowProc(uMsg, wParam, lParam);
1814 if (Ret != HTVSCROLL && Ret != HTHSCROLL)
1815 Ret = HTTRANSPARENT;
1816 return Ret;
1817 }
#define DefWindowProc
Definition: ros2win.h:31
#define HTVSCROLL
Definition: winuser.h:2482
#define HTHSCROLL
Definition: winuser.h:2481
#define HTTRANSPARENT
Definition: winuser.h:2473

◆ OnNotify()

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

Definition at line 1829 of file taskswnd.cpp.

1830 {
1831 LRESULT Ret = TRUE;
1832 const NMHDR *nmh = (const NMHDR *) lParam;
1833
1834 if (nmh->hwndFrom == m_TaskBar.m_hWnd)
1835 {
1836 Ret = HandleToolbarNotification(nmh);
1837 }
1838 return Ret;
1839 }
LRESULT HandleToolbarNotification(IN const NMHDR *nmh)
Definition: taskswnd.cpp:1744
HWND hwndFrom
Definition: winuser.h:3157

◆ OnSetFont()

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

Definition at line 1940 of file taskswnd.cpp.

1941 {
1942 return m_TaskBar.SendMessageW(uMsg, wParam, lParam);
1943 }

◆ OnSettingChanged()

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

Definition at line 1945 of file taskswnd.cpp.

1946 {
1947 if (wParam == SPI_SETNONCLIENTMETRICS)
1948 {
1949 /* Don't update the font, this will be done when we get a WM_SETFONT from our parent */
1951 }
1952
1953 return 0;
1954 }

◆ OnShellHook()

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

Definition at line 1500 of file taskswnd.cpp.

1501 {
1502 BOOL Ret = FALSE;
1503
1504 /* In case the shell hook wasn't registered properly, ignore WM_NULLs*/
1505 if (uMsg == 0)
1506 {
1507 bHandled = FALSE;
1508 return 0;
1509 }
1510
1511 TRACE("Received shell hook message: wParam=%08lx, lParam=%08lx\n", wParam, lParam);
1512
1513 switch ((INT) wParam)
1514 {
1515 case HSHELL_APPCOMMAND:
1517 break;
1518
1521 AddTask((HWND) lParam);
1522 break;
1523
1525 /* The window still exists! Delay destroying it a bit */
1528 break;
1529
1531 case HSHELL_WINDOWACTIVATED:
1534 break;
1535
1536 case HSHELL_FLASH:
1538 break;
1539
1540 case HSHELL_REDRAW:
1542 break;
1543
1544 case HSHELL_TASKMAN:
1545 ::PostMessage(m_Tray->GetHWND(), TWM_OPENSTARTMENU, 0, 0);
1546 break;
1547
1549 ::SwitchToThisWindow(m_Tray->GetHWND(), TRUE);
1550 ::SetForegroundWindow(m_Tray->GetHWND());
1551 break;
1552
1553 case HSHELL_LANGUAGE:
1554 case HSHELL_SYSMENU:
1555 case HSHELL_ENDTASK:
1556 case HSHELL_ACCESSIBILITYSTATE:
1557 case HSHELL_WINDOWREPLACED:
1558 case HSHELL_WINDOWREPLACING:
1559
1560 case HSHELL_GETMINRECT:
1561 default:
1562 {
1563#if DEBUG_SHELL_HOOK
1564 int i, found;
1565 for (i = 0, found = 0; i != _countof(hshell_msg); i++)
1566 {
1567 if (hshell_msg[i].msg == (INT) wParam)
1568 {
1569 TRACE("Shell message %ws unhandled (lParam = 0x%p)!\n", hshell_msg[i].msg_name, lParam);
1570 found = 1;
1571 break;
1572 }
1573 }
1574 if (found)
1575 break;
1576#endif
1577 TRACE("Shell message %d unhandled (lParam = 0x%p)!\n", (INT) wParam, lParam);
1578 break;
1579 }
1580 }
1581
1582 return Ret;
1583 }
#define msg(x)
Definition: auth_time.c:54
#define TWM_OPENSTARTMENU
Definition: precomp.h:132
BOOL HandleAppCommand(IN WPARAM wParam, IN LPARAM lParam)
Definition: taskswnd.cpp:1479
BOOL FlashTask(IN HWND hWnd)
Definition: taskswnd.cpp:1200
BOOL RedrawTask(IN HWND hWnd)
Definition: taskswnd.cpp:1240
BOOL DeleteTask(IN HWND hWnd)
Definition: taskswnd.cpp:1163
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:1281
#define HSHELL_ACTIVATESHELLWINDOW
Definition: winuser.h:1257
#define HSHELL_WINDOWDESTROYED
Definition: winuser.h:1256
#define HSHELL_WINDOWCREATED
Definition: winuser.h:1255
#define HSHELL_FLASH
Definition: winuser.h:1280
#define PostMessage
Definition: winuser.h:5841

◆ OnSize()

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

Definition at line 1793 of file taskswnd.cpp.

1794 {
1795 SIZE szClient;
1796
1797 szClient.cx = LOWORD(lParam);
1798 szClient.cy = HIWORD(lParam);
1799 if (m_TaskBar.m_hWnd != NULL)
1800 {
1801 m_TaskBar.SetWindowPos(NULL, 0, 0, szClient.cx, szClient.cy, SWP_NOZORDER);
1802
1804 }
1805 return TRUE;
1806 }
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:1247

◆ OnTaskbarSettingsChanged()

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

Definition at line 1848 of file taskswnd.cpp.

1849 {
1850 BOOL bSettingsChanged = FALSE;
1851 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
1852
1853 if (newSettings->bGroupButtons != g_TaskbarSettings.bGroupButtons)
1854 {
1855 bSettingsChanged = TRUE;
1858 }
1859
1860 if (newSettings->bSmallIcons != g_TaskbarSettings.bSmallIcons)
1861 {
1862 bSettingsChanged = TRUE;
1864 }
1865
1866 if (bSettingsChanged)
1867 {
1868 /* Refresh each task item view */
1871 }
1872
1873 return 0;
1874 }

◆ OnThemeChanged()

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

Definition at line 1413 of file taskswnd.cpp.

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

◆ OnTimer()

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

Definition at line 1927 of file taskswnd.cpp.

1928 {
1929#if DUMP_TASKS != 0
1930 switch (wParam)
1931 {
1932 case 1:
1933 DumpTasks();
1934 break;
1935 }
1936#endif
1937 return TRUE;
1938 }

◆ OnUpdateTaskbarPos()

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

Definition at line 1841 of file taskswnd.cpp.

1842 {
1843 /* Update the button spacing */
1844 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1845 return TRUE;
1846 }

◆ RedrawTask()

BOOL CTaskSwitchWnd::RedrawTask ( IN HWND  hWnd)
inline

Definition at line 1240 of file taskswnd.cpp.

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

Referenced by OnShellHook().

◆ RedrawTaskItem()

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

Definition at line 1215 of file taskswnd.cpp.

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

Referenced by RedrawTask().

◆ RefreshWindowList()

BOOL CTaskSwitchWnd::RefreshWindowList ( )
inline

Definition at line 1406 of file taskswnd.cpp.

1407 {
1408 TRACE("Refreshing window list...\n");
1409 /* Add all windows to the toolbar */
1410 return EnumWindows(s_EnumWindowsProc, (LPARAM)this);
1411 }
static BOOL CALLBACK s_EnumWindowsProc(IN HWND hWnd, IN LPARAM lParam)
Definition: taskswnd.cpp:1399
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 570 of file taskswnd.cpp.

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

Referenced by DeleteTaskItemButton().

◆ RemoveTaskFromTaskGroup()

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

Definition at line 819 of file taskswnd.cpp.

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

1400 {
1402
1403 return This->EnumWindowsProc(hWnd);
1404 }

Referenced by RefreshWindowList().

◆ SendAsyncProc()

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

Definition at line 1649 of file taskswnd.cpp.

1650 {
1651 ::PostMessageW(hwnd, WM_NULL, 0, 0);
1652 }
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NULL
Definition: winuser.h:1607

Referenced by HandleTaskItemRightClick().

◆ SendPulseToTray()

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

Definition at line 1473 of file taskswnd.cpp.

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

Referenced by HandleButtonClick(), and OnShellHook().

◆ UpdateButtonsSize()

VOID CTaskSwitchWnd::UpdateButtonsSize ( IN BOOL  bRedrawDisabled)
inline

Definition at line 1254 of file taskswnd.cpp.

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

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

◆ UpdateIndexesAfter()

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

Definition at line 408 of file taskswnd.cpp.

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

Referenced by AddTaskItemButton(), and DeleteTaskItemButton().

◆ UpdateTaskGroupButton()

INT CTaskSwitchWnd::UpdateTaskGroupButton ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 471 of file taskswnd.cpp.

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

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

◆ UpdateTaskItemButton()

INT CTaskSwitchWnd::UpdateTaskItemButton ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 524 of file taskswnd.cpp.

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

Referenced by AllocTaskItem().

◆ m_ButtonCount

WORD CTaskSwitchWnd::m_ButtonCount
private

◆ m_ButtonSize

SIZE CTaskSwitchWnd::m_ButtonSize
private

Definition at line 323 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and UpdateButtonsSize().

◆ m_ButtonsPerLine

UINT CTaskSwitchWnd::m_ButtonsPerLine
private

Definition at line 315 of file taskswnd.cpp.

Referenced by UpdateButtonsSize(), and UpdateTaskItemButton().

◆ m_HardErrorThread

CHardErrorThread CTaskSwitchWnd::m_HardErrorThread
private

Definition at line 326 of file taskswnd.cpp.

Referenced by OnCopyData().

◆ m_ImageList

HIMAGELIST CTaskSwitchWnd::m_ImageList
private

◆ m_IsDestroying

BOOL CTaskSwitchWnd::m_IsDestroying
private

Definition at line 321 of file taskswnd.cpp.

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

◆ m_IsGroupingEnabled

◆ m_ShellHookMsg

UINT CTaskSwitchWnd::m_ShellHookMsg
private

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

Referenced by CTaskSwitchWnd(), and OnCopyData().


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