ReactOS 0.4.15-dev-5669-g09dde2c
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)
 
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 296 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CTaskSwitchWnd()

CTaskSwitchWnd::CTaskSwitchWnd ( )
inline

Definition at line 330 of file taskswnd.cpp.

330 :
337 m_Theme(NULL),
339 m_ButtonCount(0),
343 {
346 }
UINT m_ShellHookMsg
Definition: taskswnd.cpp:306
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:313
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:312
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:326
BOOL m_IsDestroying
Definition: taskswnd.cpp:322
WORD m_ButtonCount
Definition: taskswnd.cpp:317
HTHEME m_Theme
Definition: taskswnd.cpp:315
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:311
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:321
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:309
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:319
WORD m_TaskItemCount
Definition: taskswnd.cpp:308
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:316
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define L(x)
Definition: ntvdm.h:50
#define ZeroMemory
Definition: winbase.h:1670
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)

◆ ~CTaskSwitchWnd()

virtual CTaskSwitchWnd::~CTaskSwitchWnd ( )
inlinevirtual

Definition at line 347 of file taskswnd.cpp.

347{ }

Member Function Documentation

◆ ActivateTask()

BOOL CTaskSwitchWnd::ActivateTask ( IN HWND  hWnd)
inline

Definition at line 1138 of file taskswnd.cpp.

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

Referenced by HandleTaskItemRightClick(), and OnShellHook().

◆ ActivateTaskItem()

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

Definition at line 1126 of file taskswnd.cpp.

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

Referenced by ActivateTask().

◆ AddTask()

BOOL CTaskSwitchWnd::AddTask ( IN HWND  hWnd)
inline

Definition at line 1097 of file taskswnd.cpp.

1098 {
1099 PTASK_ITEM TaskItem;
1100
1101 if (!::IsWindow(hWnd) || m_Tray->IsSpecialHWND(hWnd))
1102 return FALSE;
1103
1104 TaskItem = FindTaskItem(hWnd);
1105 if (TaskItem == NULL)
1106 {
1107 TRACE("Add window 0x%p\n", hWnd);
1108 TaskItem = AllocTaskItem();
1109 if (TaskItem != NULL)
1110 {
1111 ZeroMemory(TaskItem, sizeof(*TaskItem));
1112 TaskItem->hWnd = hWnd;
1113 TaskItem->Index = -1;
1114 TaskItem->Group = AddToTaskGroup(hWnd);
1115
1116 if (!m_IsDestroying)
1117 {
1118 AddTaskItemButton(TaskItem);
1119 }
1120 }
1121 }
1122
1123 return TaskItem != NULL;
1124 }
BOOL IsWindow() const
Definition: atlwin.h:941
PTASK_GROUP AddToTaskGroup(IN HWND hWnd)
Definition: taskswnd.cpp:773
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:304
PTASK_ITEM AllocTaskItem()
Definition: taskswnd.cpp:921
INT AddTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:678
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 678 of file taskswnd.cpp.

