ReactOS  0.4.14-dev-1279-gc1464a4
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 294 of file taskswnd.cpp.

Constructor & Destructor Documentation

◆ CTaskSwitchWnd()

CTaskSwitchWnd::CTaskSwitchWnd ( )
inline

Definition at line 328 of file taskswnd.cpp.

328  :
330  m_TaskItemCount(0),
333  m_TaskItems(NULL),
335  m_Theme(NULL),
336  m_ButtonsPerLine(0),
337  m_ButtonCount(0),
338  m_ImageList(NULL),
341  {
344  }
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:307
WORD m_TaskItemCount
Definition: taskswnd.cpp:306
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:311
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:319
#define ZeroMemory
Definition: winbase.h:1648
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:310
WORD m_ButtonCount
Definition: taskswnd.cpp:315
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:314
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: taskswnd.cpp:313
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:324
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:309
static const WCHAR L[]
Definition: oid.c:1250
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:317
BOOL m_IsDestroying
Definition: taskswnd.cpp:320
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
UINT m_ShellHookMsg
Definition: taskswnd.cpp:304

◆ ~CTaskSwitchWnd()

virtual CTaskSwitchWnd::~CTaskSwitchWnd ( )
inlinevirtual

Definition at line 345 of file taskswnd.cpp.

345 { }

Member Function Documentation

◆ ActivateTask()

BOOL CTaskSwitchWnd::ActivateTask ( IN HWND  hWnd)
inline

Definition at line 1129 of file taskswnd.cpp.

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

Referenced by HandleTaskItemRightClick(), and OnShellHook().

◆ ActivateTaskItem()

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

Definition at line 1117 of file taskswnd.cpp.

1118  {
1119  if (TaskItem != NULL)
1120  {
1121  TRACE("Activate window 0x%p on button %d\n", TaskItem->hWnd, TaskItem->Index);
1122  }
1123 
1124  CheckActivateTaskItem(TaskItem);
1125 
1126  return FALSE;
1127  }
VOID CheckActivateTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:997
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 1088 of file taskswnd.cpp.

1089  {
1090  PTASK_ITEM TaskItem;
1091 
1092  if (!::IsWindow(hWnd) || m_Tray->IsSpecialHWND(hWnd))
1093  return FALSE;
1094 
1095  TaskItem = FindTaskItem(hWnd);
1096  if (TaskItem == NULL)
1097  {
1098  TRACE("Add window 0x%p\n", hWnd);
1099  TaskItem = AllocTaskItem();
1100  if (TaskItem != NULL)
1101  {
1102  ZeroMemory(TaskItem, sizeof(*TaskItem));
1103  TaskItem->hWnd = hWnd;
1104  TaskItem->Index = -1;
1105  TaskItem->Group = AddToTaskGroup(hWnd);
1106 
1107  if (!m_IsDestroying)
1108  {
1109  AddTaskItemButton(TaskItem);
1110  }
1111  }
1112  }
1113 
1114  return TaskItem != NULL;
1115  }
BOOL IsWindow() const
Definition: atlwin.h:879
HWND hWnd
Definition: settings.c:17
#define ZeroMemory
Definition: winbase.h:1648
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:854
PTASK_ITEM AllocTaskItem()
Definition: taskswnd.cpp:912
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:669
BOOL m_IsDestroying
Definition: taskswnd.cpp:320
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:302
PTASK_GROUP AddToTaskGroup(IN HWND hWnd)
Definition: taskswnd.cpp:764
HWND hWnd
Definition: taskswnd.cpp:81

Referenced by EnumWindowsProc(), and OnShellHook().

◆ AddTaskItemButton()

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

Definition at line 669 of file taskswnd.cpp.

