ReactOS  0.4.14-dev-115-g4576127
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< CWindow, CControlWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
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< CWindow >
 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 (int nID)
 
UINT GetDlgItemInt (int nID, BOOL *lpTrans=NULL, BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (int nID, LPTSTR lpStr, int nMaxCount) const
 
BOOL GetDlgItemText (int nID, 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 (LPTSTR lpszStringBuf, int nMaxCount) const
 
BOOL GetWindowText (BSTR &bstrText)
 
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
 
- 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 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< CWindow, CControlWinTraits >
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< CWindow >
enum  
 
- 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< CWindow, CControlWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< CWindow >
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 292 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CTaskSwitchWnd()

CTaskSwitchWnd::CTaskSwitchWnd ( )
inline

Definition at line 326 of file taskswnd.cpp.

326  :
328  m_TaskItemCount(0),
331  m_TaskItems(NULL),
333  m_Theme(NULL),
334  m_ButtonsPerLine(0),
335  m_ButtonCount(0),
336  m_ImageList(NULL),
339  {
342  }
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:305
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:309
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
#define ZeroMemory
Definition: winbase.h:1642
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
WORD m_ButtonCount
Definition: taskswnd.cpp:313
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:312
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: taskswnd.cpp:311
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:322
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:307
static const WCHAR L[]
Definition: oid.c:1250
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:315
BOOL m_IsDestroying
Definition: taskswnd.cpp:318
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
UINT m_ShellHookMsg
Definition: taskswnd.cpp:302

◆ ~CTaskSwitchWnd()

virtual CTaskSwitchWnd::~CTaskSwitchWnd ( )
inlinevirtual

Definition at line 343 of file taskswnd.cpp.

343 { }

Member Function Documentation

◆ ActivateTask()

BOOL CTaskSwitchWnd::ActivateTask ( IN HWND  hWnd)
inline

Definition at line 1127 of file taskswnd.cpp.

1128  {
1129  PTASK_ITEM TaskItem;
1130 
1131  if (!hWnd)
1132  {
1133  return ActivateTaskItem(NULL);
1134  }
1135 
1136  TaskItem = FindTaskItem(hWnd);
1137  if (TaskItem == NULL)
1138  {
1139  TaskItem = FindOtherTaskItem(hWnd);
1140  }
1141 
1142  if (TaskItem == NULL)
1143  {
1144  WARN("Activate window 0x%p, could not find task\n", hWnd);
1146  }
1147 
1148  return ActivateTaskItem(TaskItem);
1149  }
#define WARN(fmt,...)
Definition: debug.h:111
HWND hWnd
Definition: settings.c:17
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:852
BOOL ActivateTaskItem(IN OUT PTASK_ITEM TaskItem OPTIONAL)
Definition: taskswnd.cpp:1115
smooth NULL
Definition: ftsmooth.c:416
BOOL RefreshWindowList()
Definition: taskswnd.cpp:1402
PTASK_ITEM FindOtherTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:869

Referenced by HandleTaskItemRightClick(), and OnShellHook().

◆ ActivateTaskItem()

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

Definition at line 1115 of file taskswnd.cpp.

1116  {
1117  if (TaskItem != NULL)
1118  {
1119  TRACE("Activate window 0x%p on button %d\n", TaskItem->hWnd, TaskItem->Index);
1120  }
1121 
1122  CheckActivateTaskItem(TaskItem);
1123 
1124  return FALSE;
1125  }
VOID CheckActivateTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:995
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ActivateTask().

◆ AddTask()

BOOL CTaskSwitchWnd::AddTask ( IN HWND  hWnd)
inline

Definition at line 1086 of file taskswnd.cpp.

1087  {
1088  PTASK_ITEM TaskItem;
1089 
1090  if (!::IsWindow(hWnd) || m_Tray->IsSpecialHWND(hWnd))
1091  return FALSE;
1092 
1093  TaskItem = FindTaskItem(hWnd);
1094  if (TaskItem == NULL)
1095  {
1096  TRACE("Add window 0x%p\n", hWnd);
1097  TaskItem = AllocTaskItem();
1098  if (TaskItem != NULL)
1099  {
1100  ZeroMemory(TaskItem, sizeof(*TaskItem));
1101  TaskItem->hWnd = hWnd;
1102  TaskItem->Index = -1;
1103  TaskItem->Group = AddToTaskGroup(hWnd);
1104 
1105  if (!m_IsDestroying)
1106  {
1107  AddTaskItemButton(TaskItem);
1108  }
1109  }
1110  }
1111 
1112  return TaskItem != NULL;
1113  }
BOOL IsWindow() const
Definition: atlwin.h:879
HWND hWnd
Definition: settings.c:17
#define ZeroMemory
Definition: winbase.h:1642
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:852
PTASK_ITEM AllocTaskItem()
Definition: taskswnd.cpp:910
PTASK_GROUP Group
Definition: taskswnd.cpp:82
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
INT AddTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:667
BOOL m_IsDestroying
Definition: taskswnd.cpp:318
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300
PTASK_GROUP AddToTaskGroup(IN HWND hWnd)
Definition: taskswnd.cpp:762
HWND hWnd
Definition: taskswnd.cpp:81

Referenced by EnumWindowsProc(), and OnShellHook().

◆ AddTaskItemButton()

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

Definition at line 667 of file taskswnd.cpp.

668  {
669  WCHAR windowText[255];
670  TBBUTTON tbBtn = { 0 };
671  INT iIndex;
672  HICON icon;
673 
674  if (TaskItem->Index >= 0)
675  {
676  return UpdateTaskItemButton(TaskItem);
677  }
678 
679  if (TaskItem->Group != NULL &&
680  TaskItem->Group->IsCollapsed)
681  {
682  /* The task group is collapsed, we only need to update the group button */
683  return UpdateTaskGroupButton(TaskItem->Group);
684  }
685 
686  icon = GetWndIcon(TaskItem->hWnd);
687  if (!icon)
688  icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
689  TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, -1, icon);
690 
691  tbBtn.iBitmap = TaskItem->IconIndex;
694  tbBtn.dwData = TaskItem->Index;
695 
697  {
698  tbBtn.iString = (DWORD_PTR) windowText;
699  }
700 
701  /* Find out where to insert the new button */
702  iIndex = CalculateTaskItemNewButtonIndex(TaskItem);
703  ASSERT(iIndex >= 0);
704  tbBtn.idCommand = iIndex;
705 
707 
708  if (m_TaskBar.InsertButton(iIndex, &tbBtn))
709  {
710  UpdateIndexesAfter(iIndex, TRUE);
711 
712  TRACE("Added button %d for hwnd 0x%p\n", iIndex, TaskItem->hWnd);
713 
714  TaskItem->Index = iIndex;
715  m_ButtonCount++;
716 
717  /* Update button sizes and fix the button wrapping */
719  return iIndex;
720  }
721 
723 
724  return -1;
725  }
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2779
#define BTNS_NOPREFIX
Definition: commctrl.h:977
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
#define DWORD_PTR
Definition: treelist.c:76
#define _countof(array)
Definition: fontsub.cpp:30
BYTE fsStyle
Definition: commctrl.h:924
int32_t INT
Definition: typedefs.h:56
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:511
WORD m_ButtonCount
Definition: taskswnd.cpp:313
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:405
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
#define BTNS_CHECK
Definition: commctrl.h:972
smooth NULL
Definition: ftsmooth.c:416
#define BTNS_SHOWTEXT
Definition: commctrl.h:978
INT_PTR iString
Definition: commctrl.h:931
DWORD_PTR dwData
Definition: commctrl.h:930
int iBitmap
Definition: commctrl.h:921
#define TRACE(s)
Definition: solgame.cpp:4
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
__wchar_t WCHAR
Definition: xmlstorage.h:180
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:486
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID BeginUpdate()
Definition: taskswnd.cpp:235
int idCommand
Definition: commctrl.h:922
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:315
INT CalculateTaskItemNewButtonIndex(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:623
DWORD InsertButton(int insertAt, TBBUTTON *btn)
Definition: rosctrls.h:330
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:468
WCHAR windowText[1024]
Definition: appswitch.c:49
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
VOID EndUpdate()
Definition: taskswnd.cpp:240
BYTE fsState
Definition: commctrl.h:923
#define OIC_SAMPLE
Definition: winuser.h:1148
#define TBSTATE_ELLIPSES
Definition: commctrl.h:950
INT GetWndTextFromTaskItem(IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
Definition: taskswnd.cpp:345
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1242

Referenced by AddTask().

◆ AddToTaskGroup()

PTASK_GROUP CTaskSwitchWnd::AddToTaskGroup ( IN HWND  hWnd)
inline

Definition at line 762 of file taskswnd.cpp.

763  {
764  DWORD dwProcessId;
765  PTASK_GROUP TaskGroup, *PrevLink;
766 
768  &dwProcessId))
769  {
770  TRACE("Cannot get process id of hwnd 0x%p\n", hWnd);
771  return NULL;
772  }
773 
774  /* Try to find an existing task group */
775  TaskGroup = m_TaskGroups;
776  PrevLink = &m_TaskGroups;
777  while (TaskGroup != NULL)
778  {
779  if (TaskGroup->dwProcessId == dwProcessId)
780  {
781  TaskGroup->dwTaskCount++;
782  return TaskGroup;
783  }
784 
785  PrevLink = &TaskGroup->Next;
786  TaskGroup = TaskGroup->Next;
787  }
788 
789  /* Allocate a new task group */
790  TaskGroup = (PTASK_GROUP) HeapAlloc(hProcessHeap,
792  sizeof(*TaskGroup));
793  if (TaskGroup != NULL)
794  {
795  TaskGroup->dwTaskCount = 1;
796  TaskGroup->dwProcessId = dwProcessId;
797  TaskGroup->Index = -1;
798 
799  /* Add the task group to the list */
800  *PrevLink = TaskGroup;
801  }
802 
803  return TaskGroup;
804  }
HWND hWnd
Definition: settings.c:17
struct _TASK_GROUP * PTASK_GROUP
struct _TASK_GROUP * Next
Definition: taskswnd.cpp:63
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
DWORD dwTaskCount
Definition: taskswnd.cpp:65
#define TRACE(s)
Definition: solgame.cpp:4
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:307
DWORD dwProcessId
Definition: taskswnd.cpp:66
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HANDLE hProcessHeap
Definition: kbswitch.c:25

Referenced by AddTask().

◆ AllocTaskItem()

PTASK_ITEM CTaskSwitchWnd::AllocTaskItem ( )
inline

Definition at line 910 of file taskswnd.cpp.

911  {
913  {
914  /* We need the most significant bit in 16 bit command IDs to indicate whether it
915  is a task group or task item. WM_COMMAND limits command IDs to 16 bits! */
916  return NULL;
917  }
918 
920 
921  if (m_TaskItemCount == 0)
922  {
924  0,
926  if (m_TaskItems != NULL)
927  {
929  }
930  else
931  return NULL;
932  }
934  {
935  PTASK_ITEM NewArray;
936  SIZE_T NewArrayLength, ActiveTaskItemIndex;
937 
938  NewArrayLength = m_AllocatedTaskItems + TASK_ITEM_ARRAY_ALLOC;
939 
940  NewArray = (PTASK_ITEM) HeapReAlloc(hProcessHeap,
941  0,
942  m_TaskItems,
943  NewArrayLength * sizeof(*m_TaskItems));
944  if (NewArray != NULL)
945  {
946  if (m_ActiveTaskItem != NULL)
947  {
948  /* Fixup the ActiveTaskItem pointer */
949  ActiveTaskItemIndex = m_ActiveTaskItem - m_TaskItems;
950  m_ActiveTaskItem = NewArray + ActiveTaskItemIndex;
951  }
952  m_AllocatedTaskItems = (WORD) NewArrayLength;
953  m_TaskItems = NewArray;
954  }
955  else
956  return NULL;
957  }
958 
959  return m_TaskItems + m_TaskItemCount++;
960  }
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:305
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
#define MAX_TASKS_COUNT
Definition: taskswnd.cpp:29
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:309
#define TASK_ITEM_ARRAY_ALLOC
Definition: taskswnd.cpp:30
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
struct _TASK_ITEM * PTASK_ITEM
smooth NULL
Definition: ftsmooth.c:416
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned short WORD
Definition: ntddk_ex.h:93
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define HeapReAlloc
Definition: compat.h:393
HANDLE hProcessHeap
Definition: kbswitch.c:25

Referenced by AddTask().

◆ CalculateTaskItemNewButtonIndex()

INT CTaskSwitchWnd::CalculateTaskItemNewButtonIndex ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 623 of file taskswnd.cpp.

624  {
625  PTASK_GROUP TaskGroup;
626  PTASK_ITEM LastTaskItem;
627 
628  /* NOTE: This routine assumes that the group is *not* collapsed! */
629 
630  TaskGroup = TaskItem->Group;
632  {
633  if (TaskGroup != NULL)
634  {
635  ASSERT(TaskGroup->Index < 0);
636  ASSERT(!TaskGroup->IsCollapsed);
637 
638  if (TaskGroup->dwTaskCount > 1)
639  {
640  LastTaskItem = FindLastTaskItemOfGroup(TaskGroup, TaskItem);
641  if (LastTaskItem != NULL)
642  {
643  /* Since the group is expanded the task items must have an index */
644  ASSERT(LastTaskItem->Index >= 0);
645 
646  return LastTaskItem->Index + 1;
647  }
648  }
649  }
650  else
651  {
652  /* Find the last NULL group button. NULL groups are added at the end of the
653  task item list when grouping is enabled */
654  LastTaskItem = FindLastTaskItemOfGroup(NULL, TaskItem);
655  if (LastTaskItem != NULL)
656  {
657  ASSERT(LastTaskItem->Index >= 0);
658 
659  return LastTaskItem->Index + 1;
660  }
661  }
662  }
663 
664  return m_ButtonCount;
665  }
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
WORD m_ButtonCount
Definition: taskswnd.cpp:313
smooth NULL
Definition: ftsmooth.c:416
PTASK_ITEM FindLastTaskItemOfGroup(IN PTASK_GROUP TaskGroup OPTIONAL, IN PTASK_ITEM NewTaskItem OPTIONAL)
Definition: taskswnd.cpp:585
DWORD dwTaskCount
Definition: taskswnd.cpp:65
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
DWORD IsCollapsed
Definition: taskswnd.cpp:74

Referenced by AddTaskItemButton().

◆ CheckActivateTaskItem()

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

Definition at line 995 of file taskswnd.cpp.

996  {
997  PTASK_ITEM CurrentTaskItem;
998  PTASK_GROUP TaskGroup = NULL;
999 
1000  CurrentTaskItem = m_ActiveTaskItem;
1001 
1002  if (TaskItem != NULL)
1003  TaskGroup = TaskItem->Group;
1004 
1005  if (m_IsGroupingEnabled &&
1006  TaskGroup != NULL &&
1007  TaskGroup->IsCollapsed)
1008  {
1009  /* FIXME */
1010  return;
1011  }
1012 
1013  if (CurrentTaskItem != NULL)
1014  {
1015  PTASK_GROUP CurrentTaskGroup;
1016 
1017  if (CurrentTaskItem == TaskItem)
1018  return;
1019 
1020  CurrentTaskGroup = CurrentTaskItem->Group;
1021 
1022  if (m_IsGroupingEnabled &&
1023  CurrentTaskGroup != NULL &&
1024  CurrentTaskGroup->IsCollapsed)
1025  {
1026  if (CurrentTaskGroup == TaskGroup)
1027  return;
1028 
1029  /* FIXME */
1030  }
1031  else
1032  {
1034  if (CurrentTaskItem->Index >= 0)
1035  {
1036  UpdateTaskItemButton(CurrentTaskItem);
1037  }
1038  }
1039  }
1040 
1041  m_ActiveTaskItem = TaskItem;
1042 
1043  if (TaskItem != NULL && TaskItem->Index >= 0)
1044  {
1045  UpdateTaskItemButton(TaskItem);
1046  }
1047  else if (TaskItem == NULL)
1048  {
1049  TRACE("Active TaskItem now NULL\n");
1050  }
1051  }
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:309
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:511
PTASK_GROUP Group
Definition: taskswnd.cpp:82
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
DWORD IsCollapsed
Definition: taskswnd.cpp:74

Referenced by ActivateTaskItem().

◆ ContextSensitiveHelp()

HRESULT WINAPI CTaskSwitchWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inline

Implements IOleWindow.

Definition at line 1954 of file taskswnd.cpp.

1955  {
1956  return E_NOTIMPL;
1957  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DeleteAllTasks()

VOID CTaskSwitchWnd::DeleteAllTasks ( )
inline

Definition at line 1168 of file taskswnd.cpp.

1169  {
1170  PTASK_ITEM CurrentTask;
1171 
1172  if (m_TaskItemCount > 0)
1173  {
1174  CurrentTask = m_TaskItems + m_TaskItemCount;
1175  do
1176  {
1177  DeleteTaskItem(--CurrentTask);
1178  } while (CurrentTask != m_TaskItems);
1179  }
1180  }
VOID DeleteTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:980
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308

Referenced by OnDestroy().

◆ DeleteTask()

BOOL CTaskSwitchWnd::DeleteTask ( IN HWND  hWnd)
inline

Definition at line 1151 of file taskswnd.cpp.

1152  {
1153  PTASK_ITEM TaskItem;
1154 
1155  TaskItem = FindTaskItem(hWnd);
1156  if (TaskItem != NULL)
1157  {
1158  TRACE("Delete window 0x%p on button %d\n", hWnd, TaskItem->Index);
1159  DeleteTaskItem(TaskItem);
1160  return TRUE;
1161  }
1162  //else
1163  //TRACE("Failed to delete window 0x%p\n", hWnd);
1164 
1165  return FALSE;
1166  }
VOID DeleteTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:980
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:852
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by OnShellHook().

◆ DeleteTaskItem()

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

Definition at line 980 of file taskswnd.cpp.

981  {
982  if (!m_IsDestroying)
983  {
984  /* Delete the task button from the toolbar */
985  DeleteTaskItemButton(TaskItem);
986  }
987 
988  /* Remove the task from it's group */
989  RemoveTaskFromTaskGroup(TaskItem);
990 
991  /* Free the task item */
992  FreeTaskItem(TaskItem);
993  }
BOOL DeleteTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:727
VOID RemoveTaskFromTaskGroup(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:806
BOOL m_IsDestroying
Definition: taskswnd.cpp:318
VOID FreeTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:962

Referenced by DeleteAllTasks(), and DeleteTask().

◆ DeleteTaskItemButton()

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

Definition at line 727 of file taskswnd.cpp.

728  {
729  PTASK_GROUP TaskGroup;
730  INT iIndex;
731 
732  TaskGroup = TaskItem->Group;
733 
734  if (TaskItem->Index >= 0)
735  {
736  if ((TaskGroup != NULL && !TaskGroup->IsCollapsed) ||
737  TaskGroup == NULL)
738  {
740 
741  RemoveIcon(TaskItem);
742  iIndex = TaskItem->Index;
743  if (m_TaskBar.DeleteButton(iIndex))
744  {
745  TaskItem->Index = -1;
746  m_ButtonCount--;
747 
748  UpdateIndexesAfter(iIndex, FALSE);
749 
750  /* Update button sizes and fix the button wrapping */
752  return TRUE;
753  }
754 
756  }
757  }
758 
759  return FALSE;
760  }
#define TRUE
Definition: types.h:120
DWORD DeleteButton(int index)
Definition: rosctrls.h:340
VOID RemoveIcon(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:557
int32_t INT
Definition: typedefs.h:56
WORD m_ButtonCount
Definition: taskswnd.cpp:313
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:405
smooth NULL
Definition: ftsmooth.c:416
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
VOID BeginUpdate()
Definition: taskswnd.cpp:235
DWORD IsCollapsed
Definition: taskswnd.cpp:74
VOID EndUpdate()
Definition: taskswnd.cpp:240
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1242

Referenced by DeleteTaskItem().

◆ EnumWindowsProc()

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

Definition at line 1374 of file taskswnd.cpp.

1375  {
1376  /* Only show windows that still exist and are visible and none of explorer's
1377  special windows (such as the desktop or the tray window) */
1378  if (::IsWindow(hWnd) && ::IsWindowVisible(hWnd) &&
1379  !m_Tray->IsSpecialHWND(hWnd))
1380  {
1381  DWORD exStyle = ::GetWindowLong(hWnd, GWL_EXSTYLE);
1382  /* Don't list popup windows and also no tool windows */
1383  if ((::GetWindow(hWnd, GW_OWNER) == NULL || exStyle & WS_EX_APPWINDOW) &&
1384  !(exStyle & WS_EX_TOOLWINDOW))
1385  {
1386  TRACE("Adding task for %p...\n", hWnd);
1387  AddTask(hWnd);
1388  }
1389 
1390  }
1391 
1392  return TRUE;
1393  }
#define TRUE
Definition: types.h:120
HRESULT WINAPI GetWindow(HWND *phwnd)
Definition: taskswnd.cpp:1946
BOOL IsWindow() const
Definition: atlwin.h:879
HWND hWnd
Definition: settings.c:17
#define GWL_EXSTYLE
Definition: winuser.h:845
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG GetWindowLong(int nIndex) const
Definition: atlwin.h:738
BOOL AddTask(IN HWND hWnd)
Definition: taskswnd.cpp:1086
#define GW_OWNER
Definition: winuser.h:761
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300
#define WS_EX_APPWINDOW
Definition: winuser.h:383
BOOL IsWindowVisible() const
Definition: atlwin.h:890

◆ ExpandTaskGroup()

VOID CTaskSwitchWnd::ExpandTaskGroup ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 477 of file taskswnd.cpp.

478  {
479  ASSERT(TaskGroup->dwTaskCount > 0);
480  ASSERT(TaskGroup->IsCollapsed);
481  ASSERT(TaskGroup->Index >= 0);
482 
483  /* FIXME: Implement */
484  }
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by RemoveTaskFromTaskGroup().

◆ FindLastTaskItemOfGroup()

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

Definition at line 585 of file taskswnd.cpp.

588  {
589  PTASK_ITEM TaskItem, LastTaskItem, FoundTaskItem = NULL;
590  DWORD dwTaskCount;
591 
593 
594  TaskItem = m_TaskItems;
595  LastTaskItem = TaskItem + m_TaskItemCount;
596 
597  dwTaskCount = (TaskGroup != NULL ? TaskGroup->dwTaskCount : MAX_TASKS_COUNT);
598 
599  ASSERT(dwTaskCount > 0);
600 
601  while (TaskItem != LastTaskItem)
602  {
603  if (TaskItem->Group == TaskGroup)
604  {
605  if ((NewTaskItem != NULL && TaskItem != NewTaskItem) || NewTaskItem == NULL)
606  {
607  FoundTaskItem = TaskItem;
608  }
609 
610  if (--dwTaskCount == 0)
611  {
612  /* We found the last task item in the group! */
613  break;
614  }
615  }
616 
617  TaskItem++;
618  }
619 
620  return FoundTaskItem;
621  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
#define MAX_TASKS_COUNT
Definition: taskswnd.cpp:29
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
PTASK_GROUP Group
Definition: taskswnd.cpp:82
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

Referenced by CalculateTaskItemNewButtonIndex().

◆ FindOtherTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindOtherTaskItem ( IN HWND  hWnd)
inline

Definition at line 869 of file taskswnd.cpp.

870  {
871  PTASK_ITEM LastItem, TaskItem;
872  PTASK_GROUP TaskGroup;
873  DWORD dwProcessId;
874 
875  if (!GetWindowThreadProcessId(hWnd, &dwProcessId))
876  {
877  return NULL;
878  }
879 
880  /* Try to find another task that belongs to the same
881  process as the given window */
882  TaskItem = m_TaskItems;
883  LastItem = TaskItem + m_TaskItemCount;
884  while (TaskItem != LastItem)
885  {
886  TaskGroup = TaskItem->Group;
887  if (TaskGroup != NULL)
888  {
889  if (TaskGroup->dwProcessId == dwProcessId)
890  return TaskItem;
891  }
892  else
893  {
894  DWORD dwProcessIdTask;
895 
896  if (GetWindowThreadProcessId(TaskItem->hWnd,
897  &dwProcessIdTask) &&
898  dwProcessIdTask == dwProcessId)
899  {
900  return TaskItem;
901  }
902  }
903 
904  TaskItem++;
905  }
906 
907  return NULL;
908  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
HWND hWnd
Definition: settings.c:17
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
PTASK_GROUP Group
Definition: taskswnd.cpp:82
DWORD WINAPI GetWindowThreadProcessId(HWND, PDWORD)
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD dwProcessId
Definition: taskswnd.cpp:66
HWND hWnd
Definition: taskswnd.cpp:81

Referenced by ActivateTask().

◆ FindTaskGroupByIndex()

PTASK_GROUP CTaskSwitchWnd::FindTaskGroupByIndex ( IN INT  Index)
inline

Definition at line 1070 of file taskswnd.cpp.

1071  {
1072  PTASK_GROUP CurrentGroup;
1073 
1074  CurrentGroup = m_TaskGroups;
1075  while (CurrentGroup != NULL)
1076  {
1077  if (CurrentGroup->Index == Index)
1078  break;
1079 
1080  CurrentGroup = CurrentGroup->Next;
1081  }
1082 
1083  return CurrentGroup;
1084  }
struct _TASK_GROUP * Next
Definition: taskswnd.cpp:63
smooth NULL
Definition: ftsmooth.c:416
static const UCHAR Index[8]
Definition: usbohci.c:18
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:307

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

◆ FindTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindTaskItem ( IN HWND  hWnd)
inline

Definition at line 852 of file taskswnd.cpp.

853  {
854  PTASK_ITEM TaskItem, LastItem;
855 
856  TaskItem = m_TaskItems;
857  LastItem = TaskItem + m_TaskItemCount;
858  while (TaskItem != LastItem)
859  {
860  if (TaskItem->hWnd == hWnd)
861  return TaskItem;
862 
863  TaskItem++;
864  }
865 
866  return NULL;
867  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
HWND hWnd
Definition: settings.c:17
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
smooth NULL
Definition: ftsmooth.c:416
HWND hWnd
Definition: taskswnd.cpp:81

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

◆ FindTaskItemByIndex()

PTASK_ITEM CTaskSwitchWnd::FindTaskItemByIndex ( IN INT  Index)
inline

Definition at line 1053 of file taskswnd.cpp.

1054  {
1055  PTASK_ITEM TaskItem, LastItem;
1056 
1057  TaskItem = m_TaskItems;
1058  LastItem = TaskItem + m_TaskItemCount;
1059  while (TaskItem != LastItem)
1060  {
1061  if (TaskItem->Index == Index)
1062  return TaskItem;
1063 
1064  TaskItem++;
1065  }
1066 
1067  return NULL;
1068  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
smooth NULL
Definition: ftsmooth.c:416
static const UCHAR Index[8]
Definition: usbohci.c:18

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

◆ FlashTask()

BOOL CTaskSwitchWnd::FlashTask ( IN HWND  hWnd)
inline

Definition at line 1188 of file taskswnd.cpp.

1189  {
1190  PTASK_ITEM TaskItem;
1191 
1192  TaskItem = FindTaskItem(hWnd);
1193  if (TaskItem != NULL)
1194  {
1195  TRACE("Flashing window 0x%p on button %d\n", hWnd, TaskItem->Index);
1196  FlashTaskItem(TaskItem);
1197  return TRUE;
1198  }
1199 
1200  return FALSE;
1201  }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:852
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
VOID FlashTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1182

Referenced by OnShellHook().

◆ FlashTaskItem()

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

Definition at line 1182 of file taskswnd.cpp.

1183  {
1184  TaskItem->RenderFlashed = 1;
1185  UpdateTaskItemButton(TaskItem);
1186  }
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:511

Referenced by FlashTask().

◆ FreeTaskItem()

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

Definition at line 962 of file taskswnd.cpp.

963  {
964  WORD wIndex;
965 
966  if (TaskItem == m_ActiveTaskItem)
968 
969  wIndex = (WORD) (TaskItem - m_TaskItems);
970  if (wIndex + 1 < m_TaskItemCount)
971  {
972  MoveMemory(TaskItem,
973  TaskItem + 1,
974  (m_TaskItemCount - wIndex - 1) * sizeof(*TaskItem));
975  }
976 
977  m_TaskItemCount--;
978  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:309
#define MoveMemory
Definition: winbase.h:1639
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
smooth NULL
Definition: ftsmooth.c:416
unsigned short WORD
Definition: ntddk_ex.h:93

Referenced by DeleteTaskItem().

◆ GetWindow()

HRESULT WINAPI CTaskSwitchWnd::GetWindow ( HWND phwnd)
inline

Implements IOleWindow.

Definition at line 1946 of file taskswnd.cpp.

1947  {
1948  if (!phwnd)
1949  return E_INVALIDARG;
1950  *phwnd = m_hWnd;
1951  return S_OK;
1952  }
#define E_INVALIDARG
Definition: ddrawi.h:101
HWND m_hWnd
Definition: atlwin.h:268
#define S_OK
Definition: intsafe.h:59

Referenced by EnumWindowsProc().

◆ GetWndIcon()

HICON CTaskSwitchWnd::GetWndIcon ( HWND  hwnd)
inline

Definition at line 486 of file taskswnd.cpp.

487  {
488  HICON hIcon = 0;
489 
490  SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR) &hIcon);
491  if (hIcon)
492  return hIcon;
493 
495  if (hIcon)
496  return hIcon;
497 
498  SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR) &hIcon);
499  if (hIcon)
500  return hIcon;
501 
503  if (hIcon)
504  return hIcon;
505 
507 
508  return hIcon;
509  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
static HICON
Definition: imagelist.c:84
#define GCL_HICONSM
Definition: winuser.h:662
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1209
#define ICON_SMALL
Definition: tnclass.cpp:48
#define SendMessageTimeout
Definition: winuser.h:5746
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:184
#define GetClassLongPtr
Definition: winuser.h:5683
#define GCL_HICON
Definition: winuser.h:661
HICON hIcon
Definition: msconfig.c:44
#define ICON_BIG
Definition: tnclass.cpp:51

Referenced by AddTaskItemButton(), and UpdateTaskItemButton().

◆ GetWndTextFromTaskItem()

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

Definition at line 345 of file taskswnd.cpp.

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

1468  {
1469  BOOL Ret = FALSE;
1470 
1471  switch (GET_APPCOMMAND_LPARAM(lParam))
1472  {
1473  case APPCOMMAND_BROWSER_SEARCH:
1474  Ret = SHFindFiles(NULL,
1475  NULL);
1476  break;
1477 
1478  case APPCOMMAND_BROWSER_HOME:
1479  case APPCOMMAND_LAUNCH_MAIL:
1480  default:
1481  TRACE("Shell app command %d unhandled!\n", (INT) GET_APPCOMMAND_LPARAM(lParam));
1482  break;
1483  }
1484 
1485  return Ret;
1486  }
int32_t INT
Definition: typedefs.h:56
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI SHFindFiles(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlSaveFile)
Definition: shellord.c:1827
LPARAM lParam
Definition: combotst.c:139

Referenced by OnShellHook().

◆ HandleButtonClick()

BOOL CTaskSwitchWnd::HandleButtonClick ( IN WORD  wIndex)
inline

Definition at line 1601 of file taskswnd.cpp.

1602  {
1603  PTASK_ITEM TaskItem;
1604  PTASK_GROUP TaskGroup;
1605 
1606  if (m_IsGroupingEnabled)
1607  {
1608  TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1609  if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1610  {
1611  HandleTaskGroupClick(TaskGroup);
1612  return TRUE;
1613  }
1614  }
1615 
1616  TaskItem = FindTaskItemByIndex((INT) wIndex);
1617  if (TaskItem != NULL)
1618  {
1619  HandleTaskItemClick(TaskItem);
1620  return TRUE;
1621  }
1622 
1623  return FALSE;
1624  }
VOID HandleTaskItemClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1566
#define TRUE
Definition: types.h:120
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1070
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
int32_t INT
Definition: typedefs.h:56
VOID HandleTaskGroupClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1596
smooth NULL
Definition: ftsmooth.c:416
DWORD IsCollapsed
Definition: taskswnd.cpp:74
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1053

Referenced by OnCommand().

◆ HandleButtonRightClick()

BOOL CTaskSwitchWnd::HandleButtonRightClick ( IN WORD  wIndex)
inline

Definition at line 1651 of file taskswnd.cpp.

1652  {
1653  PTASK_ITEM TaskItem;
1654  PTASK_GROUP TaskGroup;
1655  if (m_IsGroupingEnabled)
1656  {
1657  TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1658  if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1659  {
1660  HandleTaskGroupRightClick(TaskGroup);
1661  return TRUE;
1662  }
1663  }
1664 
1665  TaskItem = FindTaskItemByIndex((INT) wIndex);
1666 
1667  if (TaskItem != NULL)
1668  {
1669  HandleTaskItemRightClick(TaskItem);
1670  return TRUE;
1671  }
1672 
1673  return FALSE;
1674  }
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1646
#define TRUE
Definition: types.h:120
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1070
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
int32_t INT
Definition: typedefs.h:56
smooth NULL
Definition: ftsmooth.c:416
DWORD IsCollapsed
Definition: taskswnd.cpp:74
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1627
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1053

Referenced by OnContextMenu().

◆ HandleItemPaint()

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

Definition at line 1677 of file taskswnd.cpp.

1678  {
1679  LRESULT Ret = CDRF_DODEFAULT;
1680  PTASK_GROUP TaskGroup;
1681  PTASK_ITEM TaskItem;
1682 
1683  TaskItem = FindTaskItemByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1684  TaskGroup = FindTaskGroupByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1685  if (TaskGroup == NULL && TaskItem != NULL)
1686  {
1687  ASSERT(TaskItem != NULL);
1688 
1689  if (TaskItem != NULL && ::IsWindow(TaskItem->hWnd))
1690  {
1691  /* Make the entire button flashing if necessary */
1692  if (nmtbcd->nmcd.uItemState & CDIS_MARKED)
1693  {
1694  Ret = TBCDRF_NOBACKGROUND;
1695  if (!m_Theme)
1696  {
1697  SelectObject(nmtbcd->nmcd.hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
1698  Rectangle(nmtbcd->nmcd.hdc,
1699  nmtbcd->nmcd.rc.left,
1700  nmtbcd->nmcd.rc.top,
1701  nmtbcd->nmcd.rc.right,
1702  nmtbcd->nmcd.rc.bottom);
1703  }
1704  else
1705  {
1706  DrawThemeBackground(m_Theme, nmtbcd->nmcd.hdc, TDP_FLASHBUTTON, 0, &nmtbcd->nmcd.rc, 0);
1707  }
1708  nmtbcd->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
1709  return Ret;
1710  }
1711  }
1712  }
1713  else if (TaskGroup != NULL)
1714  {
1715  /* FIXME: Implement painting for task groups */
1716  }
1717  return Ret;
1718  }
#define COLOR_HIGHLIGHT
Definition: winuser.h:916
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1070
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL IsWindow() const
Definition: atlwin.h:879
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
int32_t INT
Definition: typedefs.h:56
DWORD WINAPI GetSysColor(_In_ int)
#define CDIS_MARKED
Definition: commctrl.h:283
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: taskswnd.cpp:311
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:917
#define CDRF_DODEFAULT
Definition: commctrl.h:253
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define TBCDRF_NOBACKGROUND
Definition: commctrl.h:1012
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1053
LONG_PTR LRESULT
Definition: windef.h:209
HBRUSH WINAPI GetSysColorBrush(_In_ int)
HWND hWnd
Definition: taskswnd.cpp:81

Referenced by HandleToolbarNotification().

◆ HandleTaskGroupClick()

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

Definition at line 1596 of file taskswnd.cpp.

1597  {
1598  /* TODO: Show task group menu */
1599  }

Referenced by HandleButtonClick().

◆ HandleTaskGroupRightClick()

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

Definition at line 1646 of file taskswnd.cpp.

1647  {
1648  /* TODO: Show task group right click menu */
1649  }

Referenced by HandleButtonRightClick().

◆ HandleTaskItemClick()

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

Definition at line 1566 of file taskswnd.cpp.

1567  {
1568  BOOL bIsMinimized;
1569  BOOL bIsActive;
1570 
1571  if (::IsWindow(TaskItem->hWnd))
1572  {
1573  bIsMinimized = ::IsIconic(TaskItem->hWnd);
1574  bIsActive = (TaskItem == m_ActiveTaskItem);
1575 
1576  TRACE("Active TaskItem %p, selected TaskItem %p\n", m_ActiveTaskItem, TaskItem);
1577  if (m_ActiveTaskItem)
1578  TRACE("Active TaskItem hWnd=%p, TaskItem hWnd %p\n", m_ActiveTaskItem->hWnd, TaskItem->hWnd);
1579 
1580  TRACE("Valid button clicked. HWND=%p, IsMinimized=%s, IsActive=%s...\n",
1581  TaskItem->hWnd, bIsMinimized ? "Yes" : "No", bIsActive ? "Yes" : "No");
1582 
1583  if (!bIsMinimized && bIsActive)
1584  {
1585  ::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE);
1586  TRACE("Valid button clicked. App window Minimized.\n");
1587  }
1588  else
1589  {
1590  ::SwitchToThisWindow(TaskItem->hWnd, TRUE);
1591  TRACE("Valid button clicked. App window Restored.\n");
1592  }
1593  }
1594  }
#define TRUE
Definition: types.h:120
BOOL ShowWindowAsync(int nCmdShow)
Definition: atlwin.h:1271
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:309
BOOL IsWindow() const
Definition: atlwin.h:879
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRACE(s)
Definition: solgame.cpp:4
#define SW_MINIMIZE
Definition: winuser.h:770
BOOL IsIconic() const
Definition: atlwin.h:864
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
HWND hWnd
Definition: taskswnd.cpp:81

Referenced by HandleButtonClick().

◆ HandleTaskItemRightClick()

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

Definition at line 1627 of file taskswnd.cpp.

1628  {
1629  POINT pt;
1630  GetCursorPos(&pt);
1631 
1632  SetForegroundWindow(TaskItem->hWnd);
1633 
1634  ActivateTask(TaskItem->hWnd);
1635 
1636  /* Wait up to 2 seconds for the window to process the foreground notification. */
1637  DWORD_PTR resultDummy;
1638  if (!SendMessageTimeout(TaskItem->hWnd, WM_NULL, 0, 0, 0, 2000, &resultDummy))
1639  ERR("HandleTaskItemRightClick detected the window was unresponsive for 2 seconds, or was destroyed\n");
1640  if (GetForegroundWindow() != TaskItem->hWnd)
1641  ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
1642 
1643  ::SendMessageW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y));
1644  }
#define WM_NULL
Definition: winuser.h:1589
#define pt(x, y)
Definition: drawing.c:79
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1127
#define WM_POPUPSYSTEMMENU
Definition: undocuser.h:59
#define SendMessageTimeout
Definition: winuser.h:5746
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define ERR(fmt,...)
Definition: debug.h:109
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
BOOL WINAPI SetForegroundWindow(_In_ HWND)

Referenced by HandleButtonRightClick().

◆ HandleToolbarNotification()

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

Definition at line 1720 of file taskswnd.cpp.

1721  {
1722  LRESULT Ret = 0;
1723 
1724  switch (nmh->code)
1725  {
1726  case NM_CUSTOMDRAW:
1727  {
1728  LPNMTBCUSTOMDRAW nmtbcd = (LPNMTBCUSTOMDRAW) nmh;
1729 
1730  switch (nmtbcd->nmcd.dwDrawStage)
1731  {
1732 
1733  case CDDS_ITEMPREPAINT:
1734  Ret = HandleItemPaint(nmtbcd);
1735  break;
1736 
1737  case CDDS_PREPAINT:
1738  Ret = CDRF_NOTIFYITEMDRAW;
1739  break;
1740 
1741  default:
1742  Ret = CDRF_DODEFAULT;
1743  break;
1744  }
1745  break;
1746  }
1747  }
1748 
1749  return Ret;
1750  }
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:270
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:260
NMCUSTOMDRAW nmcd
Definition: commctrl.h:989
#define CDRF_DODEFAULT
Definition: commctrl.h:253
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define CDDS_PREPAINT
Definition: commctrl.h:265
struct _NMTBCUSTOMDRAW * LPNMTBCUSTOMDRAW
LRESULT HandleItemPaint(IN OUT NMTBCUSTOMDRAW *nmtbcd)
Definition: taskswnd.cpp:1677
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by OnNotify().

◆ Initialize()

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

Definition at line 1936 of file taskswnd.cpp.

1937  {
1938  m_Tray = tray;
1941  if (!m_hWnd)
1942  return E_FAIL;
1943  return S_OK;
1944  }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
HWND Create(HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
Definition: atlwin.h:1631
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define E_FAIL
Definition: ddrawi.h:102
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
BOOL bGroupButtons
Definition: precomp.h:206
const WCHAR szRunningApps[]
Definition: taskswnd.cpp:33
HWND m_hWnd
Definition: atlwin.h:268
#define WS_TABSTOP
Definition: pedump.c:634
#define S_OK
Definition: intsafe.h:59
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300
#define WS_VISIBLE
Definition: pedump.c:620

◆ OnCommand()

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

Definition at line 1795 of file taskswnd.cpp.

1796  {
1797  LRESULT Ret = TRUE;
1798  if (lParam != 0 && (HWND) lParam == m_TaskBar.m_hWnd)
1799  {
1801  }
1802  return Ret;
1803  }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
BOOL HandleButtonClick(IN WORD wIndex)
Definition: taskswnd.cpp:1601
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

◆ OnContextMenu()

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

Definition at line 1840 of file taskswnd.cpp.

1841  {
1842  LRESULT Ret = 0;
1843  INT_PTR iBtn = -1;
1844 
1845  if (m_TaskBar.m_hWnd != NULL)
1846  {
1847  POINT pt;
1848 
1849  pt.x = GET_X_LPARAM(lParam);
1850  pt.y = GET_Y_LPARAM(lParam);
1851 
1852  ::ScreenToClient(m_TaskBar.m_hWnd, &pt);
1853 
1854  iBtn = m_TaskBar.HitTest(&pt);
1855  if (iBtn >= 0)
1856  {
1857  HandleButtonRightClick(iBtn);
1858  }
1859  }
1860  if (iBtn < 0)
1861  {
1862  /* Not on a taskbar button, so forward message to tray */
1863  Ret = SendMessage(m_Tray->GetHWND(), uMsg, wParam, lParam);
1864  }
1865  return Ret;
1866  }
INT HitTest(PPOINT ppt)
Definition: rosctrls.h:423
#define pt(x, y)
Definition: drawing.c:79
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
int32_t INT_PTR
Definition: typedefs.h:62
WPARAM wParam
Definition: combotst.c:138
BOOL HandleButtonRightClick(IN WORD wIndex)
Definition: taskswnd.cpp:1651
smooth NULL
Definition: ftsmooth.c:416
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
BOOL ScreenToClient(LPPOINT lpPoint) const
Definition: atlwin.h:1024
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1048
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

◆ OnCopyData()

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

Definition at line 1920 of file taskswnd.cpp.

1921  {
1923  if (cpData->dwData == m_uHardErrorMsg)
1924  {
1925  /* A hard error balloon message */
1927  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));
1928  if (pData->cbHeaderSize == sizeof(BALLOON_HARD_ERROR_DATA))
1930  return TRUE;
1931  }
1932 
1933  return FALSE;
1934  }
#define TRUE
Definition: types.h:120
void StartThread(PBALLOON_HARD_ERROR_DATA pData)
Definition: taskswnd.cpp:178
uint32_t ULONG_PTR
Definition: typedefs.h:63
ULONG_PTR dwData
Definition: winuser.h:2975
struct _BALLOON_HARD_ERROR_DATA * PBALLOON_HARD_ERROR_DATA
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:322
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
#define ERR(fmt,...)
Definition: debug.h:109
#define ULONG_PTR
Definition: config.h:101
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
LPARAM lParam
Definition: combotst.c:139
CHardErrorThread m_HardErrorThread
Definition: taskswnd.cpp:323

◆ OnCreate()

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

Definition at line 1424 of file taskswnd.cpp.

1425  {
1426  if (!m_TaskBar.Initialize(m_hWnd))
1427  return FALSE;
1428 
1429  SetWindowTheme(m_TaskBar.m_hWnd, L"TaskBand", NULL);
1430 
1433 
1434  /* Set proper spacing between buttons */
1435  m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1436 
1437  /* Register the shell hook */
1438  m_ShellHookMsg = RegisterWindowMessageW(L"SHELLHOOK");
1439 
1440  TRACE("ShellHookMsg got assigned number %d\n", m_ShellHookMsg);
1441 
1442  RegisterShellHook(m_hWnd, 3); /* 1 if no NT! We're targeting NT so we don't care! */
1443 
1445 
1446  /* Recalculate the button size */
1448 
1449 #if DUMP_TASKS != 0
1450  SetTimer(hwnd, 1, 5000, NULL);
1451 #endif
1452  return TRUE;
1453  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI RegisterShellHook(HWND hWnd, DWORD dwType)
Definition: shellord.c:308
#define TRUE
Definition: types.h:120
BOOL Initialize(HWND hWndParent)
Definition: taskswnd.cpp:282
#define SM_CYSMICON
Definition: winuser.h:1003
#define ILC_COLOR32
Definition: commctrl.h:343
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
UINT_PTR SetTimer(UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
Definition: atlwin.h:1190
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
smooth NULL
Definition: ftsmooth.c:416
HIMAGELIST SetImageList(HIMAGELIST himl)
Definition: rosctrls.h:417
HTHEME m_Theme
Definition: taskswnd.cpp:311
BOOL RefreshWindowList()
Definition: taskswnd.cpp:1402
#define TRACE(s)
Definition: solgame.cpp:4
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
static const WCHAR L[]
Definition: oid.c:1250
#define ILC_MASK
Definition: commctrl.h:336
HWND m_hWnd
Definition: atlwin.h:268
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:315
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
UINT m_ShellHookMsg
Definition: taskswnd.cpp:302
INT UpdateTbButtonSpacing(IN BOOL bHorizontal, IN BOOL bThemed, IN UINT uiRows=0, IN UINT uiBtnsPerLine=0)
Definition: taskswnd.cpp:203
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1242

◆ OnDestroy()

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

Definition at line 1455 of file taskswnd.cpp.

1456  {
1457  m_IsDestroying = TRUE;
1458 
1459  /* Unregister the shell hook */
1461 
1463  DeleteAllTasks();
1464  return TRUE;
1465  }
BOOL WINAPI RegisterShellHook(HWND hWnd, DWORD dwType)
Definition: shellord.c:308
#define TRUE
Definition: types.h:120
VOID DeleteAllTasks()
Definition: taskswnd.cpp:1168
HTHEME m_Theme
Definition: taskswnd.cpp:311
HWND m_hWnd
Definition: atlwin.h:268
BOOL m_IsDestroying
Definition: taskswnd.cpp:318
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 1752 of file taskswnd.cpp.

1753  {
1754  HDC hdc = (HDC) wParam;
1755 
1756  if (!IsAppThemed())
1757  {
1758  bHandled = FALSE;
1759  return 0;
1760  }
1761 
1762  RECT rect;
1763  GetClientRect(&rect);
1765 
1766  return TRUE;
1767  }
#define TRUE
Definition: types.h:120
static HDC
Definition: imagelist.c:92
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI IsAppThemed(void)
Definition: system.c:596
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
HDC hdc
Definition: main.c:9
HWND m_hWnd
Definition: atlwin.h:268

◆ OnKludgeItemRect()

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

Definition at line 1868 of file taskswnd.cpp.

1869  {
1870  PTASK_ITEM TaskItem = FindTaskItem((HWND) wParam);
1871  if (TaskItem)
1872  {
1873  RECT* prcMinRect = (RECT*) lParam;
1874  RECT rcItem, rcToolbar;
1875  m_TaskBar.GetItemRect(TaskItem->Index, &rcItem);
1876  m_TaskBar.GetWindowRect(&rcToolbar);
1877 
1878  OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top);
1879 
1880  *prcMinRect = rcItem;
1881  return TRUE;
1882  }
1883  return FALSE;
1884  }
#define TRUE
Definition: types.h:120
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
LONG top
Definition: windef.h:292
LONG left
Definition: windef.h:291
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:852
WPARAM wParam
Definition: combotst.c:138
DWORD GetItemRect(int index, LPRECT prcItem)
Definition: rosctrls.h:396
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
LPARAM lParam
Definition: combotst.c:139

◆ OnMouseActivate()

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

Definition at line 1886 of file taskswnd.cpp.

1887  {
1888  return MA_NOACTIVATE;
1889  }
#define MA_NOACTIVATE
Definition: winuser.h:2478

◆ OnNcHitTest()

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

Definition at line 1784 of file taskswnd.cpp.

1785  {
1786  LRESULT Ret = TRUE;
1787  /* We want the tray window to be draggable everywhere, so make the control
1788  appear transparent */
1789  Ret = DefWindowProc(uMsg, wParam, lParam);
1790  if (Ret != HTVSCROLL && Ret != HTHSCROLL)
1791  Ret = HTTRANSPARENT;
1792  return Ret;
1793  }
#define HTHSCROLL
Definition: winuser.h:2456
#define HTTRANSPARENT
Definition: winuser.h:2448
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
LRESULT DefWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: atlwin.h:1521
#define HTVSCROLL
Definition: winuser.h:2457
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

◆ OnNotify()

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

Definition at line 1805 of file taskswnd.cpp.

1806  {
1807  LRESULT Ret = TRUE;
1808  const NMHDR *nmh = (const NMHDR *) lParam;
1809 
1810  if (nmh->hwndFrom == m_TaskBar.m_hWnd)
1811  {
1812  Ret = HandleToolbarNotification(nmh);
1813  }
1814  return Ret;
1815  }
#define TRUE
Definition: types.h:120
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
LRESULT HandleToolbarNotification(IN const NMHDR *nmh)
Definition: taskswnd.cpp:1720
HWND hwndFrom
Definition: winuser.h:3131
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

◆ OnSetFont()

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

Definition at line 1904 of file taskswnd.cpp.

1905  {
1906  return m_TaskBar.SendMessageW(uMsg, wParam, lParam);
1907  }
WPARAM wParam
Definition: combotst.c:138
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
LPARAM lParam
Definition: combotst.c:139

◆ OnSettingChanged()

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

Definition at line 1909 of file taskswnd.cpp.

1910  {
1911  if (wParam == SPI_SETNONCLIENTMETRICS)
1912  {
1913  /* Don't update the font, this will be done when we get a WM_SETFONT from our parent */
1915  }
1916 
1917  return 0;
1918  }
WPARAM wParam
Definition: combotst.c:138
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1242

◆ OnShellHook()

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

Definition at line 1488 of file taskswnd.cpp.

1489  {
1490  BOOL Ret = FALSE;
1491 
1492  /* In case the shell hook wasn't registered properly, ignore WM_NULLs*/
1493  if (uMsg == 0)
1494  {
1495  bHandled = FALSE;
1496  return 0;
1497  }
1498 
1499  TRACE("Received shell hook message: wParam=%08lx, lParam=%08lx\n", wParam, lParam);
1500 
1501  switch ((INT) wParam)
1502  {
1503  case HSHELL_APPCOMMAND:
1504  Ret = HandleAppCommand(wParam, lParam);
1505  break;
1506 
1507  case HSHELL_WINDOWCREATED:
1508  AddTask((HWND) lParam);
1509  break;
1510 
1512  /* The window still exists! Delay destroying it a bit */
1513  DeleteTask((HWND) lParam);
1514  break;
1515 
1517  case HSHELL_WINDOWACTIVATED:
1519  break;
1520 
1521  case HSHELL_FLASH:
1522  FlashTask((HWND) lParam);
1523  break;
1524 
1525  case HSHELL_REDRAW:
1526  RedrawTask((HWND) lParam);
1527  break;
1528 
1529  case HSHELL_TASKMAN:
1530  ::PostMessage(m_Tray->GetHWND(), TWM_OPENSTARTMENU, 0, 0);
1531  break;
1532 
1534  case HSHELL_LANGUAGE:
1535  case HSHELL_SYSMENU:
1536  case HSHELL_ENDTASK:
1537  case HSHELL_ACCESSIBILITYSTATE:
1538  case HSHELL_WINDOWREPLACED:
1539  case HSHELL_WINDOWREPLACING:
1540 
1541  case HSHELL_GETMINRECT:
1542  default:
1543  {
1544 #if DEBUG_SHELL_HOOK
1545  int i, found;
1546  for (i = 0, found = 0; i != _countof(hshell_msg); i++)
1547  {
1548  if (hshell_msg[i].msg == (INT) wParam)
1549  {
1550  TRACE("Shell message %ws unhandled (lParam = 0x%p)!\n", hshell_msg[i].msg_name, lParam);
1551  found = 1;
1552  break;
1553  }
1554  }
1555  if (found)
1556  break;
1557 #endif
1558  TRACE("Shell message %d unhandled (lParam = 0x%p)!\n", (INT) wParam, lParam);
1559  break;
1560  }
1561  }
1562 
1563  return Ret;
1564  }
#define _countof(array)
Definition: fontsub.cpp:30
#define HSHELL_FLASH
Definition: winuser.h:1262
#define HSHELL_WINDOWCREATED
Definition: winuser.h:1240
BOOL HandleAppCommand(IN WPARAM wParam, IN LPARAM lParam)
Definition: taskswnd.cpp:1467
BOOL FlashTask(IN HWND hWnd)
Definition: taskswnd.cpp:1188
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1127
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
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL RedrawTask(IN HWND hWnd)
Definition: taskswnd.cpp:1228
#define TWM_OPENSTARTMENU
Definition: precomp.h:131
BOOL DeleteTask(IN HWND hWnd)
Definition: taskswnd.cpp:1151
#define TRACE(s)
Definition: solgame.cpp:4
BOOL AddTask(IN HWND hWnd)
Definition: taskswnd.cpp:1086
#define HSHELL_WINDOWDESTROYED
Definition: winuser.h:1241
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:976
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300
#define HSHELL_RUDEAPPACTIVATED
Definition: winuser.h:1263
#define msg(x)
Definition: auth_time.c:54
#define HSHELL_ACTIVATESHELLWINDOW
Definition: winuser.h:1242
LPARAM lParam
Definition: combotst.c:139

◆ OnSize()

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

Definition at line 1769 of file taskswnd.cpp.

1770  {
1771  SIZE szClient;
1772 
1773  szClient.cx = LOWORD(lParam);
1774  szClient.cy = HIWORD(lParam);
1775  if (m_TaskBar.m_hWnd != NULL)
1776  {
1777  m_TaskBar.SetWindowPos(NULL, 0, 0, szClient.cx, szClient.cy, SWP_NOZORDER);
1778 
1780  }
1781  return TRUE;
1782  }
#define TRUE
Definition: types.h:120
#define SWP_NOZORDER
Definition: winuser.h:1232
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:319
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
#define HIWORD(l)
Definition: typedefs.h:246
LONG cy
Definition: windef.h:320
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1242

◆ OnTaskbarSettingsChanged()

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

Definition at line 1824 of file taskswnd.cpp.

1825  {
1826  TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
1827  if (newSettings->bGroupButtons != g_TaskbarSettings.bGroupButtons)
1828  {
1831 
1832  /* Collapse or expand groups if necessary */
1835  }
1836 
1837  return 0;
1838  }
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
BOOL RefreshWindowList()
Definition: taskswnd.cpp:1402
BOOL bGroupButtons
Definition: precomp.h:206
LPARAM lParam
Definition: combotst.c:139
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1242

◆ OnThemeChanged()

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

Definition at line 1409 of file taskswnd.cpp.

1410  {
1411  TRACE("OmThemeChanged\n");
1412 
1413  if (m_Theme)
1415 
1416  if (IsThemeActive())
1417  m_Theme = OpenThemeData(m_hWnd, L"TaskBand");
1418  else
1419  m_Theme = NULL;
1420 
1421  return TRUE;
1422  }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: taskswnd.cpp:311
#define TRACE(s)
Definition: solgame.cpp:4
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
BOOL WINAPI IsThemeActive(void)
Definition: system.c:606
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950

◆ OnTimer()

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

Definition at line 1891 of file taskswnd.cpp.

1892  {
1893 #if DUMP_TASKS != 0
1894  switch (wParam)
1895  {
1896  case 1:
1897  DumpTasks();
1898  break;
1899  }
1900 #endif
1901  return TRUE;
1902  }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138

◆ OnUpdateTaskbarPos()

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

Definition at line 1817 of file taskswnd.cpp.

1818  {
1819  /* Update the button spacing */
1820  m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1821  return TRUE;
1822  }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: taskswnd.cpp:311
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
INT UpdateTbButtonSpacing(IN BOOL bHorizontal, IN BOOL bThemed, IN UINT uiRows=0, IN UINT uiBtnsPerLine=0)
Definition: taskswnd.cpp:203
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300

◆ RedrawTask()

BOOL CTaskSwitchWnd::RedrawTask ( IN HWND  hWnd)
inline

Definition at line 1228 of file taskswnd.cpp.

1229  {
1230  PTASK_ITEM TaskItem;
1231 
1232  TaskItem = FindTaskItem(hWnd);
1233  if (TaskItem != NULL)
1234  {
1235  RedrawTaskItem(TaskItem);
1236  return TRUE;
1237  }
1238 
1239  return FALSE;
1240  }
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
VOID RedrawTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1203
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:852
smooth NULL
Definition: ftsmooth.c:416

Referenced by OnShellHook().

◆ RedrawTaskItem()

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

Definition at line 1203 of file taskswnd.cpp.

1204  {
1205  PTASK_GROUP TaskGroup;
1206 
1207  TaskGroup = TaskItem->Group;
1208  if (m_IsGroupingEnabled && TaskGroup != NULL)
1209  {
1210  if (TaskGroup->IsCollapsed && TaskGroup->Index >= 0)
1211  {
1212  UpdateTaskGroupButton(TaskGroup);
1213  }
1214  else if (TaskItem->Index >= 0)
1215  {
1216  goto UpdateTaskItem;
1217  }
1218  }
1219  else if (TaskItem->Index >= 0)
1220  {
1221  UpdateTaskItem:
1222  TaskItem->RenderFlashed = 0;
1223  UpdateTaskItemButton(TaskItem);
1224  }
1225  }
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:317
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:511
smooth NULL
Definition: ftsmooth.c:416
DWORD IsCollapsed
Definition: taskswnd.cpp:74
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:468

Referenced by RedrawTask().

◆ RefreshWindowList()

BOOL CTaskSwitchWnd::RefreshWindowList ( )
inline

Definition at line 1402 of file taskswnd.cpp.

1403  {
1404  TRACE("Refreshing window list...\n");
1405  /* Add all windows to the toolbar */
1406  return EnumWindows(s_EnumWindowsProc, (LPARAM)this);
1407  }
LONG_PTR LPARAM
Definition: windef.h:208
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC, _In_ LPARAM)
static BOOL CALLBACK s_EnumWindowsProc(IN HWND hWnd, IN LPARAM lParam)
Definition: taskswnd.cpp:1395

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

◆ RemoveIcon()

VOID CTaskSwitchWnd::RemoveIcon ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 557 of file taskswnd.cpp.

558  {
559  TBBUTTONINFO tbbi;
560  PTASK_ITEM currentTaskItem, LastItem;
561 
562  if (TaskItem->IconIndex == -1)
563  return;
564 
565  tbbi.cbSize = sizeof(tbbi);
566  tbbi.dwMask = TBIF_IMAGE;
567 
568  currentTaskItem = m_TaskItems;
569  LastItem = currentTaskItem + m_TaskItemCount;
570  while (currentTaskItem != LastItem)
571  {
572  if (currentTaskItem->IconIndex > TaskItem->IconIndex)
573  {
574  currentTaskItem->IconIndex--;
575  tbbi.iImage = currentTaskItem->IconIndex;
576 
577  m_TaskBar.SetButtonInfo(currentTaskItem->Index, &tbbi);
578  }
579  currentTaskItem++;
580  }
581 
582  ImageList_Remove(m_ImageList, TaskItem->IconIndex);
583  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
#define TBIF_IMAGE
Definition: commctrl.h:1191
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
INT IconIndex
Definition: taskswnd.cpp:84
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
Definition: imagelist.c:2568
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:315
DWORD SetButtonInfo(int cmdId, TBBUTTONINFO *info)
Definition: rosctrls.h:350
#define TBBUTTONINFO
Definition: commctrl.h:1226

Referenced by DeleteTaskItemButton().

◆ RemoveTaskFromTaskGroup()

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

Definition at line 806 of file taskswnd.cpp.

807  {
808  PTASK_GROUP TaskGroup, CurrentGroup, *PrevLink;
809 
810  TaskGroup = TaskItem->Group;
811  if (TaskGroup != NULL)
812  {
813  DWORD dwNewTaskCount = --TaskGroup->dwTaskCount;
814  if (dwNewTaskCount == 0)
815  {
816  /* Find the previous pointer in the chain */
817  CurrentGroup = m_TaskGroups;
818  PrevLink = &m_TaskGroups;
819  while (CurrentGroup != TaskGroup)
820  {
821  PrevLink = &CurrentGroup->Next;
822  CurrentGroup = CurrentGroup->Next;
823  }
824 
825  /* Remove the group from the list */
826  ASSERT(TaskGroup == CurrentGroup);
827  *PrevLink = TaskGroup->Next;
828 
829  /* Free the task group */
831  0,
832  TaskGroup);
833  }
834  else if (TaskGroup->IsCollapsed &&
835  TaskGroup->Index >= 0)
836  {
837  if (dwNewTaskCount > 1)
838  {
839  /* FIXME: Check if we should expand the group */
840  /* Update the task group button */
841  UpdateTaskGroupButton(TaskGroup);
842  }
843  else
844  {
845  /* Expand the group of one task button to a task button */
846  ExpandTaskGroup(TaskGroup);
847  }
848  }
849  }
850  }
struct _TASK_GROUP * Next
Definition: taskswnd.cpp:63
smooth NULL
Definition: ftsmooth.c:416
DWORD dwTaskCount
Definition: taskswnd.cpp:65
unsigned long DWORD
Definition: ntddk_ex.h:95
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:307
DWORD IsCollapsed
Definition: taskswnd.cpp:74
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:468
VOID ExpandTaskGroup(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:477
#define HeapFree(x, y, z)
Definition: compat.h:394
HANDLE hProcessHeap
Definition: kbswitch.c:25

Referenced by DeleteTaskItem().

◆ s_EnumWindowsProc()

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

Definition at line 1395 of file taskswnd.cpp.

1396  {
1398 
1399  return This->EnumWindowsProc(hWnd);
1400  }
HWND hWnd
Definition: settings.c:17
LPARAM lParam
Definition: combotst.c:139

Referenced by RefreshWindowList().

◆ UpdateButtonsSize()

VOID CTaskSwitchWnd::UpdateButtonsSize ( IN BOOL  bRedrawDisabled)
inline

Definition at line 1242 of file taskswnd.cpp.

1243  {
1244  RECT rcClient;
1245  UINT uiRows, uiMax, uiMin, uiBtnsPerLine, ui;
1246  LONG NewBtnSize;
1247  BOOL Horizontal;
1248 
1249  /* Update the size of the image list if needed */
1250  int cx, cy;
1253  {
1255 
1256  /* SetIconSize removes all icons so we have to reinsert them */
1257  PTASK_ITEM TaskItem = m_TaskItems;
1258  PTASK_ITEM LastTaskItem = m_TaskItems + m_TaskItemCount;
1259  while (TaskItem != LastTaskItem)
1260  {
1261  TaskItem->IconIndex = -1;
1262  UpdateTaskItemButton(TaskItem);
1263 
1264  TaskItem++;
1265  }
1267  }
1268 
1269  if (GetClientRect(&rcClient) && !IsRectEmpty(&rcClient))
1270  {
1271  if (m_ButtonCount > 0)
1272  {
1273  Horizontal = m_Tray->IsHorizontal();
1274 
1275  if (Horizontal)
1276  {
1277  TBMETRICS tbm = { 0 };
1278  tbm.cbSize = sizeof(tbm);
1279  tbm.dwMask = TBMF_BUTTONSPACING;
1280  m_TaskBar.GetMetrics(&tbm);
1281 
1282  if (m_ButtonSize.cy + tbm.cyButtonSpacing != 0)
1283  uiRows = (rcClient.bottom + tbm.cyButtonSpacing) / (m_ButtonSize.cy + tbm.cyButtonSpacing);
1284  else
1285  uiRows = 1;
1286 
1287  if (uiRows == 0)
1288  uiRows = 1;
1289 
1290  uiBtnsPerLine = (m_ButtonCount + uiRows - 1) / uiRows;
1291  }
1292  else
1293  {
1294  uiBtnsPerLine = 1;
1295  uiRows = m_ButtonCount;
1296  }
1297 
1298  if (!bRedrawDisabled)
1300 
1301  /* We might need to update the button spacing */
1302  int cxButtonSpacing = m_TaskBar.UpdateTbButtonSpacing(
1303  Horizontal, m_Theme != NULL,
1304  uiRows, uiBtnsPerLine);
1305 
1306  /* Determine the minimum and maximum width of a button */
1308  if (Horizontal)
1309  {
1311 
1312  /* Calculate the ideal width and make sure it's within the allowed range */
1313  NewBtnSize = (rcClient.right - (uiBtnsPerLine * cxButtonSpacing)) / uiBtnsPerLine;
1314 
1315  if (NewBtnSize < (LONG) uiMin)
1316  NewBtnSize = uiMin;
1317  if (NewBtnSize >(LONG)uiMax)
1318  NewBtnSize = uiMax;
1319 
1320  /* Recalculate how many buttons actually fit into one line */
1321  uiBtnsPerLine = rcClient.right / (NewBtnSize + cxButtonSpacing);
1322  if (uiBtnsPerLine == 0)
1323  uiBtnsPerLine++;
1324  }
1325  else
1326  {
1327  NewBtnSize = uiMax = rcClient.right;
1328  }
1329 
1330  m_ButtonSize.cx = NewBtnSize;
1331 
1332  m_ButtonsPerLine = uiBtnsPerLine;
1333 
1334  for (ui = 0; ui != m_ButtonCount; ui++)
1335  {
1336  TBBUTTONINFOW tbbi = { 0 };
1337  tbbi.cbSize = sizeof(tbbi);
1339  tbbi.cx = (INT) NewBtnSize;
1340  tbbi.fsState = TBSTATE_ENABLED;
1341 
1342  /* Check if we're updating a button that is the last one in the
1343  line. If so, we need to set the TBSTATE_WRAP flag! */
1344  if (Horizontal)
1345  {
1346  if ((ui + 1) % uiBtnsPerLine == 0)
1347  tbbi.fsState |= TBSTATE_WRAP;
1348  }
1349  else
1350  {
1351  tbbi.fsState |= TBSTATE_WRAP;
1352  }
1353 
1354  if (m_ActiveTaskItem != NULL &&
1356  {
1357  tbbi.fsState |= TBSTATE_CHECKED;
1358  }
1359 
1360  m_TaskBar.SetButtonInfo(ui, &tbbi);
1361  }
1362  }
1363  else
1364  {
1365  m_ButtonsPerLine = 0;
1366  m_ButtonSize.cx = 0;
1367  }
1368  }
1369 
1370  // FIXME: This seems to be enabling redraws prematurely, but moving it to its right place doesn't work!
1371  m_TaskBar.EndUpdate();
1372  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:304
#define SM_CXMINIMIZED
Definition: winuser.h:1010
#define TBIF_BYINDEX
Definition: commctrl.h:1198
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:309
UINT ui
Definition: oleauto.h:49
#define INT
Definition: polytest.cpp:20
DWORD dwMask
Definition: commctrl.h:1215
#define SM_CXEDGE
Definition: winuser.h:998
#define SM_CYSMICON
Definition: winuser.h:1003
LONG right
Definition: windef.h:293
int32_t INT
Definition: typedefs.h:56
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:511
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:308
WORD m_ButtonCount
Definition: taskswnd.cpp:313
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:312
BOOL GetClientRect(LPRECT lpRect) const
Definition: atlwin.h:507
#define TBMF_BUTTONSPACING
Definition: commctrl.h:1261
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
DWORD GetMetrics(TBMETRICS *tbm)
Definition: rosctrls.h:386
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:319
HIMAGELIST SetImageList(HIMAGELIST himl)
Definition: rosctrls.h:417
HTHEME m_Theme
Definition: taskswnd.cpp:311
INT IconIndex
Definition: taskswnd.cpp:84
#define TBIF_STATE
Definition: commctrl.h:1193
int cyButtonSpacing
Definition: commctrl.h:1271
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
VOID BeginUpdate()
Definition: taskswnd.cpp:235
UINT cbSize
Definition: commctrl.h:1264
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:315
#define TBSTATE_CHECKED
Definition: commctrl.h:944
unsigned int UINT
Definition: ndis.h:50
INT UpdateTbButtonSpacing(IN BOOL bHorizontal, IN BOOL bThemed, IN UINT uiRows=0, IN UINT uiBtnsPerLine=0)
Definition: taskswnd.cpp:203
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300
_Out_opt_ int * cx
Definition: commctrl.h:570
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define SM_CXSIZE
Definition: winuser.h:981
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
Definition: imagelist.c:2037
DWORD dwMask
Definition: commctrl.h:1265
#define TBSTATE_WRAP
Definition: commctrl.h:949
DWORD SetButtonInfo(int cmdId, TBBUTTONINFO *info)
Definition: rosctrls.h:350
LONG bottom
Definition: windef.h:294
#define TBIF_SIZE
Definition: commctrl.h:1197
VOID EndUpdate()
Definition: taskswnd.cpp:240
BOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl, INT cx, INT cy)
Definition: imagelist.c:3038
LONG cy
Definition: windef.h:320

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

◆ UpdateIndexesAfter()

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

Definition at line 405 of file taskswnd.cpp.

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

Referenced by AddTaskItemButton(), and DeleteTaskItemButton().

◆ UpdateTaskGroupButton()

INT CTaskSwitchWnd::UpdateTaskGroupButton ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 468 of file taskswnd.cpp.

469  {
470  ASSERT(TaskGroup->Index >= 0);
471 
472  /* FIXME: Implement */
473 
474  return TaskGroup->Index;
475  }
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)

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

◆ UpdateTaskItemButton()

INT CTaskSwitchWnd::UpdateTaskItemButton ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 511 of file taskswnd.cpp.

512  {
513  TBBUTTONINFO tbbi = { 0 };
514  HICON icon;
515  WCHAR windowText[255];
516 
517  ASSERT(TaskItem->Index >= 0);
518 
519  tbbi.cbSize = sizeof(tbbi);
520  tbbi.dwMask = TBIF_BYINDEX | TBIF_STATE | TBIF_TEXT | TBIF_IMAGE;
521  tbbi.fsState = TBSTATE_ENABLED;
522  if (m_ActiveTaskItem == TaskItem)
523  tbbi.fsState |= TBSTATE_CHECKED;
524 
525  if (TaskItem->RenderFlashed)
526  tbbi.fsState |= TBSTATE_MARKED;
527 
528  /* Check if we're updating a button that is the last one in the
529  line. If so, we need to set the TBSTATE_WRAP flag! */
530  if (!m_Tray->IsHorizontal() || (m_ButtonsPerLine != 0 &&
531  (TaskItem->Index + 1) % m_ButtonsPerLine == 0))
532  {
533  tbbi.fsState |= TBSTATE_WRAP;
534  }
535 
537  {
538  tbbi.pszText = windowText;
539  }
540 
541  icon = GetWndIcon(TaskItem->hWnd);
542  if (!icon)
543  icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
544  TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, TaskItem->IconIndex, icon);
545  tbbi.iImage = TaskItem->IconIndex;
546 
547  if (!m_TaskBar.SetButtonInfo(TaskItem->Index, &tbbi))
548  {
549  TaskItem->Index = -1;
550  return -1;
551  }
552 
553  TRACE("Updated button %d for hwnd 0x%p\n", TaskItem->Index, TaskItem->hWnd);
554  return TaskItem->Index;
555  }
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2779
static HICON
Definition: imagelist.c:84
#define LR_SHARED
Definition: winuser.h:1090
#define IMAGE_ICON
Definition: winuser.h:212
#define TBIF_BYINDEX
Definition: commctrl.h:1198
#define _countof(array)
Definition: fontsub.cpp:30
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:309
#define TBIF_IMAGE
Definition: commctrl.h:1191
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:312
smooth NULL
Definition: ftsmooth.c:416
#define TBIF_STATE
Definition: commctrl.h:1193
#define TRACE(s)
Definition: solgame.cpp:4
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
__wchar_t WCHAR
Definition: xmlstorage.h:180
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:298
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:486
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define TBSTATE_MARKED
Definition: commctrl.h:951
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:315
#define TBSTATE_CHECKED
Definition: commctrl.h:944
#define TBIF_TEXT
Definition: commctrl.h:1192
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:300
WCHAR windowText[1024]
Definition: appswitch.c:49
#define TBSTATE_ENABLED
Definition: commctrl.h:946
#define TBSTATE_WRAP
Definition: commctrl.h:949
DWORD SetButtonInfo(int cmdId, TBBUTTONINFO *info)
Definition: rosctrls.h:350
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define OIC_SAMPLE
Definition: winuser.h:1148
INT GetWndTextFromTaskItem(IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
Definition: taskswnd.cpp:345
#define TBBUTTONINFO
Definition: commctrl.h:1226

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 305 of file taskswnd.cpp.

Referenced by AllocTaskItem().

◆ m_ButtonCount

WORD CTaskSwitchWnd::m_ButtonCount
private

◆ m_ButtonSize

SIZE CTaskSwitchWnd::m_ButtonSize
private

Definition at line 320 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and UpdateButtonsSize().

◆ m_ButtonsPerLine

UINT CTaskSwitchWnd::m_ButtonsPerLine
private

Definition at line 312 of file taskswnd.cpp.

Referenced by UpdateButtonsSize(), and UpdateTaskItemButton().

◆ m_HardErrorThread

CHardErrorThread CTaskSwitchWnd::m_HardErrorThread
private

Definition at line 323 of file taskswnd.cpp.

Referenced by OnCopyData().

◆ m_ImageList

HIMAGELIST CTaskSwitchWnd::m_ImageList
private

◆ m_IsDestroying

BOOL CTaskSwitchWnd::m_IsDestroying
private

Definition at line 318 of file taskswnd.cpp.

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

◆ m_IsGroupingEnabled

◆ m_ShellHookMsg

UINT CTaskSwitchWnd::m_ShellHookMsg
private

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

Referenced by CTaskSwitchWnd(), and OnCopyData().


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