679 {
680 WCHAR windowText[255];
681 TBBUTTON tbBtn = { 0 };
682 INT iIndex;
683 HICON icon;
684
685 if (TaskItem->Index >= 0)
686 {
687 return UpdateTaskItemButton(TaskItem);
688 }
689
690 if (TaskItem->Group != NULL &&
691 TaskItem->Group->IsCollapsed)
692 {
693 /* The task group is collapsed, we only need to update the group button */
694 return UpdateTaskGroupButton(TaskItem->Group);
695 }
696
697 icon = GetWndIcon(TaskItem->hWnd);
698 if (!icon)
700 TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, -1, icon);
701
702 tbBtn.iBitmap = TaskItem->IconIndex;
705 tbBtn.dwData = TaskItem->Index;
706
708 {
709 tbBtn.iString = (DWORD_PTR) windowText;
710 }
711
712 /* Find out where to insert the new button */
713 iIndex = CalculateTaskItemNewButtonIndex(TaskItem);
714 ASSERT(iIndex >= 0);
715 tbBtn.idCommand = iIndex;
716
718
719 if (m_TaskBar.InsertButton(iIndex, &tbBtn))
720 {
721 UpdateIndexesAfter(iIndex, TRUE);
722
723 TRACE("Added button %d for hwnd 0x%p\n", iIndex, TaskItem->hWnd);
724
725 TaskItem->Index = iIndex;
727
728 /* Update button sizes and fix the button wrapping */
730 return iIndex;
731 }
732
734
735 return -1;
736 }
WCHAR windowText[1024]
Definition: appswitch.c:49
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:522
INT GetWndTextFromTaskItem(IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
Definition: taskswnd.cpp:349
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1253
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:302
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:409
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:472
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:490
INT CalculateTaskItemNewButtonIndex(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:634
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:68
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
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define OIC_SAMPLE
Definition: winuser.h:1152
#define IMAGE_ICON
Definition: winuser.h:212
#define LR_SHARED
Definition: winuser.h:1094
#define LR_DEFAULTSIZE
Definition: winuser.h:1088
#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 773 of file taskswnd.cpp.

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

922 {
924 {
925 /* We need the most significant bit in 16 bit command IDs to indicate whether it
926 is a task group or task item. WM_COMMAND limits command IDs to 16 bits! */
927 return NULL;
928 }
929
931
932 if (m_TaskItemCount == 0)
933 {
935 0,
937 if (m_TaskItems != NULL)
938 {
940 }
941 else
942 return NULL;
943 }
945 {
946 PTASK_ITEM NewArray;
947 SIZE_T NewArrayLength, ActiveTaskItemIndex;
948
950
952 0,
954 NewArrayLength * sizeof(*m_TaskItems));
955 if (NewArray != NULL)
956 {
957 if (m_ActiveTaskItem != NULL)
958 {
959 /* Fixup the ActiveTaskItem pointer */
960 ActiveTaskItemIndex = m_ActiveTaskItem - m_TaskItems;
961 m_ActiveTaskItem = NewArray + ActiveTaskItemIndex;
962 }
963 m_AllocatedTaskItems = (WORD) NewArrayLength;
964 m_TaskItems = NewArray;
965 }
966 else
967 return NULL;
968 }
969
970 return m_TaskItems + m_TaskItemCount++;
971 }
#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 634 of file taskswnd.cpp.

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

Referenced by AddTaskItemButton().

◆ CheckActivateTaskItem()

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

Definition at line 1006 of file taskswnd.cpp.

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

Referenced by ActivateTaskItem().

◆ ContextSensitiveHelp()

HRESULT WINAPI CTaskSwitchWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inline

Implements IOleWindow.

Definition at line 1971 of file taskswnd.cpp.

1972 {
1973 return E_NOTIMPL;
1974 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DeleteAllTasks()

VOID CTaskSwitchWnd::DeleteAllTasks ( )
inline

Definition at line 1179 of file taskswnd.cpp.

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

Referenced by OnDestroy().

◆ DeleteTask()

BOOL CTaskSwitchWnd::DeleteTask ( IN HWND  hWnd)
inline

Definition at line 1162 of file taskswnd.cpp.

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

Referenced by OnShellHook().

◆ DeleteTaskItem()

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

Definition at line 991 of file taskswnd.cpp.

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

Referenced by DeleteAllTasks(), and DeleteTask().

◆ DeleteTaskItemButton()

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

Definition at line 738 of file taskswnd.cpp.

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

Referenced by DeleteTaskItem().

◆ EnumWindowsProc()

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

Definition at line 1385 of file taskswnd.cpp.

1386 {
1387 /* Only show windows that still exist and are visible and none of explorer's
1388 special windows (such as the desktop or the tray window) */
1390 !m_Tray->IsSpecialHWND(hWnd))
1391 {
1393 /* Don't list popup windows and also no tool windows */
1394 if ((::GetWindow(hWnd, GW_OWNER) == NULL || exStyle & WS_EX_APPWINDOW) &&
1395 !(exStyle & WS_EX_TOOLWINDOW))
1396 {
1397 TRACE("Adding task for %p...\n", hWnd);
1398 AddTask(hWnd);
1399 }
1400
1401 }
1402
1403 return TRUE;
1404 }
BOOL IsWindowVisible() const
Definition: atlwin.h:952
HRESULT WINAPI GetWindow(HWND *phwnd)
Definition: taskswnd.cpp:1963
BOOL AddTask(IN HWND hWnd)
Definition: taskswnd.cpp:1097
#define GW_OWNER
Definition: winuser.h:761
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define GetWindowLong
Definition: winuser.h:5786
#define GWL_EXSTYLE
Definition: winuser.h:845

◆ ExpandTaskGroup()

VOID CTaskSwitchWnd::ExpandTaskGroup ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 481 of file taskswnd.cpp.

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

Referenced by RemoveTaskFromTaskGroup().

◆ FindLastTaskItemOfGroup()

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

Definition at line 596 of file taskswnd.cpp.

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

Referenced by CalculateTaskItemNewButtonIndex().

◆ FindOtherTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindOtherTaskItem ( IN HWND  hWnd)
inline

Definition at line 880 of file taskswnd.cpp.

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

Referenced by ActivateTask().

◆ FindTaskGroupByIndex()

PTASK_GROUP CTaskSwitchWnd::FindTaskGroupByIndex ( IN INT  Index)
inline

Definition at line 1081 of file taskswnd.cpp.

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

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

◆ FindTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindTaskItem ( IN HWND  hWnd)
inline

Definition at line 863 of file taskswnd.cpp.

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

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

◆ FindTaskItemByIndex()

PTASK_ITEM CTaskSwitchWnd::FindTaskItemByIndex ( IN INT  Index)
inline

Definition at line 1064 of file taskswnd.cpp.

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

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

◆ FlashTask()

BOOL CTaskSwitchWnd::FlashTask ( IN HWND  hWnd)
inline

Definition at line 1199 of file taskswnd.cpp.

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

Referenced by OnShellHook().

◆ FlashTaskItem()

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

Definition at line 1193 of file taskswnd.cpp.

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

Referenced by FlashTask().

◆ FreeTaskItem()

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

Definition at line 973 of file taskswnd.cpp.

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

Referenced by DeleteTaskItem().

◆ GetWindow()

HRESULT WINAPI CTaskSwitchWnd::GetWindow ( HWND phwnd)
inline

Implements IOleWindow.

Definition at line 1963 of file taskswnd.cpp.

1964 {
1965 if (!phwnd)
1966 return E_INVALIDARG;
1967 *phwnd = m_hWnd;
1968 return S_OK;
1969 }
HWND m_hWnd
Definition: atlwin.h:267
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52

Referenced by EnumWindowsProc().

◆ GetWndIcon()

HICON CTaskSwitchWnd::GetWndIcon ( HWND  hwnd)
inline

Definition at line 490 of file taskswnd.cpp.

491 {
492 HICON hIcon = NULL;
493#define GET_ICON(type) \
494 SendMessageTimeout(hwnd, WM_GETICON, (type), 0, SMTO_NOTIMEOUTIFNOTHUNG, 100, (PDWORD_PTR)&hIcon)
495
496 LRESULT bAlive = GET_ICON(ICON_SMALL2);
497 if (hIcon)
498 return hIcon;
499
500 if (bAlive)
501 {
502 bAlive = GET_ICON(ICON_SMALL);
503 if (hIcon)
504 return hIcon;
505 }
506
507 if (bAlive)
508 {
510 if (hIcon)
511 return hIcon;
512 }
513#undef GET_ICON
514
516 if (hIcon)
517 return hIcon;
518
520 }
HICON hIcon
Definition: msconfig.c:44
#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:670
#define GCLP_HICON
Definition: winuser.h:669
#define GetClassLongPtr
Definition: winuser.h:5772

Referenced by AddTaskItemButton(), and UpdateTaskItemButton().

◆ GetWndTextFromTaskItem()

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

Definition at line 349 of file taskswnd.cpp.

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

1479 {
1480 BOOL Ret = FALSE;
1481
1482 switch (GET_APPCOMMAND_LPARAM(lParam))
1483 {
1484 case APPCOMMAND_BROWSER_SEARCH:
1485 Ret = SHFindFiles(NULL,
1486 NULL);
1487 break;
1488
1489 case APPCOMMAND_BROWSER_HOME:
1490 case APPCOMMAND_LAUNCH_MAIL:
1491 default:
1492 TRACE("Shell app command %d unhandled!\n", (INT) GET_APPCOMMAND_LPARAM(lParam));
1493 break;
1494 }
1495
1496 return Ret;
1497 }
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:2222

Referenced by OnShellHook().

◆ HandleButtonClick()

BOOL CTaskSwitchWnd::HandleButtonClick ( IN WORD  wIndex)
inline

Definition at line 1616 of file taskswnd.cpp.

1617 {
1618 PTASK_ITEM TaskItem;
1619 PTASK_GROUP TaskGroup;
1620
1622 {
1623 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1624 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1625 {
1626 HandleTaskGroupClick(TaskGroup);
1627 return TRUE;
1628 }
1629 }
1630
1631 TaskItem = FindTaskItemByIndex((INT) wIndex);
1632 if (TaskItem != NULL)
1633 {
1634 HandleTaskItemClick(TaskItem);
1635 return TRUE;
1636 }
1637
1638 return FALSE;
1639 }
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1081
VOID HandleTaskGroupClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1611
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1064
VOID HandleTaskItemClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1581

Referenced by OnCommand().

◆ HandleButtonRightClick()

BOOL CTaskSwitchWnd::HandleButtonRightClick ( IN WORD  wIndex)
inline

Definition at line 1668 of file taskswnd.cpp.

1669 {
1670 PTASK_ITEM TaskItem;
1671 PTASK_GROUP TaskGroup;
1673 {
1674 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1675 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1676 {
1677 HandleTaskGroupRightClick(TaskGroup);
1678 return TRUE;
1679 }
1680 }
1681
1682 TaskItem = FindTaskItemByIndex((INT) wIndex);
1683
1684 if (TaskItem != NULL)
1685 {
1686 HandleTaskItemRightClick(TaskItem);
1687 return TRUE;
1688 }
1689
1690 return FALSE;
1691 }
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1663
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1647

Referenced by OnContextMenu().

◆ HandleItemPaint()

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

Definition at line 1694 of file taskswnd.cpp.

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

Referenced by HandleToolbarNotification().

◆ HandleTaskGroupClick()

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

Definition at line 1611 of file taskswnd.cpp.

1612 {
1613 /* TODO: Show task group menu */
1614 }

Referenced by HandleButtonClick().

◆ HandleTaskGroupRightClick()

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

Definition at line 1663 of file taskswnd.cpp.

1664 {
1665 /* TODO: Show task group right click menu */
1666 }

Referenced by HandleButtonRightClick().

◆ HandleTaskItemClick()

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

Definition at line 1581 of file taskswnd.cpp.

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

Referenced by HandleButtonClick().

◆ HandleTaskItemRightClick()

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

Definition at line 1647 of file taskswnd.cpp.

1648 {
1649 POINT pt;
1650 GetCursorPos(&pt);
1651
1652 SetForegroundWindow(TaskItem->hWnd);
1653
1654 ActivateTask(TaskItem->hWnd);
1655
1656 if (GetForegroundWindow() != TaskItem->hWnd)
1657 ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
1658
1659 ::SendMessageCallbackW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y),
1660 SendAsyncProc, (ULONG_PTR)TaskItem);
1661 }
#define ERR(fmt,...)
Definition: debug.h:110
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1138
static VOID CALLBACK SendAsyncProc(HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
Definition: taskswnd.cpp:1642
#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:3998
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2639
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 1737 of file taskswnd.cpp.

1738 {
1739 LRESULT Ret = 0;
1740
1741 switch (nmh->code)
1742 {
1743 case NM_CUSTOMDRAW:
1744 {
1745 LPNMTBCUSTOMDRAW nmtbcd = (LPNMTBCUSTOMDRAW) nmh;
1746
1747 switch (nmtbcd->nmcd.dwDrawStage)
1748 {
1749
1750 case CDDS_ITEMPREPAINT:
1751 Ret = HandleItemPaint(nmtbcd);
1752 break;
1753
1754 case CDDS_PREPAINT:
1755 Ret = CDRF_NOTIFYITEMDRAW;
1756 break;
1757
1758 default:
1759 Ret = CDRF_DODEFAULT;
1760 break;
1761 }
1762 break;
1763 }
1764 }
1765
1766 return Ret;
1767 }
LRESULT HandleItemPaint(IN OUT NMTBCUSTOMDRAW *nmtbcd)
Definition: taskswnd.cpp:1694
#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 1953 of file taskswnd.cpp.

1954 {
1955 m_Tray = tray;
1958 if (!m_hWnd)
1959 return E_FAIL;
1960 return S_OK;
1961 }
@ Create
Definition: registry.c:563
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#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:206
const WCHAR szRunningApps[]
Definition: taskswnd.cpp:33

◆ OnCommand()

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

Definition at line 1812 of file taskswnd.cpp.

1813 {
1814 LRESULT Ret = TRUE;
1815 if (lParam != 0 && (HWND) lParam == m_TaskBar.m_hWnd)
1816 {
1818 }
1819 return Ret;
1820 }
BOOL HandleButtonClick(IN WORD wIndex)
Definition: taskswnd.cpp:1616
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 1857 of file taskswnd.cpp.

1858 {
1859 LRESULT Ret = 0;
1860 INT_PTR iBtn = -1;
1861
1862 if (m_TaskBar.m_hWnd != NULL)
1863 {
1864 POINT pt;
1865
1866 pt.x = GET_X_LPARAM(lParam);
1867 pt.y = GET_Y_LPARAM(lParam);
1868
1870
1871 iBtn = m_TaskBar.HitTest(&pt);
1872 if (iBtn >= 0)
1873 {
1875 }
1876 }
1877 if (iBtn < 0)
1878 {
1879 /* Not on a taskbar button, so forward message to tray */
1880 Ret = SendMessage(m_Tray->GetHWND(), uMsg, wParam, lParam);
1881 }
1882 return Ret;
1883 }
BOOL HandleButtonRightClick(IN WORD wIndex)
Definition: taskswnd.cpp:1668
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:5833
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

◆ OnCopyData()

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

Definition at line 1937 of file taskswnd.cpp.

1938 {
1940 if (cpData->dwData == m_uHardErrorMsg)
1941 {
1942 /* A hard error balloon message */
1944 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));
1945 if (pData->cbHeaderSize == sizeof(BALLOON_HARD_ERROR_DATA))
1947 return TRUE;
1948 }
1949
1950 return FALSE;
1951 }
void StartThread(PBALLOON_HARD_ERROR_DATA pData)
Definition: taskswnd.cpp:178
CHardErrorThread m_HardErrorThread
Definition: taskswnd.cpp:327
#define ULONG_PTR
Definition: config.h:101
ULONG_PTR dwData
Definition: winuser.h:2991
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 1435 of file taskswnd.cpp.