670  {
671  WCHAR windowText[255];
672  TBBUTTON tbBtn = { 0 };
673  INT iIndex;
674  HICON icon;
675 
676  if (TaskItem->Index >= 0)
677  {
678  return UpdateTaskItemButton(TaskItem);
679  }
680 
681  if (TaskItem->Group != NULL &&
682  TaskItem->Group->IsCollapsed)
683  {
684  /* The task group is collapsed, we only need to update the group button */
685  return UpdateTaskGroupButton(TaskItem->Group);
686  }
687 
688  icon = GetWndIcon(TaskItem->hWnd);
689  if (!icon)
690  icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
691  TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, -1, icon);
692 
693  tbBtn.iBitmap = TaskItem->IconIndex;
696  tbBtn.dwData = TaskItem->Index;
697 
699  {
700  tbBtn.iString = (DWORD_PTR) windowText;
701  }
702 
703  /* Find out where to insert the new button */
704  iIndex = CalculateTaskItemNewButtonIndex(TaskItem);
705  ASSERT(iIndex >= 0);
706  tbBtn.idCommand = iIndex;
707 
709 
710  if (m_TaskBar.InsertButton(iIndex, &tbBtn))
711  {
712  UpdateIndexesAfter(iIndex, TRUE);
713 
714  TRACE("Added button %d for hwnd 0x%p\n", iIndex, TaskItem->hWnd);
715 
716  TaskItem->Index = iIndex;
717  m_ButtonCount++;
718 
719  /* Update button sizes and fix the button wrapping */
721  return iIndex;
722  }
723 
725 
726  return -1;
727  }
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2779
#define BTNS_NOPREFIX
Definition: commctrl.h:1001
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
BYTE fsStyle
Definition: commctrl.h:948
int32_t INT
Definition: typedefs.h:57
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:513
WORD m_ButtonCount
Definition: taskswnd.cpp:315
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:407
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:996
smooth NULL
Definition: ftsmooth.c:416
#define BTNS_SHOWTEXT
Definition: commctrl.h:1002
INT_PTR iString
Definition: commctrl.h:955
DWORD_PTR dwData
Definition: commctrl.h:954
int iBitmap
Definition: commctrl.h:945
#define TRACE(s)
Definition: solgame.cpp:4
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:300
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:488
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID BeginUpdate()
Definition: taskswnd.cpp:235
int idCommand
Definition: commctrl.h:946
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:317
INT CalculateTaskItemNewButtonIndex(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:625
DWORD InsertButton(int insertAt, TBBUTTON *btn)
Definition: rosctrls.h:335
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:470
WCHAR windowText[1024]
Definition: appswitch.c:49
#define TBSTATE_ENABLED
Definition: commctrl.h:970
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
VOID EndUpdate()
Definition: taskswnd.cpp:240
BYTE fsState
Definition: commctrl.h:947
#define OIC_SAMPLE
Definition: winuser.h:1148
#define TBSTATE_ELLIPSES
Definition: commctrl.h:974
INT GetWndTextFromTaskItem(IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
Definition: taskswnd.cpp:347
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1244

Referenced by AddTask().

◆ AddToTaskGroup()

PTASK_GROUP CTaskSwitchWnd::AddToTaskGroup ( IN HWND  hWnd)
inline

Definition at line 764 of file taskswnd.cpp.

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

913  {
915  {
916  /* We need the most significant bit in 16 bit command IDs to indicate whether it
917  is a task group or task item. WM_COMMAND limits command IDs to 16 bits! */
918  return NULL;
919  }
920 
922 
923  if (m_TaskItemCount == 0)
924  {
926  0,
928  if (m_TaskItems != NULL)
929  {
931  }
932  else
933  return NULL;
934  }
936  {
937  PTASK_ITEM NewArray;
938  SIZE_T NewArrayLength, ActiveTaskItemIndex;
939 
940  NewArrayLength = m_AllocatedTaskItems + TASK_ITEM_ARRAY_ALLOC;
941 
942  NewArray = (PTASK_ITEM) HeapReAlloc(hProcessHeap,
943  0,
944  m_TaskItems,
945  NewArrayLength * sizeof(*m_TaskItems));
946  if (NewArray != NULL)
947  {
948  if (m_ActiveTaskItem != NULL)
949  {
950  /* Fixup the ActiveTaskItem pointer */
951  ActiveTaskItemIndex = m_ActiveTaskItem - m_TaskItems;
952  m_ActiveTaskItem = NewArray + ActiveTaskItemIndex;
953  }
954  m_AllocatedTaskItems = (WORD) NewArrayLength;
955  m_TaskItems = NewArray;
956  }
957  else
958  return NULL;
959  }
960 
961  return m_TaskItems + m_TaskItemCount++;
962  }
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:307
WORD m_TaskItemCount
Definition: taskswnd.cpp:306
#define MAX_TASKS_COUNT
Definition: taskswnd.cpp:29
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:311
#define TASK_ITEM_ARRAY_ALLOC
Definition: taskswnd.cpp:30
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:310
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:79
#define HeapReAlloc
Definition: compat.h:401
HANDLE hProcessHeap
Definition: kbswitch.c:25

Referenced by AddTask().

◆ CalculateTaskItemNewButtonIndex()

INT CTaskSwitchWnd::CalculateTaskItemNewButtonIndex ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 625 of file taskswnd.cpp.

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

998  {
999  PTASK_ITEM CurrentTaskItem;
1000  PTASK_GROUP TaskGroup = NULL;
1001 
1002  CurrentTaskItem = m_ActiveTaskItem;
1003 
1004  if (TaskItem != NULL)
1005  TaskGroup = TaskItem->Group;
1006 
1007  if (m_IsGroupingEnabled &&
1008  TaskGroup != NULL &&
1009  TaskGroup->IsCollapsed)
1010  {
1011  /* FIXME */
1012  return;
1013  }
1014 
1015  if (CurrentTaskItem != NULL)
1016  {
1017  PTASK_GROUP CurrentTaskGroup;
1018 
1019  if (CurrentTaskItem == TaskItem)
1020  return;
1021 
1022  CurrentTaskGroup = CurrentTaskItem->Group;
1023 
1024  if (m_IsGroupingEnabled &&
1025  CurrentTaskGroup != NULL &&
1026  CurrentTaskGroup->IsCollapsed)
1027  {
1028  if (CurrentTaskGroup == TaskGroup)
1029  return;
1030 
1031  /* FIXME */
1032  }
1033  else
1034  {
1036  if (CurrentTaskItem->Index >= 0)
1037  {
1038  UpdateTaskItemButton(CurrentTaskItem);
1039  }
1040  }
1041  }
1042 
1043  m_ActiveTaskItem = TaskItem;
1044 
1045  if (TaskItem != NULL && TaskItem->Index >= 0)
1046  {
1047  UpdateTaskItemButton(TaskItem);
1048  }
1049  else if (TaskItem == NULL)
1050  {
1051  TRACE("Active TaskItem now NULL\n");
1052  }
1053  }
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:311
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:319
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:513
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 1956 of file taskswnd.cpp.

1957  {
1958  return E_NOTIMPL;
1959  }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DeleteAllTasks()

VOID CTaskSwitchWnd::DeleteAllTasks ( )
inline

Definition at line 1170 of file taskswnd.cpp.

1171  {
1172  PTASK_ITEM CurrentTask;
1173 
1174  if (m_TaskItemCount > 0)
1175  {
1176  CurrentTask = m_TaskItems + m_TaskItemCount;
1177  do
1178  {
1179  DeleteTaskItem(--CurrentTask);
1180  } while (CurrentTask != m_TaskItems);
1181  }
1182  }
VOID DeleteTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:982
WORD m_TaskItemCount
Definition: taskswnd.cpp:306
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:310

Referenced by OnDestroy().

◆ DeleteTask()

BOOL CTaskSwitchWnd::DeleteTask ( IN HWND  hWnd)
inline

Definition at line 1153 of file taskswnd.cpp.

1154  {
1155  PTASK_ITEM TaskItem;
1156 
1157  TaskItem = FindTaskItem(hWnd);
1158  if (TaskItem != NULL)
1159  {
1160  TRACE("Delete window 0x%p on button %d\n", hWnd, TaskItem->Index);
1161  DeleteTaskItem(TaskItem);
1162  return TRUE;
1163  }
1164  //else
1165  //TRACE("Failed to delete window 0x%p\n", hWnd);
1166 
1167  return FALSE;
1168  }
VOID DeleteTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:982
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:854
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 982 of file taskswnd.cpp.

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

Referenced by DeleteAllTasks(), and DeleteTask().

◆ DeleteTaskItemButton()

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

Definition at line 729 of file taskswnd.cpp.

730  {
731  PTASK_GROUP TaskGroup;
732  INT iIndex;
733 
734  TaskGroup = TaskItem->Group;
735 
736  if (TaskItem->Index >= 0)
737  {
738  if ((TaskGroup != NULL && !TaskGroup->IsCollapsed) ||
739  TaskGroup == NULL)
740  {
742 
743  RemoveIcon(TaskItem);
744  iIndex = TaskItem->Index;
745  if (m_TaskBar.DeleteButton(iIndex))
746  {
747  TaskItem->Index = -1;
748  m_ButtonCount--;
749 
750  UpdateIndexesAfter(iIndex, FALSE);
751 
752  /* Update button sizes and fix the button wrapping */
754  return TRUE;
755  }
756 
758  }
759  }
760 
761  return FALSE;
762  }
#define TRUE
Definition: types.h:120
DWORD DeleteButton(int index)
Definition: rosctrls.h:345
VOID RemoveIcon(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:559
int32_t INT
Definition: typedefs.h:57
WORD m_ButtonCount
Definition: taskswnd.cpp:315
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:407
smooth NULL
Definition: ftsmooth.c:416
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:300
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:1244

Referenced by DeleteTaskItem().

◆ EnumWindowsProc()

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

Definition at line 1376 of file taskswnd.cpp.

1377  {
1378  /* Only show windows that still exist and are visible and none of explorer's
1379  special windows (such as the desktop or the tray window) */
1380  if (::IsWindow(hWnd) && ::IsWindowVisible(hWnd) &&
1381  !m_Tray->IsSpecialHWND(hWnd))
1382  {
1383  DWORD exStyle = ::GetWindowLong(hWnd, GWL_EXSTYLE);
1384  /* Don't list popup windows and also no tool windows */
1385  if ((::GetWindow(hWnd, GW_OWNER) == NULL || exStyle & WS_EX_APPWINDOW) &&
1386  !(exStyle & WS_EX_TOOLWINDOW))
1387  {
1388  TRACE("Adding task for %p...\n", hWnd);
1389  AddTask(hWnd);
1390  }
1391 
1392  }
1393 
1394  return TRUE;
1395  }
#define TRUE
Definition: types.h:120
HRESULT WINAPI GetWindow(HWND *phwnd)
Definition: taskswnd.cpp:1948
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:1088
#define GW_OWNER
Definition: winuser.h:761
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:302
#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 479 of file taskswnd.cpp.

480  {
481  ASSERT(TaskGroup->dwTaskCount > 0);
482  ASSERT(TaskGroup->IsCollapsed);
483  ASSERT(TaskGroup->Index >= 0);
484 
485  /* FIXME: Implement */
486  }
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 587 of file taskswnd.cpp.

590  {
591  PTASK_ITEM TaskItem, LastTaskItem, FoundTaskItem = NULL;
592  DWORD dwTaskCount;
593 
595 
596  TaskItem = m_TaskItems;
597  LastTaskItem = TaskItem + m_TaskItemCount;
598 
599  dwTaskCount = (TaskGroup != NULL ? TaskGroup->dwTaskCount : MAX_TASKS_COUNT);
600 
601  ASSERT(dwTaskCount > 0);
602 
603  while (TaskItem != LastTaskItem)
604  {
605  if (TaskItem->Group == TaskGroup)
606  {
607  if ((NewTaskItem != NULL && TaskItem != NewTaskItem) || NewTaskItem == NULL)
608  {
609  FoundTaskItem = TaskItem;
610  }
611 
612  if (--dwTaskCount == 0)
613  {
614  /* We found the last task item in the group! */
615  break;
616  }
617  }
618 
619  TaskItem++;
620  }
621 
622  return FoundTaskItem;
623  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:306
#define MAX_TASKS_COUNT
Definition: taskswnd.cpp:29
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:319
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:310
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 871 of file taskswnd.cpp.

872  {
873  PTASK_ITEM LastItem, TaskItem;
874  PTASK_GROUP TaskGroup;
875  DWORD dwProcessId;
876 
877  if (!GetWindowThreadProcessId(hWnd, &dwProcessId))
878  {
879  return NULL;
880  }
881 
882  /* Try to find another task that belongs to the same
883  process as the given window */
884  TaskItem = m_TaskItems;
885  LastItem = TaskItem + m_TaskItemCount;
886  while (TaskItem != LastItem)
887  {
888  TaskGroup = TaskItem->Group;
889  if (TaskGroup != NULL)
890  {
891  if (TaskGroup->dwProcessId == dwProcessId)
892  return TaskItem;
893  }
894  else
895  {
896  DWORD dwProcessIdTask;
897 
898  if (GetWindowThreadProcessId(TaskItem->hWnd,
899  &dwProcessIdTask) &&
900  dwProcessIdTask == dwProcessId)
901  {
902  return TaskItem;
903  }
904  }
905 
906  TaskItem++;
907  }
908 
909  return NULL;
910  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:306
HWND hWnd
Definition: settings.c:17
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:310
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 1072 of file taskswnd.cpp.

1073  {
1074  PTASK_GROUP CurrentGroup;
1075 
1076  CurrentGroup = m_TaskGroups;
1077  while (CurrentGroup != NULL)
1078  {
1079  if (CurrentGroup->Index == Index)
1080  break;
1081 
1082  CurrentGroup = CurrentGroup->Next;
1083  }
1084 
1085  return CurrentGroup;
1086  }
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:309

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

◆ FindTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindTaskItem ( IN HWND  hWnd)
inline

Definition at line 854 of file taskswnd.cpp.

855  {
856  PTASK_ITEM TaskItem, LastItem;
857 
858  TaskItem = m_TaskItems;
859  LastItem = TaskItem + m_TaskItemCount;
860  while (TaskItem != LastItem)
861  {
862  if (TaskItem->hWnd == hWnd)
863  return TaskItem;
864 
865  TaskItem++;
866  }
867 
868  return NULL;
869  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:306
HWND hWnd
Definition: settings.c:17
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:310
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 1055 of file taskswnd.cpp.

1056  {
1057  PTASK_ITEM TaskItem, LastItem;
1058 
1059  TaskItem = m_TaskItems;
1060  LastItem = TaskItem + m_TaskItemCount;
1061  while (TaskItem != LastItem)
1062  {
1063  if (TaskItem->Index == Index)
1064  return TaskItem;
1065 
1066  TaskItem++;
1067  }
1068 
1069  return NULL;
1070  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:306
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:310
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 1190 of file taskswnd.cpp.

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

Referenced by OnShellHook().

◆ FlashTaskItem()

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

Definition at line 1184 of file taskswnd.cpp.

1185  {
1186  TaskItem->RenderFlashed = 1;
1187  UpdateTaskItemButton(TaskItem);
1188  }
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:513

Referenced by FlashTask().

◆ FreeTaskItem()

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

Definition at line 964 of file taskswnd.cpp.

965  {
966  WORD wIndex;
967 
968  if (TaskItem == m_ActiveTaskItem)
970 
971  wIndex = (WORD) (TaskItem - m_TaskItems);
972  if (wIndex + 1 < m_TaskItemCount)
973  {
974  MoveMemory(TaskItem,
975  TaskItem + 1,
976  (m_TaskItemCount - wIndex - 1) * sizeof(*TaskItem));
977  }
978 
979  m_TaskItemCount--;
980  }
WORD m_TaskItemCount
Definition: taskswnd.cpp:306
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:311
#define MoveMemory
Definition: winbase.h:1645
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:310
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 1948 of file taskswnd.cpp.

1949  {
1950  if (!phwnd)
1951  return E_INVALIDARG;
1952  *phwnd = m_hWnd;
1953  return S_OK;
1954  }
#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 488 of file taskswnd.cpp.

489  {
490  HICON hIcon = 0;
491 
492  SendMessageTimeout(hwnd, WM_GETICON, ICON_SMALL2, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR) &hIcon);
493  if (hIcon)
494  return hIcon;
495 
497  if (hIcon)
498  return hIcon;
499 
500  SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR) &hIcon);
501  if (hIcon)
502  return hIcon;
503 
505  if (hIcon)
506  return hIcon;
507 
509 
510  return hIcon;
511  }
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:5820
ULONG_PTR * PDWORD_PTR
Definition: basetsd.h:184
#define GetClassLongPtr
Definition: winuser.h:5757
#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 347 of file taskswnd.cpp.

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

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

Referenced by OnShellHook().

◆ HandleButtonClick()

BOOL CTaskSwitchWnd::HandleButtonClick ( IN WORD  wIndex)
inline

Definition at line 1603 of file taskswnd.cpp.

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

Referenced by OnCommand().

◆ HandleButtonRightClick()

BOOL CTaskSwitchWnd::HandleButtonRightClick ( IN WORD  wIndex)
inline

Definition at line 1653 of file taskswnd.cpp.

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

Referenced by OnContextMenu().

◆ HandleItemPaint()

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

Definition at line 1679 of file taskswnd.cpp.

1680  {
1681  LRESULT Ret = CDRF_DODEFAULT;
1682  PTASK_GROUP TaskGroup;
1683  PTASK_ITEM TaskItem;
1684 
1685  TaskItem = FindTaskItemByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1686  TaskGroup = FindTaskGroupByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1687  if (TaskGroup == NULL && TaskItem != NULL)
1688  {
1689  ASSERT(TaskItem != NULL);
1690 
1691  if (TaskItem != NULL && ::IsWindow(TaskItem->hWnd))
1692  {
1693  /* Make the entire button flashing if necessary */
1694  if (nmtbcd->nmcd.uItemState & CDIS_MARKED)
1695  {
1696  Ret = TBCDRF_NOBACKGROUND;
1697  if (!m_Theme)
1698  {
1699  SelectObject(nmtbcd->nmcd.hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
1700  Rectangle(nmtbcd->nmcd.hdc,
1701  nmtbcd->nmcd.rc.left,
1702  nmtbcd->nmcd.rc.top,
1703  nmtbcd->nmcd.rc.right,
1704  nmtbcd->nmcd.rc.bottom);
1705  }
1706  else
1707  {
1708  DrawThemeBackground(m_Theme, nmtbcd->nmcd.hdc, TDP_FLASHBUTTON, 0, &nmtbcd->nmcd.rc, 0);
1709  }
1710  nmtbcd->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
1711  return Ret;
1712  }
1713  }
1714  }
1715  else if (TaskGroup != NULL)
1716  {
1717  /* FIXME: Implement painting for task groups */
1718  }
1719  return Ret;
1720  }
#define COLOR_HIGHLIGHT
Definition: winuser.h:916
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1072
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:57
DWORD WINAPI GetSysColor(_In_ int)
#define CDIS_MARKED
Definition: commctrl.h:294
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: taskswnd.cpp:313
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:917
#define CDRF_DODEFAULT
Definition: commctrl.h:264
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define TBCDRF_NOBACKGROUND
Definition: commctrl.h:1036
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1055
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 1598 of file taskswnd.cpp.

1599  {
1600  /* TODO: Show task group menu */
1601  }

Referenced by HandleButtonClick().

◆ HandleTaskGroupRightClick()

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

Definition at line 1648 of file taskswnd.cpp.

1649  {
1650  /* TODO: Show task group right click menu */
1651  }

Referenced by HandleButtonRightClick().

◆ HandleTaskItemClick()

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

Definition at line 1568 of file taskswnd.cpp.

1569  {
1570  BOOL bIsMinimized;
1571  BOOL bIsActive;
1572 
1573  if (::IsWindow(TaskItem->hWnd))
1574  {
1575  bIsMinimized = ::IsIconic(TaskItem->hWnd);
1576  bIsActive = (TaskItem == m_ActiveTaskItem);
1577 
1578  TRACE("Active TaskItem %p, selected TaskItem %p\n", m_ActiveTaskItem, TaskItem);
1579  if (m_ActiveTaskItem)
1580  TRACE("Active TaskItem hWnd=%p, TaskItem hWnd %p\n", m_ActiveTaskItem->hWnd, TaskItem->hWnd);
1581 
1582  TRACE("Valid button clicked. HWND=%p, IsMinimized=%s, IsActive=%s...\n",
1583  TaskItem->hWnd, bIsMinimized ? "Yes" : "No", bIsActive ? "Yes" : "No");
1584 
1585  if (!bIsMinimized && bIsActive)
1586  {
1587  ::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE);
1588  TRACE("Valid button clicked. App window Minimized.\n");
1589  }
1590  else
1591  {
1592  ::SwitchToThisWindow(TaskItem->hWnd, TRUE);
1593  TRACE("Valid button clicked. App window Restored.\n");
1594  }
1595  }
1596  }
#define TRUE
Definition: types.h:120
BOOL ShowWindowAsync(int nCmdShow)
Definition: atlwin.h:1271
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:311
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 1629 of file taskswnd.cpp.

1630  {
1631  POINT pt;
1632  GetCursorPos(&pt);
1633 
1634  SetForegroundWindow(TaskItem->hWnd);
1635 
1636  ActivateTask(TaskItem->hWnd);
1637 
1638  /* Wait up to 2 seconds for the window to process the foreground notification. */
1639  DWORD_PTR resultDummy;
1640  if (!SendMessageTimeout(TaskItem->hWnd, WM_NULL, 0, 0, 0, 2000, &resultDummy))
1641  ERR("HandleTaskItemRightClick detected the window was unresponsive for 2 seconds, or was destroyed\n");
1642  if (GetForegroundWindow() != TaskItem->hWnd)
1643  ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
1644 
1645  ::SendMessageW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y));
1646  }
#define WM_NULL
Definition: winuser.h:1589
#define pt(x, y)
Definition: drawing.c:79
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1129
#define WM_POPUPSYSTEMMENU
Definition: undocuser.h:59
#define SendMessageTimeout
Definition: winuser.h:5820
uint32_t DWORD_PTR
Definition: typedefs.h:64
#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 1722 of file taskswnd.cpp.

1723  {
1724  LRESULT Ret = 0;
1725 
1726  switch (nmh->code)
1727  {
1728  case NM_CUSTOMDRAW:
1729  {
1730  LPNMTBCUSTOMDRAW nmtbcd = (LPNMTBCUSTOMDRAW) nmh;
1731 
1732  switch (nmtbcd->nmcd.dwDrawStage)
1733  {
1734 
1735  case CDDS_ITEMPREPAINT:
1736  Ret = HandleItemPaint(nmtbcd);
1737  break;
1738 
1739  case CDDS_PREPAINT:
1740  Ret = CDRF_NOTIFYITEMDRAW;
1741  break;
1742 
1743  default:
1744  Ret = CDRF_DODEFAULT;
1745  break;
1746  }
1747  break;
1748  }
1749  }
1750 
1751  return Ret;
1752  }
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:281
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:271
NMCUSTOMDRAW nmcd
Definition: commctrl.h:1013
#define CDRF_DODEFAULT
Definition: commctrl.h:264
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define CDDS_PREPAINT
Definition: commctrl.h:276
struct _NMTBCUSTOMDRAW * LPNMTBCUSTOMDRAW
LRESULT HandleItemPaint(IN OUT NMTBCUSTOMDRAW *nmtbcd)
Definition: taskswnd.cpp:1679
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 1938 of file taskswnd.cpp.

1939  {
1940  m_Tray = tray;
1943  if (!m_hWnd)
1944  return E_FAIL;
1945  return S_OK;
1946  }
#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:319
#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:302
#define WS_VISIBLE
Definition: pedump.c:620

◆ OnCommand()

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

Definition at line 1797 of file taskswnd.cpp.

1798  {
1799  LRESULT Ret = TRUE;
1800  if (lParam != 0 && (HWND) lParam == m_TaskBar.m_hWnd)
1801  {
1803  }
1804  return Ret;
1805  }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
BOOL HandleButtonClick(IN WORD wIndex)
Definition: taskswnd.cpp:1603
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:300
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 1842 of file taskswnd.cpp.

1843  {
1844  LRESULT Ret = 0;
1845  INT_PTR iBtn = -1;
1846 
1847  if (m_TaskBar.m_hWnd != NULL)
1848  {
1849  POINT pt;
1850 
1851  pt.x = GET_X_LPARAM(lParam);
1852  pt.y = GET_Y_LPARAM(lParam);
1853 
1854  ::ScreenToClient(m_TaskBar.m_hWnd, &pt);
1855 
1856  iBtn = m_TaskBar.HitTest(&pt);
1857  if (iBtn >= 0)
1858  {
1859  HandleButtonRightClick(iBtn);
1860  }
1861  }
1862  if (iBtn < 0)
1863  {
1864  /* Not on a taskbar button, so forward message to tray */
1865  Ret = SendMessage(m_Tray->GetHWND(), uMsg, wParam, lParam);
1866  }
1867  return Ret;
1868  }
INT HitTest(PPOINT ppt)
Definition: rosctrls.h:428
#define pt(x, y)
Definition: drawing.c:79
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
int32_t INT_PTR
Definition: typedefs.h:63
WPARAM wParam
Definition: combotst.c:138
BOOL HandleButtonRightClick(IN WORD wIndex)
Definition: taskswnd.cpp:1653
smooth NULL
Definition: ftsmooth.c:416
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:300
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:302
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 1922 of file taskswnd.cpp.

1923  {
1925  if (cpData->dwData == m_uHardErrorMsg)
1926  {
1927  /* A hard error balloon message */
1929  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));
1930  if (pData->cbHeaderSize == sizeof(BALLOON_HARD_ERROR_DATA))
1932  return TRUE;
1933  }
1934 
1935  return FALSE;
1936  }
#define TRUE
Definition: types.h:120
void StartThread(PBALLOON_HARD_ERROR_DATA pData)
Definition: taskswnd.cpp:178
uint32_t ULONG_PTR
Definition: typedefs.h:64
ULONG_PTR dwData
Definition: winuser.h:2976
struct _BALLOON_HARD_ERROR_DATA * PBALLOON_HARD_ERROR_DATA
__wchar_t WCHAR
Definition: xmlstorage.h:180
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:324
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:325