1436 {
1438 return FALSE;
1439
1440 SetWindowTheme(m_TaskBar.m_hWnd, L"TaskBand", NULL);
1441
1443 m_TaskBar.SetImageList(m_ImageList);
1444
1445 /* Set proper spacing between buttons */
1446 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1447
1448 /* Register the shell hook */
1450
1451 TRACE("ShellHookMsg got assigned number %d\n", m_ShellHookMsg);
1452
1453 RegisterShellHook(m_hWnd, 3); /* 1 if no NT! We're targeting NT so we don't care! */
1454
1456
1457 /* Recalculate the button size */
1459
1460#if DUMP_TASKS != 0
1461 SetTimer(hwnd, 1, 5000, NULL);
1462#endif
1463 return TRUE;
1464 }
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:311
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
#define SM_CYSMICON
Definition: winuser.h:1007
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define SM_CXSMICON
Definition: winuser.h:1006
int WINAPI GetSystemMetrics(_In_ int)

◆ OnDestroy()

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

Definition at line 1466 of file taskswnd.cpp.

1467 {
1469
1470 /* Unregister the shell hook */
1472
1475 return TRUE;
1476 }
VOID DeleteAllTasks()
Definition: taskswnd.cpp:1179
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 1769 of file taskswnd.cpp.

1770 {
1771 HDC hdc = (HDC) wParam;
1772
1773 if (!IsAppThemed())
1774 {
1775 bHandled = FALSE;
1776 return 0;
1777 }
1778
1779 RECT rect;
1782
1783 return TRUE;
1784 }
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 1885 of file taskswnd.cpp.

1886 {
1887 PTASK_ITEM TaskItem = FindTaskItem((HWND) wParam);
1888 if (TaskItem)
1889 {
1890 RECT* prcMinRect = (RECT*) lParam;
1891 RECT rcItem, rcToolbar;
1892 m_TaskBar.GetItemRect(TaskItem->Index, &rcItem);
1893 m_TaskBar.GetWindowRect(&rcToolbar);
1894
1895 OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top);
1896
1897 *prcMinRect = rcItem;
1898 return TRUE;
1899 }
1900 return FALSE;
1901 }
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:810
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 1903 of file taskswnd.cpp.

1904 {
1905 return MA_NOACTIVATE;
1906 }
#define MA_NOACTIVATE
Definition: winuser.h:2493

◆ OnNcHitTest()

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

Definition at line 1801 of file taskswnd.cpp.

1802 {
1803 LRESULT Ret = TRUE;
1804 /* We want the tray window to be draggable everywhere, so make the control
1805 appear transparent */
1806 Ret = DefWindowProc(uMsg, wParam, lParam);
1807 if (Ret != HTVSCROLL && Ret != HTHSCROLL)
1808 Ret = HTTRANSPARENT;
1809 return Ret;
1810 }
#define DefWindowProc
Definition: ros2win.h:31
#define HTVSCROLL
Definition: winuser.h:2472
#define HTHSCROLL
Definition: winuser.h:2471
#define HTTRANSPARENT
Definition: winuser.h:2463