◆ OnCreate()

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

Definition at line 1426 of file taskswnd.cpp.

1427  {
1428  if (!m_TaskBar.Initialize(m_hWnd))
1429  return FALSE;
1430 
1431  SetWindowTheme(m_TaskBar.m_hWnd, L"TaskBand", NULL);
1432 
1435 
1436  /* Set proper spacing between buttons */
1437  m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1438 
1439  /* Register the shell hook */
1440  m_ShellHookMsg = RegisterWindowMessageW(L"SHELLHOOK");
1441 
1442  TRACE("ShellHookMsg got assigned number %d\n", m_ShellHookMsg);
1443 
1444  RegisterShellHook(m_hWnd, 3); /* 1 if no NT! We're targeting NT so we don't care! */
1445 
1447 
1448  /* Recalculate the button size */
1450 
1451 #if DUMP_TASKS != 0
1452  SetTimer(hwnd, 1, 5000, NULL);
1453 #endif
1454  return TRUE;
1455  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL WINAPI RegisterShellHook(HWND hWnd, DWORD dwType)
Definition: shellord.c:311
#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:354
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:422
HTHEME m_Theme
Definition: taskswnd.cpp:313
BOOL RefreshWindowList()
Definition: taskswnd.cpp:1404
#define TRACE(s)
Definition: solgame.cpp:4
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:300
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:347
HWND m_hWnd
Definition: atlwin.h:268
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:317
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
UINT m_ShellHookMsg
Definition: taskswnd.cpp:304
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:302
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1244

◆ OnDestroy()

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

Definition at line 1457 of file taskswnd.cpp.

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

1755  {
1756  HDC hdc = (HDC) wParam;
1757 
1758  if (!IsAppThemed())
1759  {
1760  bHandled = FALSE;
1761  return 0;
1762  }
1763 
1764  RECT rect;
1765  GetClientRect(&rect);
1767 
1768  return TRUE;
1769  }
#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 1870 of file taskswnd.cpp.

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

◆ OnMouseActivate()

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

Definition at line 1888 of file taskswnd.cpp.

1889  {
1890  return MA_NOACTIVATE;
1891  }
#define MA_NOACTIVATE
Definition: winuser.h:2478

◆ OnNcHitTest()

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

Definition at line 1786 of file taskswnd.cpp.

1787  {
1788  LRESULT Ret = TRUE;
1789  /* We want the tray window to be draggable everywhere, so make the control
1790  appear transparent */
1791  Ret = DefWindowProc(uMsg, wParam, lParam);
1792  if (Ret != HTVSCROLL && Ret != HTHSCROLL)
1793  Ret = HTTRANSPARENT;
1794  return Ret;
1795  }
#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 1807 of file taskswnd.cpp.

1808  {
1809  LRESULT Ret = TRUE;
1810  const NMHDR *nmh = (const NMHDR *) lParam;
1811 
1812  if (nmh->hwndFrom == m_TaskBar.m_hWnd)
1813  {
1814  Ret = HandleToolbarNotification(nmh);
1815  }
1816  return Ret;
1817  }
#define TRUE
Definition: types.h:120
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:300
LRESULT HandleToolbarNotification(IN const NMHDR *nmh)
Definition: taskswnd.cpp:1722
HWND hwndFrom
Definition: winuser.h:3132
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 1906 of file taskswnd.cpp.

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

◆ OnSettingChanged()

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

Definition at line 1911 of file taskswnd.cpp.

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

◆ OnShellHook()

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

Definition at line 1490 of file taskswnd.cpp.

1491  {
1492  BOOL Ret = FALSE;
1493 
1494  /* In case the shell hook wasn't registered properly, ignore WM_NULLs*/
1495  if (uMsg == 0)
1496  {
1497  bHandled = FALSE;
1498  return 0;
1499  }
1500 
1501  TRACE("Received shell hook message: wParam=%08lx, lParam=%08lx\n", wParam, lParam);
1502 
1503  switch ((INT) wParam)
1504  {
1505  case HSHELL_APPCOMMAND:
1506  Ret = HandleAppCommand(wParam, lParam);
1507  break;
1508 
1509  case HSHELL_WINDOWCREATED:
1510  AddTask((HWND) lParam);
1511  break;
1512 
1514  /* The window still exists! Delay destroying it a bit */
1515  DeleteTask((HWND) lParam);
1516  break;
1517 
1519  case HSHELL_WINDOWACTIVATED:
1521  break;
1522 
1523  case HSHELL_FLASH:
1524  FlashTask((HWND) lParam);
1525  break;
1526 
1527  case HSHELL_REDRAW:
1528  RedrawTask((HWND) lParam);
1529  break;
1530 
1531  case HSHELL_TASKMAN:
1532  ::PostMessage(m_Tray->GetHWND(), TWM_OPENSTARTMENU, 0, 0);
1533  break;
1534 
1536  case HSHELL_LANGUAGE:
1537  case HSHELL_SYSMENU:
1538  case HSHELL_ENDTASK:
1539  case HSHELL_ACCESSIBILITYSTATE:
1540  case HSHELL_WINDOWREPLACED:
1541  case HSHELL_WINDOWREPLACING:
1542 
1543  case HSHELL_GETMINRECT:
1544  default:
1545  {
1546 #if DEBUG_SHELL_HOOK
1547  int i, found;
1548  for (i = 0, found = 0; i != _countof(hshell_msg); i++)
1549  {
1550  if (hshell_msg[i].msg == (INT) wParam)
1551  {
1552  TRACE("Shell message %ws unhandled (lParam = 0x%p)!\n", hshell_msg[i].msg_name, lParam);
1553  found = 1;
1554  break;
1555  }
1556  }
1557  if (found)
1558  break;
1559 #endif
1560  TRACE("Shell message %d unhandled (lParam = 0x%p)!\n", (INT) wParam, lParam);
1561  break;
1562  }
1563  }
1564 
1565  return Ret;
1566  }
#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:1469
BOOL FlashTask(IN HWND hWnd)
Definition: taskswnd.cpp:1190
int32_t INT
Definition: typedefs.h:57
WPARAM wParam
Definition: combotst.c:138
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1129
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:1230
#define TWM_OPENSTARTMENU
Definition: precomp.h:131
BOOL DeleteTask(IN HWND hWnd)
Definition: taskswnd.cpp:1153
#define TRACE(s)
Definition: solgame.cpp:4
#define _countof(array)
Definition: sndvol32.h:68
BOOL AddTask(IN HWND hWnd)
Definition: taskswnd.cpp:1088
#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:302
#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 1771 of file taskswnd.cpp.

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

◆ OnTaskbarSettingsChanged()

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

Definition at line 1826 of file taskswnd.cpp.

1827  {
1828  TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
1829  if (newSettings->bGroupButtons != g_TaskbarSettings.bGroupButtons)
1830  {
1833 
1834  /* Collapse or expand groups if necessary */
1837  }
1838 
1839  return 0;
1840  }
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:319
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
BOOL RefreshWindowList()
Definition: taskswnd.cpp:1404
BOOL bGroupButtons
Definition: precomp.h:206
LPARAM lParam
Definition: combotst.c:139
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1244

◆ OnThemeChanged()

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

Definition at line 1411 of file taskswnd.cpp.

1412  {
1413  TRACE("OmThemeChanged\n");
1414 
1415  if (m_Theme)
1417 
1418  if (IsThemeActive())
1419  m_Theme = OpenThemeData(m_hWnd, L"TaskBand");
1420  else
1421  m_Theme = NULL;
1422 
1423  return TRUE;
1424  }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: taskswnd.cpp:313
#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 1893 of file taskswnd.cpp.

1894  {
1895 #if DUMP_TASKS != 0
1896  switch (wParam)
1897  {
1898  case 1:
1899  DumpTasks();
1900  break;
1901  }
1902 #endif
1903  return TRUE;
1904  }
#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 1819 of file taskswnd.cpp.

1820  {
1821  /* Update the button spacing */
1822  m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1823  return TRUE;
1824  }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
HTHEME m_Theme
Definition: taskswnd.cpp:313
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:300
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:302

◆ RedrawTask()

BOOL CTaskSwitchWnd::RedrawTask ( IN HWND  hWnd)
inline

Definition at line 1230 of file taskswnd.cpp.

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

Referenced by OnShellHook().

◆ RedrawTaskItem()

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

Definition at line 1205 of file taskswnd.cpp.

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

Referenced by RedrawTask().

◆ RefreshWindowList()

BOOL CTaskSwitchWnd::RefreshWindowList ( )
inline

Definition at line 1404 of file taskswnd.cpp.

1405  {
1406  TRACE("Refreshing window list...\n");
1407  /* Add all windows to the toolbar */
1408  return EnumWindows(s_EnumWindowsProc, (LPARAM)this);
1409  }
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:1397

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

◆ RemoveIcon()

VOID CTaskSwitchWnd::RemoveIcon ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 559 of file taskswnd.cpp.

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

Referenced by DeleteTaskItemButton().

◆ RemoveTaskFromTaskGroup()

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

Definition at line 808 of file taskswnd.cpp.

809  {
810  PTASK_GROUP TaskGroup, CurrentGroup, *PrevLink;
811 
812  TaskGroup = TaskItem->Group;
813  if (TaskGroup != NULL)
814  {
815  DWORD dwNewTaskCount = --TaskGroup->dwTaskCount;
816  if (dwNewTaskCount == 0)
817  {
818  /* Find the previous pointer in the chain */
819  CurrentGroup = m_TaskGroups;
820  PrevLink = &m_TaskGroups;
821  while (CurrentGroup != TaskGroup)
822  {
823  PrevLink = &CurrentGroup->Next;
824  CurrentGroup = CurrentGroup->Next;
825  }
826 
827  /* Remove the group from the list */
828  ASSERT(TaskGroup == CurrentGroup);
829  *PrevLink = TaskGroup->Next;
830 
831  /* Free the task group */
833  0,
834  TaskGroup);
835  }
836  else if (TaskGroup->IsCollapsed &&
837  TaskGroup->Index >= 0)
838  {
839  if (dwNewTaskCount > 1)
840  {
841  /* FIXME: Check if we should expand the group */
842  /* Update the task group button */
843  UpdateTaskGroupButton(TaskGroup);
844  }
845  else
846  {
847  /* Expand the group of one task button to a task button */
848  ExpandTaskGroup(TaskGroup);
849  }
850  }
851  }
852  }
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:309
DWORD IsCollapsed
Definition: taskswnd.cpp:74
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:470
VOID ExpandTaskGroup(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:479
#define HeapFree(x, y, z)
Definition: compat.h:402
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 1397 of file taskswnd.cpp.

1398  {
1400 
1401  return This->EnumWindowsProc(hWnd);
1402  }
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 1244 of file taskswnd.cpp.

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

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

◆ UpdateIndexesAfter()

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

Definition at line 407 of file taskswnd.cpp.

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

Referenced by AddTaskItemButton(), and DeleteTaskItemButton().

◆ UpdateTaskGroupButton()

INT CTaskSwitchWnd::UpdateTaskGroupButton ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 470 of file taskswnd.cpp.

471  {
472  ASSERT(TaskGroup->Index >= 0);
473 
474  /* FIXME: Implement */
475 
476  return TaskGroup->Index;
477  }
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 513 of file taskswnd.cpp.

514  {
515  TBBUTTONINFO tbbi = { 0 };
516  HICON icon;
517  WCHAR windowText[255];
518 
519  ASSERT(TaskItem->Index >= 0);
520 
521  tbbi.cbSize = sizeof(tbbi);
522  tbbi.dwMask = TBIF_BYINDEX | TBIF_STATE | TBIF_TEXT | TBIF_IMAGE;
523  tbbi.fsState = TBSTATE_ENABLED;
524  if (m_ActiveTaskItem == TaskItem)
525  tbbi.fsState |= TBSTATE_CHECKED;
526 
527  if (TaskItem->RenderFlashed)
528  tbbi.fsState |= TBSTATE_MARKED;
529 
530  /* Check if we're updating a button that is the last one in the
531  line. If so, we need to set the TBSTATE_WRAP flag! */
532  if (!m_Tray->IsHorizontal() || (m_ButtonsPerLine != 0 &&
533  (TaskItem->Index + 1) % m_ButtonsPerLine == 0))
534  {
535  tbbi.fsState |= TBSTATE_WRAP;
536  }
537 
539  {
540  tbbi.pszText = windowText;
541  }
542 
543  icon = GetWndIcon(TaskItem->hWnd);
544  if (!icon)
545  icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
546  TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, TaskItem->IconIndex, icon);
547  tbbi.iImage = TaskItem->IconIndex;
548 
549  if (!m_TaskBar.SetButtonInfo(TaskItem->Index, &tbbi))
550  {
551  TaskItem->Index = -1;
552  return -1;
553  }
554 
555  TRACE("Updated button %d for hwnd 0x%p\n", TaskItem->Index, TaskItem->hWnd);
556  return TaskItem->Index;
557  }
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:1222
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:311
#define TBIF_IMAGE
Definition: commctrl.h:1215
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:314
smooth NULL
Definition: ftsmooth.c:416
#define TBIF_STATE
Definition: commctrl.h:1217
#define TRACE(s)
Definition: solgame.cpp:4
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define _countof(array)
Definition: sndvol32.h:68
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:300
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:488
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define TBSTATE_MARKED
Definition: commctrl.h:975
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:317
#define TBSTATE_CHECKED
Definition: commctrl.h:968
#define TBIF_TEXT
Definition: commctrl.h:1216
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:302
WCHAR windowText[1024]
Definition: appswitch.c:49
#define TBSTATE_ENABLED
Definition: commctrl.h:970
#define TBSTATE_WRAP
Definition: commctrl.h:973
DWORD SetButtonInfo(int cmdId, TBBUTTONINFO *info)
Definition: rosctrls.h:355
#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:347
#define TBBUTTONINFO
Definition: commctrl.h:1250

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

Referenced by AllocTaskItem().

◆ m_ButtonCount

WORD CTaskSwitchWnd::m_ButtonCount
private

◆ m_ButtonSize

SIZE CTaskSwitchWnd::m_ButtonSize
private

Definition at line 322 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and UpdateButtonsSize().

◆ m_ButtonsPerLine

UINT CTaskSwitchWnd::m_ButtonsPerLine
private

Definition at line 314 of file taskswnd.cpp.

Referenced by UpdateButtonsSize(), and UpdateTaskItemButton().

◆ m_HardErrorThread

CHardErrorThread CTaskSwitchWnd::m_HardErrorThread
private

Definition at line 325 of file taskswnd.cpp.

Referenced by OnCopyData().

◆ m_ImageList

HIMAGELIST CTaskSwitchWnd::m_ImageList
private

◆ m_IsDestroying

BOOL CTaskSwitchWnd::m_IsDestroying
private

Definition at line 320 of file taskswnd.cpp.

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

◆ m_IsGroupingEnabled

◆ m_ShellHookMsg

UINT CTaskSwitchWnd::m_ShellHookMsg
private

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

Referenced by CTaskSwitchWnd(), and OnCopyData().


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