◆ OnNotify()

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

Definition at line 1822 of file taskswnd.cpp.

1823 {
1824 LRESULT Ret = TRUE;
1825 const NMHDR *nmh = (const NMHDR *) lParam;
1826
1827 if (nmh->hwndFrom == m_TaskBar.m_hWnd)
1828 {
1829 Ret = HandleToolbarNotification(nmh);
1830 }
1831 return Ret;
1832 }
LRESULT HandleToolbarNotification(IN const NMHDR *nmh)
Definition: taskswnd.cpp:1737
HWND hwndFrom
Definition: winuser.h:3147

◆ OnSetFont()

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

Definition at line 1921 of file taskswnd.cpp.

1922 {
1923 return m_TaskBar.SendMessageW(uMsg, wParam, lParam);
1924 }

◆ OnSettingChanged()

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

Definition at line 1926 of file taskswnd.cpp.

1927 {
1928 if (wParam == SPI_SETNONCLIENTMETRICS)
1929 {
1930 /* Don't update the font, this will be done when we get a WM_SETFONT from our parent */
1932 }
1933
1934 return 0;
1935 }

◆ OnShellHook()

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

Definition at line 1499 of file taskswnd.cpp.

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

◆ OnSize()

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

Definition at line 1786 of file taskswnd.cpp.

1787 {
1788 SIZE szClient;
1789
1790 szClient.cx = LOWORD(lParam);
1791 szClient.cy = HIWORD(lParam);
1792 if (m_TaskBar.m_hWnd != NULL)
1793 {
1794 m_TaskBar.SetWindowPos(NULL, 0, 0, szClient.cx, szClient.cy, SWP_NOZORDER);
1795
1797 }
1798 return TRUE;
1799 }
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1282
LONG cx
Definition: windef.h:334
LONG cy
Definition: windef.h:335
#define HIWORD(l)
Definition: typedefs.h:247
#define SWP_NOZORDER
Definition: winuser.h:1237

◆ OnTaskbarSettingsChanged()

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

Definition at line 1841 of file taskswnd.cpp.

1842 {
1843 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
1844 if (newSettings->bGroupButtons != g_TaskbarSettings.bGroupButtons)
1845 {
1848
1849 /* Collapse or expand groups if necessary */
1852 }
1853
1854 return 0;
1855 }

◆ OnThemeChanged()

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

Definition at line 1420 of file taskswnd.cpp.

1421 {
1422 TRACE("OmThemeChanged\n");
1423
1424 if (m_Theme)
1426
1427 if (IsThemeActive())
1428 m_Theme = OpenThemeData(m_hWnd, L"TaskBand");
1429 else
1430 m_Theme = NULL;
1431
1432 return TRUE;
1433 }
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 1908 of file taskswnd.cpp.

1909 {
1910#if DUMP_TASKS != 0
1911 switch (wParam)
1912 {
1913 case 1:
1914 DumpTasks();
1915 break;
1916 }
1917#endif
1918 return TRUE;
1919 }

◆ OnUpdateTaskbarPos()

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

Definition at line 1834 of file taskswnd.cpp.

1835 {
1836 /* Update the button spacing */
1837 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1838 return TRUE;
1839 }

◆ RedrawTask()

BOOL CTaskSwitchWnd::RedrawTask ( IN HWND  hWnd)
inline

Definition at line 1239 of file taskswnd.cpp.

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

Referenced by OnShellHook().

◆ RedrawTaskItem()

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

Definition at line 1214 of file taskswnd.cpp.

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

Referenced by RedrawTask().

◆ RefreshWindowList()

BOOL CTaskSwitchWnd::RefreshWindowList ( )
inline

Definition at line 1413 of file taskswnd.cpp.

1414 {
1415 TRACE("Refreshing window list...\n");
1416 /* Add all windows to the toolbar */
1417 return EnumWindows(s_EnumWindowsProc, (LPARAM)this);
1418 }
static BOOL CALLBACK s_EnumWindowsProc(IN HWND hWnd, IN LPARAM lParam)
Definition: taskswnd.cpp:1406
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 568 of file taskswnd.cpp.

569 {
570 TBBUTTONINFO tbbi;
571 PTASK_ITEM currentTaskItem, LastItem;
572
573 if (TaskItem->IconIndex == -1)
574 return;
575
576 tbbi.cbSize = sizeof(tbbi);
577 tbbi.dwMask = TBIF_IMAGE;
578
579 currentTaskItem = m_TaskItems;
580 LastItem = currentTaskItem + m_TaskItemCount;
581 while (currentTaskItem != LastItem)
582 {
583 if (currentTaskItem->IconIndex > TaskItem->IconIndex)
584 {
585 currentTaskItem->IconIndex--;
586 tbbi.iImage = currentTaskItem->IconIndex;
587
588 m_TaskBar.SetButtonInfo(currentTaskItem->Index, &tbbi);
589 }
590 currentTaskItem++;
591 }
592
593 ImageList_Remove(m_ImageList, TaskItem->IconIndex);
594 }
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 817 of file taskswnd.cpp.

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

1407 {
1409
1410 return This->EnumWindowsProc(hWnd);
1411 }

Referenced by RefreshWindowList().

◆ SendAsyncProc()

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

Definition at line 1642 of file taskswnd.cpp.

1643 {
1644 ::PostMessageW(hwnd, WM_NULL, 0, 0);
1645 }
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NULL
Definition: winuser.h:1597

Referenced by HandleTaskItemRightClick().

◆ UpdateButtonsSize()

VOID CTaskSwitchWnd::UpdateButtonsSize ( IN BOOL  bRedrawDisabled)
inline

Definition at line 1253 of file taskswnd.cpp.

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

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

◆ UpdateIndexesAfter()

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

Definition at line 409 of file taskswnd.cpp.

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

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

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

◆ UpdateTaskItemButton()

INT CTaskSwitchWnd::UpdateTaskItemButton ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 522 of file taskswnd.cpp.

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

Referenced by AllocTaskItem().

◆ m_ButtonCount

WORD CTaskSwitchWnd::m_ButtonCount
private

◆ m_ButtonSize

SIZE CTaskSwitchWnd::m_ButtonSize
private

Definition at line 324 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and UpdateButtonsSize().

◆ m_ButtonsPerLine

UINT CTaskSwitchWnd::m_ButtonsPerLine
private

Definition at line 316 of file taskswnd.cpp.

Referenced by UpdateButtonsSize(), and UpdateTaskItemButton().

◆ m_HardErrorThread

CHardErrorThread CTaskSwitchWnd::m_HardErrorThread
private

Definition at line 327 of file taskswnd.cpp.

Referenced by OnCopyData().

◆ m_ImageList

HIMAGELIST CTaskSwitchWnd::m_ImageList
private

◆ m_IsDestroying

BOOL CTaskSwitchWnd::m_IsDestroying
private

Definition at line 322 of file taskswnd.cpp.

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

◆ m_IsGroupingEnabled

◆ m_ShellHookMsg

UINT CTaskSwitchWnd::m_ShellHookMsg
private

Definition at line 306 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

CComPtr<ITrayWindow> CTaskSwitchWnd::m_Tray
private

◆ m_uHardErrorMsg

UINT CTaskSwitchWnd::m_uHardErrorMsg
private

Definition at line 326 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and OnCopyData().


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