ReactOS 0.4.17-dev-966-gf06eace
CTaskSwitchWnd Class Reference
Inheritance diagram for CTaskSwitchWnd:
Collaboration diagram for CTaskSwitchWnd:

Classes

struct  tagFULLSCREENDATA
 
struct  tagRUDEAPPDATA
 

Public Types

typedef struct CTaskSwitchWnd::tagRUDEAPPDATA RUDEAPPDATA
 
typedef struct CTaskSwitchWnd::tagRUDEAPPDATA * PRUDEAPPDATA
 
typedef struct CTaskSwitchWnd::tagFULLSCREENDATA FULLSCREENDATA
 
typedef struct CTaskSwitchWnd::tagFULLSCREENDATA * PFULLSCREENDATA
 
- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Types inherited from IOleWindow
typedef IOleWindow * LPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknown * LPUNKNOWN
 

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

Static Public Member Functions

static BOOL CALLBACK s_EnumWindowsProc (IN HWND hWnd, IN LPARAM lParam)
 
static BOOL InvokeRegistryAppKeyCommand (UINT uAppCmd)
 
static VOID CALLBACK SendAsyncProc (HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
 
static BOOL CALLBACK IsRudeEnumProc (_In_ HWND hwnd, _In_ LPARAM lParam)
 
static BOOL CALLBACK FullScreenEnumProc (_In_ HMONITOR hMonitor, _In_opt_ HDC hDC, _In_ LPRECT prc, _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_ENTRY * GetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CTaskSwitchWnd, CWindow, CControlWinTraits >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Private Attributes

CTaskToolbar m_TaskBar
 
CComPtr< ITrayWindow > m_Tray
 
UINT m_ShellHookMsg
 
UINT m_WinMMDevChgMsg
 
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
 
INT m_nRudeAppValidationCounter
 
SIZE m_ButtonSize
 
UINT m_uHardErrorMsg
 
CHardErrorThread m_HardErrorThread
 
CMultimediaBackend m_Mixer
 

Additional Inherited Members

- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSG * m_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 386 of file taskswnd.cpp.

Member Typedef Documentation

◆ FULLSCREENDATA

◆ PFULLSCREENDATA

◆ PRUDEAPPDATA

◆ RUDEAPPDATA

Constructor & Destructor Documentation

◆ CTaskSwitchWnd()

CTaskSwitchWnd::CTaskSwitchWnd ( )
inline

Definition at line 424 of file taskswnd.cpp.

424 :
432 m_Theme(NULL),
434 m_ButtonCount(0),
439 {
442 }
UINT m_ShellHookMsg
Definition: taskswnd.cpp:396
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:404
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:403
INT m_nRudeAppValidationCounter
Definition: taskswnd.cpp:415
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:419
BOOL m_IsDestroying
Definition: taskswnd.cpp:413
WORD m_ButtonCount
Definition: taskswnd.cpp:408
HTHEME m_Theme
Definition: taskswnd.cpp:406
UINT m_WinMMDevChgMsg
Definition: taskswnd.cpp:397
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:402
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:412
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:400
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:410
WORD m_TaskItemCount
Definition: taskswnd.cpp:399
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:407
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define L(x)
Definition: resources.c:13
#define ZeroMemory
Definition: minwinbase.h:31
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)

◆ ~CTaskSwitchWnd()

virtual CTaskSwitchWnd::~CTaskSwitchWnd ( )
inlinevirtual

Definition at line 443 of file taskswnd.cpp.

443{ }

Member Function Documentation

◆ ActivateTask()

BOOL CTaskSwitchWnd::ActivateTask ( IN HWND  hWnd)
inline

Definition at line 1236 of file taskswnd.cpp.

1237 {
1238 PTASK_ITEM TaskItem;
1239
1240 if (!hWnd)
1241 {
1242 return ActivateTaskItem(NULL);
1243 }
1244
1245 TaskItem = FindTaskItem(hWnd);
1246 if (TaskItem == NULL)
1247 {
1248 TaskItem = FindOtherTaskItem(hWnd);
1249 }
1250
1251 if (TaskItem == NULL)
1252 {
1253 WARN("Activate window 0x%p, could not find task\n", hWnd);
1255 }
1256
1257 return ActivateTaskItem(TaskItem);
1258 }
HWND hWnd
Definition: settings.c:17
#define WARN(fmt,...)
Definition: precomp.h:61
PTASK_ITEM FindOtherTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:979
BOOL ActivateTaskItem(IN OUT PTASK_ITEM TaskItem OPTIONAL)
Definition: taskswnd.cpp:1225
BOOL RefreshWindowList()
Definition: taskswnd.cpp:1503
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:962

Referenced by HandleTaskItemRightClick(), and OnShellHook().

◆ ActivateTaskItem()

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

Definition at line 1225 of file taskswnd.cpp.

1226 {
1227 if (TaskItem != NULL)
1228 {
1229 TRACE("Activate window 0x%p on button %d\n", TaskItem->hWnd, TaskItem->Index);
1230 }
1231
1232 CheckActivateTaskItem(TaskItem);
1233 return FALSE;
1234 }
VOID CheckActivateTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1105
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ActivateTask().

◆ AddTask()

BOOL CTaskSwitchWnd::AddTask ( IN HWND  hWnd)
inline

Definition at line 1196 of file taskswnd.cpp.

1197 {
1198 PTASK_ITEM TaskItem;
1199
1200 if (!::IsWindow(hWnd) || m_Tray->IsSpecialHWND(hWnd))
1201 return FALSE;
1202
1203 TaskItem = FindTaskItem(hWnd);
1204 if (TaskItem == NULL)
1205 {
1206 TRACE("Add window 0x%p\n", hWnd);
1207 TaskItem = AllocTaskItem();
1208 if (TaskItem != NULL)
1209 {
1210 ZeroMemory(TaskItem, sizeof(*TaskItem));
1211 TaskItem->hWnd = hWnd;
1212 TaskItem->Index = -1;
1213 TaskItem->Group = AddToTaskGroup(hWnd);
1214
1215 if (!m_IsDestroying)
1216 {
1217 AddTaskItemButton(TaskItem);
1218 }
1219 }
1220 }
1221
1222 return TaskItem != NULL;
1223 }
BOOL IsWindow() const
Definition: atlwin.h:947
PTASK_GROUP AddToTaskGroup(IN HWND hWnd)
Definition: taskswnd.cpp:872
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:394
PTASK_ITEM AllocTaskItem()
Definition: taskswnd.cpp:1020
INT AddTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:777
PTASK_GROUP Group
Definition: taskswnd.cpp:174

Referenced by EnumWindowsProc(), and OnShellHook().

◆ AddTaskItemButton()

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

Definition at line 777 of file taskswnd.cpp.

778 {
779 WCHAR windowText[255];
780 TBBUTTON tbBtn = { 0 };
781 INT iIndex;
782 HICON icon;
783
784 if (TaskItem->Index >= 0)
785 {
786 return UpdateTaskItemButton(TaskItem);
787 }
788
789 if (TaskItem->Group != NULL &&
790 TaskItem->Group->IsCollapsed)
791 {
792 /* The task group is collapsed, we only need to update the group button */
793 return UpdateTaskGroupButton(TaskItem->Group);
794 }
795
796 icon = GetWndIcon(TaskItem->hWnd);
797 if (!icon)
798 icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
799 TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, -1, icon);
800
801 tbBtn.iBitmap = TaskItem->IconIndex;
804 tbBtn.dwData = TaskItem->Index;
805
807 {
808 tbBtn.iString = (DWORD_PTR) windowText;
809 }
810
811 /* Find out where to insert the new button */
812 iIndex = CalculateTaskItemNewButtonIndex(TaskItem);
813 ASSERT(iIndex >= 0);
814 tbBtn.idCommand = iIndex;
815
817
818 if (m_TaskBar.InsertButton(iIndex, &tbBtn))
819 {
820 UpdateIndexesAfter(iIndex, TRUE);
821
822 TRACE("Added button %d for hwnd 0x%p\n", iIndex, TaskItem->hWnd);
823
824 TaskItem->Index = iIndex;
826
827 /* Update button sizes and fix the button wrapping */
829 return iIndex;
830 }
831
833
834 return -1;
835 }
WCHAR windowText[1024]
Definition: appswitch.c:48
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:621
INT GetWndTextFromTaskItem(IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
Definition: taskswnd.cpp:445
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1351
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:392
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:505
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:568
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:586
INT CalculateTaskItemNewButtonIndex(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:733
VOID BeginUpdate()
Definition: taskswnd.cpp:326
VOID EndUpdate()
Definition: taskswnd.cpp:331
#define TRUE
Definition: types.h:120
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2839
#define ASSERT(a)
Definition: mode.c:44
static HICON
Definition: imagelist.c:80
short WCHAR
Definition: pedump.c:58
#define BTNS_SHOWTEXT
Definition: commctrl.h:1006
#define TBSTATE_ELLIPSES
Definition: commctrl.h:978
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define BTNS_CHECK
Definition: commctrl.h:1000
#define BTNS_NOPREFIX
Definition: commctrl.h:1005
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572
#define LR_SHARED
Definition: winuser.h:1111
#define LR_DEFAULTSIZE
Definition: winuser.h:1105
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define _countof(array)
Definition: sndvol32.h:70
BYTE fsState
Definition: commctrl.h:951
INT_PTR iString
Definition: commctrl.h:959
int idCommand
Definition: commctrl.h:950
DWORD_PTR dwData
Definition: commctrl.h:958
int iBitmap
Definition: commctrl.h:949
BYTE fsStyle
Definition: commctrl.h:952
#define DWORD_PTR
Definition: treelist.c:76
int32_t INT
Definition: typedefs.h:58

Referenced by AddTask().

◆ AddToTaskGroup()

PTASK_GROUP CTaskSwitchWnd::AddToTaskGroup ( IN HWND  hWnd)
inline

Definition at line 872 of file taskswnd.cpp.

873 {
875 PTASK_GROUP TaskGroup, *PrevLink;
876
878 &dwProcessId))
879 {
880 TRACE("Cannot get process id of hwnd 0x%p\n", hWnd);
881 return NULL;
882 }
883
884 /* Try to find an existing task group */
885 TaskGroup = m_TaskGroups;
886 PrevLink = &m_TaskGroups;
887 while (TaskGroup != NULL)
888 {
889 if (TaskGroup->dwProcessId == dwProcessId)
890 {
891 TaskGroup->dwTaskCount++;
892 return TaskGroup;
893 }
894
895 PrevLink = &TaskGroup->Next;
896 TaskGroup = TaskGroup->Next;
897 }
898
899 /* Allocate a new task group */
900 TaskGroup = (PTASK_GROUP) HeapAlloc(hProcessHeap,
902 sizeof(*TaskGroup));
903 if (TaskGroup != NULL)
904 {
905 TaskGroup->dwTaskCount = 1;
906 TaskGroup->dwProcessId = dwProcessId;
907 TaskGroup->Index = -1;
908
909 /* Add the task group to the list */
910 *PrevLink = TaskGroup;
911 }
912
913 return TaskGroup;
914 }
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
HANDLE hProcessHeap
Definition: explorer.cpp:25
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ DWORD dwProcessId
Definition: shlwapi.h:193
struct _TASK_GROUP * Next
Definition: taskswnd.cpp:155
DWORD dwTaskCount
Definition: taskswnd.cpp:157
DWORD dwProcessId
Definition: taskswnd.cpp:158
struct _TASK_GROUP * PTASK_GROUP
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)

Referenced by AddTask().

◆ AllocTaskItem()

PTASK_ITEM CTaskSwitchWnd::AllocTaskItem ( )
inline

Definition at line 1020 of file taskswnd.cpp.

1021 {
1023 {
1024 /* We need the most significant bit in 16 bit command IDs to indicate whether it
1025 is a task group or task item. WM_COMMAND limits command IDs to 16 bits! */
1026 return NULL;
1027 }
1028
1030
1031 if (m_TaskItemCount == 0)
1032 {
1034 0,
1036 if (m_TaskItems != NULL)
1037 {
1039 }
1040 else
1041 return NULL;
1042 }
1044 {
1045 PTASK_ITEM NewArray;
1046 SIZE_T NewArrayLength, ActiveTaskItemIndex;
1047
1049
1050 NewArray = (PTASK_ITEM) HeapReAlloc(hProcessHeap,
1051 0,
1053 NewArrayLength * sizeof(*m_TaskItems));
1054 if (NewArray != NULL)
1055 {
1056 if (m_ActiveTaskItem != NULL)
1057 {
1058 /* Fixup the ActiveTaskItem pointer */
1059 ActiveTaskItemIndex = m_ActiveTaskItem - m_TaskItems;
1060 m_ActiveTaskItem = NewArray + ActiveTaskItemIndex;
1061 }
1062 m_AllocatedTaskItems = (WORD) NewArrayLength;
1063 m_TaskItems = NewArray;
1064 }
1065 else
1066 return NULL;
1067 }
1068
1069 return m_TaskItems + m_TaskItemCount++;
1070 }
#define HeapReAlloc
Definition: compat.h:734
unsigned short WORD
Definition: ntddk_ex.h:93
struct _TASK_ITEM * PTASK_ITEM
#define TASK_ITEM_ARRAY_ALLOC
Definition: taskswnd.cpp:22
#define MAX_TASKS_COUNT
Definition: taskswnd.cpp:21
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by AddTask().

◆ CalculateTaskItemNewButtonIndex()

INT CTaskSwitchWnd::CalculateTaskItemNewButtonIndex ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 733 of file taskswnd.cpp.

734 {
735 PTASK_GROUP TaskGroup;
736 PTASK_ITEM LastTaskItem;
737
738 /* NOTE: This routine assumes that the group is *not* collapsed! */
739
740 TaskGroup = TaskItem->Group;
742 {
743 if (TaskGroup != NULL)
744 {
745 ASSERT(TaskGroup->Index < 0);
746 ASSERT(!TaskGroup->IsCollapsed);
747
748 if (TaskGroup->dwTaskCount > 1)
749 {
750 LastTaskItem = FindLastTaskItemOfGroup(TaskGroup, TaskItem);
751 if (LastTaskItem != NULL)
752 {
753 /* Since the group is expanded the task items must have an index */
754 ASSERT(LastTaskItem->Index >= 0);
755
756 return LastTaskItem->Index + 1;
757 }
758 }
759 }
760 else
761 {
762 /* Find the last NULL group button. NULL groups are added at the end of the
763 task item list when grouping is enabled */
764 LastTaskItem = FindLastTaskItemOfGroup(NULL, TaskItem);
765 if (LastTaskItem != NULL)
766 {
767 ASSERT(LastTaskItem->Index >= 0);
768
769 return LastTaskItem->Index + 1;
770 }
771 }
772 }
773
774 return m_ButtonCount;
775 }
PTASK_ITEM FindLastTaskItemOfGroup(IN PTASK_GROUP TaskGroup OPTIONAL, IN PTASK_ITEM NewTaskItem OPTIONAL)
Definition: taskswnd.cpp:695
DWORD IsCollapsed
Definition: taskswnd.cpp:166

Referenced by AddTaskItemButton().

◆ CheckActivateTaskItem()

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

Definition at line 1105 of file taskswnd.cpp.

1106 {
1107 PTASK_ITEM CurrentTaskItem;
1108 PTASK_GROUP TaskGroup = NULL;
1109
1110 CurrentTaskItem = m_ActiveTaskItem;
1111
1112 if (TaskItem != NULL)
1113 TaskGroup = TaskItem->Group;
1114
1115 if (m_IsGroupingEnabled &&
1116 TaskGroup != NULL &&
1117 TaskGroup->IsCollapsed)
1118 {
1119 /* FIXME */
1120 return;
1121 }
1122
1123 if (CurrentTaskItem != NULL)
1124 {
1125 PTASK_GROUP CurrentTaskGroup;
1126
1127 if (CurrentTaskItem == TaskItem)
1128 return;
1129
1130 CurrentTaskGroup = CurrentTaskItem->Group;
1131
1132 if (m_IsGroupingEnabled &&
1133 CurrentTaskGroup != NULL &&
1134 CurrentTaskGroup->IsCollapsed)
1135 {
1136 if (CurrentTaskGroup == TaskGroup)
1137 return;
1138
1139 /* FIXME */
1140 }
1141 else
1142 {
1144 if (CurrentTaskItem->Index >= 0)
1145 {
1146 UpdateTaskItemButton(CurrentTaskItem);
1147 }
1148 }
1149 }
1150
1151 m_ActiveTaskItem = TaskItem;
1152
1153 if (TaskItem != NULL && TaskItem->Index >= 0)
1154 {
1155 UpdateTaskItemButton(TaskItem);
1156 }
1157 else if (TaskItem == NULL)
1158 {
1159 TRACE("Active TaskItem now NULL\n");
1160 }
1161 }

Referenced by ActivateTaskItem().

◆ ContextSensitiveHelp()

STDMETHODIMP CTaskSwitchWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inlineoverride

Implements IOleWindow.

Definition at line 2347 of file taskswnd.cpp.

2348 {
2349 return E_NOTIMPL;
2350 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DeleteAllTasks()

VOID CTaskSwitchWnd::DeleteAllTasks ( )
inline

Definition at line 1277 of file taskswnd.cpp.

1278 {
1279 PTASK_ITEM CurrentTask;
1280
1281 if (m_TaskItemCount > 0)
1282 {
1283 CurrentTask = m_TaskItems + m_TaskItemCount;
1284 do
1285 {
1286 DeleteTaskItem(--CurrentTask);
1287 } while (CurrentTask != m_TaskItems);
1288 }
1289 }
VOID DeleteTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1090

Referenced by OnDestroy().

◆ DeleteTask()

BOOL CTaskSwitchWnd::DeleteTask ( IN HWND  hWnd)
inline

Definition at line 1260 of file taskswnd.cpp.

1261 {
1262 PTASK_ITEM TaskItem;
1263
1264 TaskItem = FindTaskItem(hWnd);
1265 if (TaskItem != NULL)
1266 {
1267 TRACE("Delete window 0x%p on button %d\n", hWnd, TaskItem->Index);
1268 DeleteTaskItem(TaskItem);
1269 return TRUE;
1270 }
1271 //else
1272 //TRACE("Failed to delete window 0x%p\n", hWnd);
1273
1274 return FALSE;
1275 }

Referenced by OnShellHook().

◆ DeleteTaskItem()

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

Definition at line 1090 of file taskswnd.cpp.

1091 {
1092 if (!m_IsDestroying)
1093 {
1094 /* Delete the task button from the toolbar */
1095 DeleteTaskItemButton(TaskItem);
1096 }
1097
1098 /* Remove the task from it's group */
1099 RemoveTaskFromTaskGroup(TaskItem);
1100
1101 /* Free the task item */
1102 FreeTaskItem(TaskItem);
1103 }
VOID FreeTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1072
VOID RemoveTaskFromTaskGroup(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:916
BOOL DeleteTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:837

Referenced by DeleteAllTasks(), and DeleteTask().

◆ DeleteTaskItemButton()

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

Definition at line 837 of file taskswnd.cpp.

838 {
839 PTASK_GROUP TaskGroup;
840 INT iIndex;
841
842 TaskGroup = TaskItem->Group;
843
844 if (TaskItem->Index >= 0)
845 {
846 if ((TaskGroup != NULL && !TaskGroup->IsCollapsed) ||
847 TaskGroup == NULL)
848 {
850
851 RemoveIcon(TaskItem);
852 iIndex = TaskItem->Index;
853 if (m_TaskBar.DeleteButton(iIndex))
854 {
855 TaskItem->Index = -1;
857
858 UpdateIndexesAfter(iIndex, FALSE);
859
860 /* Update button sizes and fix the button wrapping */
862 return TRUE;
863 }
864
866 }
867 }
868
869 return FALSE;
870 }
VOID RemoveIcon(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:667

Referenced by DeleteTaskItem().

◆ EnumWindowsProc()

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

Definition at line 1486 of file taskswnd.cpp.

1487 {
1488 if (m_Tray->IsTaskWnd(hWnd))
1489 {
1490 TRACE("Adding task for %p...\n", hWnd);
1491 AddTask(hWnd);
1492 }
1493 return TRUE;
1494 }
BOOL AddTask(IN HWND hWnd)
Definition: taskswnd.cpp:1196

◆ ExpandTaskGroup()

VOID CTaskSwitchWnd::ExpandTaskGroup ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 577 of file taskswnd.cpp.

578 {
579 ASSERT(TaskGroup->dwTaskCount > 0);
580 ASSERT(TaskGroup->IsCollapsed);
581 ASSERT(TaskGroup->Index >= 0);
582
583 /* FIXME: Implement */
584 }

Referenced by RemoveTaskFromTaskGroup().

◆ FindLastTaskItemOfGroup()

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

Definition at line 695 of file taskswnd.cpp.

698 {
699 PTASK_ITEM TaskItem, LastTaskItem, FoundTaskItem = NULL;
700 DWORD dwTaskCount;
701
703
704 TaskItem = m_TaskItems;
705 LastTaskItem = TaskItem + m_TaskItemCount;
706
707 dwTaskCount = (TaskGroup != NULL ? TaskGroup->dwTaskCount : MAX_TASKS_COUNT);
708
709 ASSERT(dwTaskCount > 0);
710
711 while (TaskItem != LastTaskItem)
712 {
713 if (TaskItem->Group == TaskGroup)
714 {
715 if ((NewTaskItem != NULL && TaskItem != NewTaskItem) || NewTaskItem == NULL)
716 {
717 FoundTaskItem = TaskItem;
718 }
719
720 if (--dwTaskCount == 0)
721 {
722 /* We found the last task item in the group! */
723 break;
724 }
725 }
726
727 TaskItem++;
728 }
729
730 return FoundTaskItem;
731 }

Referenced by CalculateTaskItemNewButtonIndex().

◆ FindOtherTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindOtherTaskItem ( IN HWND  hWnd)
inline

Definition at line 979 of file taskswnd.cpp.

980 {
981 PTASK_ITEM LastItem, TaskItem;
982 PTASK_GROUP TaskGroup;
984
986 {
987 return NULL;
988 }
989
990 /* Try to find another task that belongs to the same
991 process as the given window */
992 TaskItem = m_TaskItems;
993 LastItem = TaskItem + m_TaskItemCount;
994 while (TaskItem != LastItem)
995 {
996 TaskGroup = TaskItem->Group;
997 if (TaskGroup != NULL)
998 {
999 if (TaskGroup->dwProcessId == dwProcessId)
1000 return TaskItem;
1001 }
1002 else
1003 {
1004 DWORD dwProcessIdTask;
1005
1006 if (GetWindowThreadProcessId(TaskItem->hWnd,
1007 &dwProcessIdTask) &&
1008 dwProcessIdTask == dwProcessId)
1009 {
1010 return TaskItem;
1011 }
1012 }
1013
1014 TaskItem++;
1015 }
1016
1017 return NULL;
1018 }

Referenced by ActivateTask().

◆ FindRudeApp()

HWND CTaskSwitchWnd::FindRudeApp ( _In_opt_ HWND  hwndFirstCheck)
inline

Definition at line 2002 of file taskswnd.cpp.

2003 {
2004 // Quick check
2005 HMONITOR hMon = MonitorFromWindow(hwndFirstCheck, MONITOR_DEFAULTTONEAREST);
2006 RUDEAPPDATA data = { hMon, NULL, hwndFirstCheck };
2007 if (::IsWindow(hwndFirstCheck) && !IsRudeEnumProc(hwndFirstCheck, (LPARAM)&data))
2008 return hwndFirstCheck;
2009
2010 // Slow check
2012
2013 return data.hwndFound;
2014 }
static BOOL CALLBACK IsRudeEnumProc(_In_ HWND hwnd, _In_ LPARAM lParam)
Definition: taskswnd.cpp:1931
struct CTaskSwitchWnd::tagRUDEAPPDATA RUDEAPPDATA
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
LONG_PTR LPARAM
Definition: minwindef.h:175
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)

Referenced by OnTimer(), and OnWindowDestroyed().

◆ FindTaskGroupByIndex()

PTASK_GROUP CTaskSwitchWnd::FindTaskGroupByIndex ( IN INT  Index)
inline

Definition at line 1180 of file taskswnd.cpp.

1181 {
1182 PTASK_GROUP CurrentGroup;
1183
1184 CurrentGroup = m_TaskGroups;
1185 while (CurrentGroup != NULL)
1186 {
1187 if (CurrentGroup->Index == Index)
1188 break;
1189
1190 CurrentGroup = CurrentGroup->Next;
1191 }
1192
1193 return CurrentGroup;
1194 }
_In_ WDFCOLLECTION _In_ ULONG Index

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

◆ FindTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindTaskItem ( IN HWND  hWnd)
inline

Definition at line 962 of file taskswnd.cpp.

963 {
964 PTASK_ITEM TaskItem, LastItem;
965
966 TaskItem = m_TaskItems;
967 LastItem = TaskItem + m_TaskItemCount;
968 while (TaskItem != LastItem)
969 {
970 if (TaskItem->hWnd == hWnd)
971 return TaskItem;
972
973 TaskItem++;
974 }
975
976 return NULL;
977 }

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

◆ FindTaskItemByIndex()

PTASK_ITEM CTaskSwitchWnd::FindTaskItemByIndex ( IN INT  Index)
inline

Definition at line 1163 of file taskswnd.cpp.

1164 {
1165 PTASK_ITEM TaskItem, LastItem;
1166
1167 TaskItem = m_TaskItems;
1168 LastItem = TaskItem + m_TaskItemCount;
1169 while (TaskItem != LastItem)
1170 {
1171 if (TaskItem->Index == Index)
1172 return TaskItem;
1173
1174 TaskItem++;
1175 }
1176
1177 return NULL;
1178 }

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

◆ FlashTask()

BOOL CTaskSwitchWnd::FlashTask ( IN HWND  hWnd)
inline

Definition at line 1297 of file taskswnd.cpp.

1298 {
1299 PTASK_ITEM TaskItem;
1300
1301 TaskItem = FindTaskItem(hWnd);
1302 if (TaskItem != NULL)
1303 {
1304 TRACE("Flashing window 0x%p on button %d\n", hWnd, TaskItem->Index);
1305 FlashTaskItem(TaskItem);
1306 return TRUE;
1307 }
1308
1309 return FALSE;
1310 }
VOID FlashTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1291

Referenced by OnShellHook().

◆ FlashTaskItem()

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

Definition at line 1291 of file taskswnd.cpp.

1292 {
1293 TaskItem->RenderFlashed = 1;
1294 UpdateTaskItemButton(TaskItem);
1295 }

Referenced by FlashTask().

◆ FreeTaskItem()

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

Definition at line 1072 of file taskswnd.cpp.

1073 {
1074 WORD wIndex;
1075
1076 if (TaskItem == m_ActiveTaskItem)
1078
1079 wIndex = (WORD) (TaskItem - m_TaskItems);
1080 if (wIndex + 1 < m_TaskItemCount)
1081 {
1082 MoveMemory(TaskItem,
1083 TaskItem + 1,
1084 (m_TaskItemCount - wIndex - 1) * sizeof(*TaskItem));
1085 }
1086
1088 }
#define MoveMemory
Definition: minwinbase.h:28

Referenced by DeleteTaskItem().

◆ FullScreenEnumProc()

static BOOL CALLBACK CTaskSwitchWnd::FullScreenEnumProc ( _In_ HMONITOR  hMonitor,
_In_opt_ HDC  hDC,
_In_ LPRECT  prc,
_In_ LPARAM  lParam 
)
inlinestatic

Definition at line 1957 of file taskswnd.cpp.

1958 {
1960
1961 BOOL bFullOpening = (pData->hTargetMonitor == hMonitor);
1962 if (!bFullOpening && pData->pRect)
1963 {
1964 RECT rc, rcMon;
1965 SHELL_GetMonitorRect(hMonitor, &rcMon, FALSE);
1966 ::IntersectRect(&rc, &rcMon, pData->pRect);
1967 bFullOpening = ::EqualRect(&rc, &rcMon);
1968 }
1969
1970 // Notify ABN_FULLSCREENAPP to appbars
1971 pData->pTray->NotifyFullScreenToAppBars(hMonitor, bFullOpening);
1972 return TRUE;
1973 }
struct CTaskSwitchWnd::tagFULLSCREENDATA * PFULLSCREENDATA
LPARAM lParam
Definition: combotst.c:139
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
Definition: dcommon.idl:28
static BOOL SHELL_GetMonitorRect(_In_opt_ HMONITOR hMonitor, _Out_opt_ PRECT prcDest, _In_ BOOL bWorkAreaOnly)
Definition: taskswnd.cpp:32
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830

Referenced by HandleFullScreenApp().

◆ GetWindow()

STDMETHODIMP CTaskSwitchWnd::GetWindow ( HWND *  phwnd)
inlineoverride

Implements IOleWindow.

Definition at line 2338 of file taskswnd.cpp.

2339 {
2340 if (!phwnd)
2341 return E_INVALIDARG;
2342 *phwnd = m_hWnd;
2343 return S_OK;
2344 }
HWND m_hWnd
Definition: atlwin.h:273
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52

◆ GetWndIcon()

HICON CTaskSwitchWnd::GetWndIcon ( HWND  hwnd)
inline

Definition at line 586 of file taskswnd.cpp.

587 {
588 HICON hIcon = NULL;
589
590 /* Retrieve icon by sending a message */
591#define GET_ICON(type) \
592 SendMessageTimeout(hwnd, WM_GETICON, (type), 0, SMTO_NOTIMEOUTIFNOTHUNG, 100, (PDWORD_PTR)&hIcon)
593
594 LRESULT bAlive = GET_ICON(g_TaskbarSettings.bSmallIcons ? ICON_SMALL2 : ICON_BIG);
595 if (hIcon)
596 return hIcon;
597
598 if (bAlive)
599 {
600 bAlive = GET_ICON(ICON_SMALL);
601 if (hIcon)
602 return hIcon;
603 }
604
605 if (bAlive)
606 {
608 if (hIcon)
609 return hIcon;
610 }
611#undef GET_ICON
612
613 /* If we failed, retrieve icon from the window class */
615 if (hIcon)
616 return hIcon;
617
619 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
LONG_PTR LRESULT
Definition: minwindef.h:176
HICON hIcon
Definition: msconfig.c:44
#define GCLP_HICONSM
Definition: winuser.h:683
#define GCLP_HICON
Definition: winuser.h:682
#define GetClassLongPtr
Definition: winuser.h:5948
BOOL bSmallIcons
Definition: precomp.h:225
#define GET_ICON(type)
#define ICON_BIG
Definition: tnclass.cpp:51
#define ICON_SMALL
Definition: tnclass.cpp:48
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by AddTaskItemButton(), and UpdateTaskItemButton().

◆ GetWndTextFromTaskItem()

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

Definition at line 445 of file taskswnd.cpp.

446 {
447 /* Get the window text without sending a message so we don't hang if an
448 application isn't responding! */
449 return InternalGetWindowText(TaskItem->hWnd, szBuf, cchBuf);
450 }
_In_ UINT cchBuf
Definition: shlwapi.h:378
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 1621 of file taskswnd.cpp.

1622 {
1623 const UINT uAppCmd = GET_APPCOMMAND_LPARAM(lParam);
1624 if (InvokeRegistryAppKeyCommand(uAppCmd))
1625 return TRUE;
1626 switch (uAppCmd)
1627 {
1628 // TODO: When MMDevAPI arrives, try IMMDeviceEnumerator::GetDefaultAudioEndpoint first and then fall back to WinMM.
1629 case APPCOMMAND_VOLUME_MUTE:
1630 return m_Mixer.Mute();
1631 case APPCOMMAND_VOLUME_DOWN:
1632 case APPCOMMAND_VOLUME_UP:
1633 return m_Mixer.AdjustVolume(uAppCmd, hProcessHeap);
1634 case APPCOMMAND_BROWSER_SEARCH:
1635 return SHFindFiles(NULL, NULL);
1636 }
1637 return FALSE;
1638 }
bool AdjustVolume(_In_ UINT direction, _In_ HANDLE hProcessHeap)
Definition: mediabtns.cpp:184
CMultimediaBackend m_Mixer
Definition: taskswnd.cpp:421
static BOOL InvokeRegistryAppKeyCommand(UINT uAppCmd)
Definition: taskswnd.cpp:1584
unsigned int UINT
Definition: sysinfo.c:13
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2576

Referenced by OnShellHook().

◆ HandleButtonClick()

BOOL CTaskSwitchWnd::HandleButtonClick ( IN WORD  wIndex)
inline

Definition at line 1768 of file taskswnd.cpp.

1769 {
1770 PTASK_ITEM TaskItem;
1771 PTASK_GROUP TaskGroup;
1772
1774 {
1775 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1776 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1777 {
1778 HandleTaskGroupClick(TaskGroup);
1779 return TRUE;
1780 }
1781 }
1782
1783 TaskItem = FindTaskItemByIndex((INT) wIndex);
1784 if (TaskItem != NULL)
1785 {
1786 HandleTaskItemClick(TaskItem);
1787 return TRUE;
1788 }
1789
1790 return FALSE;
1791 }
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1180
VOID HandleTaskGroupClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1763
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1163
VOID HandleTaskItemClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1731

Referenced by OnCommand().

◆ HandleButtonRightClick()

BOOL CTaskSwitchWnd::HandleButtonRightClick ( IN WORD  wIndex)
inline

Definition at line 1820 of file taskswnd.cpp.

1821 {
1822 PTASK_ITEM TaskItem;
1823 PTASK_GROUP TaskGroup;
1825 {
1826 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1827 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1828 {
1829 HandleTaskGroupRightClick(TaskGroup);
1830 return TRUE;
1831 }
1832 }
1833
1834 TaskItem = FindTaskItemByIndex((INT) wIndex);
1835
1836 if (TaskItem != NULL)
1837 {
1838 HandleTaskItemRightClick(TaskItem);
1839 return TRUE;
1840 }
1841
1842 return FALSE;
1843 }
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1815
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1799

Referenced by OnContextMenu().

◆ HandleFullScreenApp()

void CTaskSwitchWnd::HandleFullScreenApp ( _In_opt_ HWND  hwndRude)
inline

Definition at line 1975 of file taskswnd.cpp.

1976 {
1977 // Notify ABN_FULLSCREENAPP for every monitor
1978 RECT rc;
1980 if (hwndRude && ::GetWindowRect(hwndRude, &rc))
1981 {
1982 Data.pRect = &rc;
1983 Data.hTargetMonitor = ::MonitorFromWindow(hwndRude, MONITOR_DEFAULTTONULL);
1984 }
1985 Data.pTray = m_Tray;
1987
1988 if (hwndRude)
1989 {
1990 // Make the taskbar bottom
1992 HWND hwndTray = m_Tray->GetHWND();
1993 ::SetWindowPos(hwndTray, HWND_BOTTOM, 0, 0, 0, 0, uFlags);
1994
1995 // Switch to the rude app if necessary
1996 DWORD exstyle = (DWORD)::GetWindowLongPtrW(hwndRude, GWL_EXSTYLE);
1997 if (!(exstyle & WS_EX_TOPMOST) && !SHELL_IsRudeWindowActive(hwndRude))
1998 ::SwitchToThisWindow(hwndRude, TRUE);
1999 }
2000 }
static BOOL CALLBACK FullScreenEnumProc(_In_ HMONITOR hMonitor, _In_opt_ HDC hDC, _In_ LPRECT prc, _In_ LPARAM lParam)
Definition: taskswnd.cpp:1957
struct CTaskSwitchWnd::tagFULLSCREENDATA FULLSCREENDATA
UINT uFlags
Definition: api.c:59
#define DWORD
Definition: nt_native.h:44
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define GetWindowLongPtrW
Definition: winuser.h:4983
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOMOVE
Definition: winuser.h:1255
BOOL WINAPI EnumDisplayMonitors(_In_opt_ HDC, _In_opt_ LPCRECT, _In_ MONITORENUMPROC, _In_ LPARAM)
#define SWP_NOSIZE
Definition: winuser.h:1256
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260
#define HWND_BOTTOM
Definition: winuser.h:1216
#define GWL_EXSTYLE
Definition: winuser.h:862
static BOOL SHELL_IsRudeWindowActive(_In_ HWND hWnd)
Definition: taskswnd.cpp:68
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82

Referenced by OnTimer(), and OnWindowDestroyed().

◆ HandleItemPaint()

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

Definition at line 1846 of file taskswnd.cpp.

1847 {
1848 LRESULT Ret = CDRF_DODEFAULT;
1849 PTASK_GROUP TaskGroup;
1850 PTASK_ITEM TaskItem;
1851
1852 TaskItem = FindTaskItemByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1853 TaskGroup = FindTaskGroupByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1854 if (TaskGroup == NULL && TaskItem != NULL)
1855 {
1856 ASSERT(TaskItem != NULL);
1857
1858 if (TaskItem != NULL && ::IsWindow(TaskItem->hWnd))
1859 {
1860 /* Make the entire button flashing if necessary */
1861 if (nmtbcd->nmcd.uItemState & CDIS_MARKED)
1862 {
1863 Ret = TBCDRF_NOBACKGROUND;
1864 if (!m_Theme)
1865 {
1866 SelectObject(nmtbcd->nmcd.hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
1867 Rectangle(nmtbcd->nmcd.hdc,
1868 nmtbcd->nmcd.rc.left,
1869 nmtbcd->nmcd.rc.top,
1870 nmtbcd->nmcd.rc.right,
1871 nmtbcd->nmcd.rc.bottom);
1872 }
1873 else
1874 {
1875 DrawThemeBackground(m_Theme, nmtbcd->nmcd.hdc, TDP_FLASHBUTTON, 0, &nmtbcd->nmcd.rc, 0);
1876 }
1877 nmtbcd->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
1878 return Ret;
1879 }
1880 }
1881 }
1882 else if (TaskGroup != NULL)
1883 {
1884 /* FIXME: Implement painting for task groups */
1885 }
1886 return Ret;
1887 }
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
#define CDRF_DODEFAULT
Definition: commctrl.h:268
#define TBCDRF_NOBACKGROUND
Definition: commctrl.h:1040
#define CDIS_MARKED
Definition: commctrl.h:298
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_HIGHLIGHT
Definition: winuser.h:937
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:938
@ TDP_FLASHBUTTON
Definition: vssym32.h:578
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by HandleToolbarNotification().

◆ HandleTaskGroupClick()

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

Definition at line 1763 of file taskswnd.cpp.

1764 {
1765 /* TODO: Show task group menu */
1766 }

Referenced by HandleButtonClick().

◆ HandleTaskGroupRightClick()

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

Definition at line 1815 of file taskswnd.cpp.

1816 {
1817 /* TODO: Show task group right click menu */
1818 }

Referenced by HandleButtonRightClick().

◆ HandleTaskItemClick()

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

Definition at line 1731 of file taskswnd.cpp.

1732 {
1733 BOOL bIsMinimized;
1734 BOOL bIsActive;
1735
1736 if (::IsWindow(TaskItem->hWnd))
1737 {
1738 bIsMinimized = ::IsIconic(TaskItem->hWnd);
1739 bIsActive = (TaskItem == m_ActiveTaskItem);
1740
1741 TRACE("Active TaskItem %p, selected TaskItem %p\n", m_ActiveTaskItem, TaskItem);
1742 if (m_ActiveTaskItem)
1743 TRACE("Active TaskItem hWnd=%p, TaskItem hWnd %p\n", m_ActiveTaskItem->hWnd, TaskItem->hWnd);
1744
1745 TRACE("Valid button clicked. HWND=%p, IsMinimized=%s, IsActive=%s...\n",
1746 TaskItem->hWnd, bIsMinimized ? "Yes" : "No", bIsActive ? "Yes" : "No");
1747
1748 if (!bIsMinimized && bIsActive)
1749 {
1750 if (!::IsHungAppWindow(TaskItem->hWnd))
1751 ::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE);
1752 TRACE("Valid button clicked. App window Minimized.\n");
1753 }
1754 else
1755 {
1756 ::SwitchToThisWindow(TaskItem->hWnd, TRUE);
1757
1758 TRACE("Valid button clicked. App window Restored.\n");
1759 }
1760 }
1761 }
BOOL IsIconic() const
Definition: atlwin.h:932
#define SW_MINIMIZE
Definition: winuser.h:787
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
BOOL WINAPI IsHungAppWindow(HWND hwnd)
Definition: window.c:1869

Referenced by HandleButtonClick().

◆ HandleTaskItemRightClick()

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

Definition at line 1799 of file taskswnd.cpp.

1800 {
1801 POINT pt;
1802 GetCursorPos(&pt);
1803
1804 SetForegroundWindow(TaskItem->hWnd);
1805
1806 ActivateTask(TaskItem->hWnd);
1807
1808 if (GetForegroundWindow() != TaskItem->hWnd)
1809 ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
1810
1811 ::SendMessageCallbackW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y),
1812 SendAsyncProc, (ULONG_PTR)TaskItem);
1813 }
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1236
static VOID CALLBACK SendAsyncProc(HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
Definition: taskswnd.cpp:1794
#define pt(x, y)
Definition: drawing.c:79
#define MAKELPARAM(l, h)
Definition: winuser.h:4116
HWND WINAPI GetForegroundWindow(void)
Definition: ntwrapper.h:392
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3074
BOOL WINAPI SendMessageCallbackW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM, _In_ SENDASYNCPROC, _In_ ULONG_PTR)
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WM_POPUPSYSTEMMENU
Definition: undocuser.h:62

Referenced by HandleButtonRightClick().

◆ HandleToolbarNotification()

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

Definition at line 1889 of file taskswnd.cpp.

1890 {
1891 LRESULT Ret = 0;
1892
1893 switch (nmh->code)
1894 {
1895 case NM_CUSTOMDRAW:
1896 {
1897 LPNMTBCUSTOMDRAW nmtbcd = (LPNMTBCUSTOMDRAW) nmh;
1898
1899 switch (nmtbcd->nmcd.dwDrawStage)
1900 {
1901
1902 case CDDS_ITEMPREPAINT:
1903 Ret = HandleItemPaint(nmtbcd);
1904 break;
1905
1906 case CDDS_PREPAINT:
1907 Ret = CDRF_NOTIFYITEMDRAW;
1908 break;
1909
1910 default:
1911 Ret = CDRF_DODEFAULT;
1912 break;
1913 }
1914 break;
1915 }
1916 }
1917
1918 return Ret;
1919 }
LRESULT HandleItemPaint(IN OUT NMTBCUSTOMDRAW *nmtbcd)
Definition: taskswnd.cpp:1846
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:285
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:275
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define CDDS_PREPAINT
Definition: commctrl.h:280
struct _NMTBCUSTOMDRAW * LPNMTBCUSTOMDRAW
NMCUSTOMDRAW nmcd
Definition: commctrl.h:1017

Referenced by OnNotify().

◆ Initialize()

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

Definition at line 2325 of file taskswnd.cpp.

2326 {
2327 m_Tray = tray;
2330 if (!m_hWnd)
2331 return E_FAIL;
2332 return S_OK;
2333 }
@ Create
Definition: registry.c:563
#define E_FAIL
Definition: ddrawi.h:102
#define WS_CHILD
Definition: pedump.c:617
#define WS_TABSTOP
Definition: pedump.c:634
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
BOOL bGroupButtons
Definition: precomp.h:221
const WCHAR szRunningApps[]
Definition: taskswnd.cpp:125

◆ InvokeRegistryAppKeyCommand()

static BOOL CTaskSwitchWnd::InvokeRegistryAppKeyCommand ( UINT  uAppCmd)
inlinestatic

Definition at line 1584 of file taskswnd.cpp.

1585 {
1586 BOOL bResult = FALSE;
1587 WCHAR szBuf[MAX_PATH * 2];
1588 wsprintfW(szBuf, L"%s\\AppKey\\%u", REGSTR_PATH_EXPLORER, uAppCmd);
1589 HUSKEY hKey;
1591 return bResult;
1592
1593 DWORD cb = sizeof(szBuf);
1594 if (!bResult && SHRegQueryUSValueW(hKey, L"ShellExecute", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1595 {
1596 bResult = TRUE;
1597 }
1598 cb = sizeof(szBuf);
1599 if (!bResult && SHRegQueryUSValueW(hKey, L"Association", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1600 {
1601 bResult = TRUE;
1602 cb = _countof(szBuf);
1604 *szBuf = UNICODE_NULL;
1605 }
1606 cb = sizeof(szBuf);
1607 if (!bResult && SHRegQueryUSValueW(hKey, L"RegisteredApp", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1608 {
1609 bResult = TRUE;
1611 *szBuf = UNICODE_NULL; // Don't execute again
1612 }
1614
1615 // Note: Tweak UI uses an empty string for its "Do nothing" option.
1616 if (bResult && *szBuf)
1618 return bResult;
1619 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define MAX_PATH
Definition: compat.h:34
LONG WINAPI SHRegCloseUSKey(HUSKEY hUSKey)
Definition: registry.c:3626
LONG WINAPI SHRegQueryUSValueW(HUSKEY hUSKey, const WCHAR *value, DWORD *type, void *data, DWORD *data_len, BOOL ignore_hkcu, void *default_data, DWORD default_data_len)
Definition: registry.c:4019
LONG WINAPI SHRegOpenUSKeyW(const WCHAR *path, REGSAM access_mask, HUSKEY relative_key, HUSKEY *uskey, BOOL ignore_hkcu)
Definition: registry.c:3747
static MonoProfilerRuntimeShutdownBeginCallback cb
Definition: metahost.c:118
EXTERN_C HRESULT WINAPI SHRunIndirectRegClientCommand(_In_opt_ HWND hWnd, _In_ PCWSTR pszClientType)
Definition: utils.cpp:626
FxAutoRegKey hKey
#define KEY_READ
Definition: nt_native.h:1026
#define UNICODE_NULL
@ ASSOCSTR_EXECUTABLE
Definition: shlwapi.h:887
@ ASSOCF_NOTRUNCATE
Definition: shlwapi.h:865
#define AssocQueryString
Definition: shlwapi.h:1024
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define SW_SHOW
Definition: winuser.h:786
#define REGSTR_PATH_EXPLORER
Definition: regstr.h:33
EXTERN_C VOID WINAPI ShellExec_RunDLLW(_In_opt_ HWND hwnd, _In_opt_ HINSTANCE hInstance, _In_ PCWSTR pszCmdLine, _In_ INT nCmdShow)
Definition: shlexec.cpp:3439

Referenced by HandleAppCommand().

◆ IsRudeEnumProc()

static BOOL CALLBACK CTaskSwitchWnd::IsRudeEnumProc ( _In_ HWND  hwnd,
_In_ LPARAM  lParam 
)
inlinestatic

Definition at line 1931 of file taskswnd.cpp.

1932 {
1934
1935 HMONITOR hMon = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
1936 if (!hMon ||
1937 (pData->hTargetMonitor && pData->hTargetMonitor != hMon) ||
1938 !SHELL_IsRudeWindow(hMon, hwnd, (hwnd == pData->hwndFirstCheck)))
1939 {
1940 return TRUE; // Continue
1941 }
1942
1943 pData->hwndFound = hwnd;
1944 return FALSE; // Finish
1945 }
struct CTaskSwitchWnd::tagRUDEAPPDATA * PRUDEAPPDATA
static BOOL SHELL_IsRudeWindow(_In_opt_ HMONITOR hMonitor, _In_ HWND hWnd, _In_ BOOL bDontCheckActive)
Definition: taskswnd.cpp:77

Referenced by FindRudeApp().

◆ OnActivateTaskIndex()

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

Definition at line 2117 of file taskswnd.cpp.

2118 {
2119 DWORD dwAccelerators = HIWORD(wParam);
2120 WCHAR szExecutablePath[MAX_PATH];
2121
2123 if (pTaskItem && ::IsWindow(pTaskItem->hWnd))
2124 {
2125 // Win+Shift: New instance
2126 if ((dwAccelerators & MOD_SHIFT) == MOD_SHIFT)
2127 {
2128 if (!SHELL_GetImageFileNameByWindow(pTaskItem->hWnd,
2129 szExecutablePath,
2130 _countof(szExecutablePath)))
2131 {
2132 return FALSE;
2133 }
2134 // Win+Shift+Ctrl is used for creating a new instance of a task as Administrator
2135 LPCWSTR szVerb = L"open";
2136 if ((dwAccelerators & MOD_CONTROL) == MOD_CONTROL)
2137 szVerb = L"runas";
2138 ShellExecuteW(NULL, szVerb, szExecutablePath, NULL, NULL, SW_SHOWNORMAL);
2139 return TRUE;
2140 }
2141 // Win+Alt: Jump list
2142 else if ((dwAccelerators & MOD_ALT) == MOD_ALT)
2143 {
2144 // TODO: Use JumpList once implemented
2145
2146 // Find TaskItem's position on the screen
2147 RECT rcItem, rcToolbar;
2148 m_TaskBar.GetItemRect(pTaskItem->Index, &rcItem);
2149 m_TaskBar.GetWindowRect(&rcToolbar);
2150 OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top);
2151
2152 ::SendMessageCallbackW(pTaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(rcItem.left, rcItem.top),
2153 SendAsyncProc, (ULONG_PTR)pTaskItem);
2154 }
2155 // Win+Ctrl: Switch to last window of a task
2156 else if ((dwAccelerators & MOD_CONTROL) == MOD_CONTROL)
2157 {
2158 // TODO: Implement once Superbar is implemented.
2159 return FALSE;
2160 }
2161 // No modifier: just switch to the task
2162 else
2163 {
2164 // TODO: This should launch a pinned task once Superbar is implemented
2165
2166 BOOL bIsMinimized = ::IsIconic(pTaskItem->hWnd);
2167 BOOL bIsActive = (pTaskItem == m_ActiveTaskItem);
2168
2169 if (!bIsMinimized && bIsActive)
2170 {
2171 if (!::IsHungAppWindow(pTaskItem->hWnd))
2172 ::ShowWindowAsync(pTaskItem->hWnd, SW_MINIMIZE);
2173 }
2174 else
2175 {
2176 ::SwitchToThisWindow(pTaskItem->hWnd, TRUE);
2177 }
2178 }
2179 }
2180 return TRUE;
2181 }
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
WPARAM wParam
Definition: combotst.c:138
#define MOD_ALT
Definition: imm.h:184
#define MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
#define LOWORD(l)
Definition: pedump.c:82
#define SW_SHOWNORMAL
Definition: winuser.h:781
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2787
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
static BOOL SHELL_GetImageFileNameByWindow(_In_ HWND hWnd, _Out_cap_(cchPath) LPWSTR pszPath, _In_ DWORD cchPath)
Definition: taskswnd.cpp:106
const uint16_t * LPCWSTR
Definition: typedefs.h:57
#define HIWORD(l)
Definition: typedefs.h:247

◆ OnCommand()

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

Definition at line 2088 of file taskswnd.cpp.

2089 {
2090 LRESULT Ret = TRUE;
2091 if (lParam != 0 && (HWND) lParam == m_TaskBar.m_hWnd)
2092 {
2094 }
2095 return Ret;
2096 }
BOOL HandleButtonClick(IN WORD wIndex)
Definition: taskswnd.cpp:1768

◆ OnContextMenu()

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

Definition at line 2211 of file taskswnd.cpp.

2212 {
2213 LRESULT Ret = 0;
2214 INT_PTR iBtn = -1;
2215
2216 if (m_TaskBar.m_hWnd != NULL)
2217 {
2218 POINT pt;
2219
2220 pt.x = GET_X_LPARAM(lParam);
2221 pt.y = GET_Y_LPARAM(lParam);
2222
2224
2225 iBtn = m_TaskBar.HitTest(&pt);
2226 if (iBtn >= 0)
2227 {
2229 }
2230 }
2231 if (iBtn < 0)
2232 {
2233 /* Not on a taskbar button, so forward message to tray */
2234 Ret = SendMessage(m_Tray->GetHWND(), uMsg, wParam, lParam);
2235 }
2236 return Ret;
2237 }
BOOL HandleButtonRightClick(IN WORD wIndex)
Definition: taskswnd.cpp:1820
#define SendMessage
Definition: winuser.h:6009
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
int32_t INT_PTR
Definition: typedefs.h:64
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299

◆ OnCopyData()

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

Definition at line 2309 of file taskswnd.cpp.

2310 {
2312 if (cpData->dwData == m_uHardErrorMsg)
2313 {
2314 /* A hard error balloon message */
2316 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));
2317 if (pData->cbHeaderSize == sizeof(BALLOON_HARD_ERROR_DATA))
2319 return TRUE;
2320 }
2321
2322 return FALSE;
2323 }
void StartThread(PBALLOON_HARD_ERROR_DATA pData)
Definition: taskswnd.cpp:270
CHardErrorThread m_HardErrorThread
Definition: taskswnd.cpp:420
#define ULONG_PTR
Definition: config.h:101
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
ULONG_PTR dwData
Definition: winuser.h:3109
struct _BALLOON_HARD_ERROR_DATA * PBALLOON_HARD_ERROR_DATA

◆ OnCreate()

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

Definition at line 1525 of file taskswnd.cpp.

1526 {
1528 return FALSE;
1529
1530 SetWindowTheme(m_TaskBar.m_hWnd, L"TaskBand", NULL);
1531
1534 ILC_COLOR32 | ILC_MASK, 0, 1000);
1535 m_TaskBar.SetImageList(m_ImageList);
1536
1537 /* Set proper spacing between buttons */
1538 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1539
1540 /* Register the shell hook */
1542
1543 TRACE("ShellHookMsg got assigned number %d\n", m_ShellHookMsg);
1544
1545 RegisterShellHook(m_hWnd, 3); /* 1 if no NT! We're targeting NT so we don't care! */
1546
1548
1549 /* Recalculate the button size */
1551
1552#if DUMP_TASKS != 0
1553 SetTimer(hwnd, 1, 5000, NULL);
1554#endif
1555
1556 /* WinMM is needed to change system volume via media buttons */
1557 m_WinMMDevChgMsg = RegisterWindowMessageW(L"winmm_devicechange");
1559
1560 return TRUE;
1561 }
INT UpdateTbButtonSpacing(IN BOOL bHorizontal, IN BOOL bThemed, IN UINT uiRows=0, IN UINT uiBtnsPerLine=0)
Definition: taskswnd.cpp:294
BOOL Initialize(HWND hWndParent)
Definition: taskswnd.cpp:373
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
#define ILC_COLOR32
Definition: commctrl.h:358
#define ILC_MASK
Definition: commctrl.h:351
#define SM_CYSMICON
Definition: winuser.h:1024
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define SM_CXSMICON
Definition: winuser.h:1023
#define SM_CYICON
Definition: winuser.h:984
#define SM_CXICON
Definition: winuser.h:983
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI RegisterShellHook(HWND hWnd, DWORD dwType)
Definition: shellord.c:521
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69

◆ OnDestroy()

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

Definition at line 1563 of file taskswnd.cpp.

1564 {
1566
1568
1569 /* Unregister the shell hook */
1571
1574
1575 if (m_ImageList)
1576 {
1578 m_ImageList = NULL;
1579 }
1580
1581 return TRUE;
1582 }
VOID DeleteAllTasks()
Definition: taskswnd.cpp:1277
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:1036
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define TIMER_ID_VALIDATE_RUDE_APP
Definition: taskswnd.cpp:27

◆ OnEraseBackground()

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

Definition at line 2045 of file taskswnd.cpp.

2046 {
2047 HDC hdc = (HDC) wParam;
2048
2049 if (!IsAppThemed())
2050 {
2051 bHandled = FALSE;
2052 return 0;
2053 }
2054
2055 RECT rect;
2058
2059 return TRUE;
2060 }
RECT rect
Definition: combotst.c:67
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
BOOL WINAPI IsAppThemed(void)
Definition: system.c:620
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

◆ OnKludgeItemRect()

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

Definition at line 2239 of file taskswnd.cpp.

2240 {
2241 PTASK_ITEM TaskItem = FindTaskItem((HWND) wParam);
2242 if (TaskItem)
2243 {
2244 RECT* prcMinRect = (RECT*) lParam;
2245 RECT rcItem, rcToolbar;
2246 m_TaskBar.GetItemRect(TaskItem->Index, &rcItem);
2247 m_TaskBar.GetWindowRect(&rcToolbar);
2248
2249 OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top);
2250
2251 *prcMinRect = rcItem;
2252 return TRUE;
2253 }
2254 return FALSE;
2255 }

◆ OnMouseActivate()

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

Definition at line 2257 of file taskswnd.cpp.

2258 {
2259 return MA_NOACTIVATE;
2260 }
#define MA_NOACTIVATE
Definition: winuser.h:2539

◆ OnNcHitTest()

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

Definition at line 2077 of file taskswnd.cpp.

2078 {
2079 LRESULT Ret = TRUE;
2080 /* We want the tray window to be draggable everywhere, so make the control
2081 appear transparent */
2082 Ret = DefWindowProc(uMsg, wParam, lParam);
2083 if (Ret != HTVSCROLL && Ret != HTHSCROLL)
2084 Ret = HTTRANSPARENT;
2085 return Ret;
2086 }
#define HTVSCROLL
Definition: winuser.h:2518
#define HTHSCROLL
Definition: winuser.h:2517
#define HTTRANSPARENT
Definition: winuser.h:2509
#define DefWindowProc
Definition: ros2win.h:31

◆ OnNotify()

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

Definition at line 2098 of file taskswnd.cpp.

2099 {
2100 LRESULT Ret = TRUE;
2101 const NMHDR *nmh = (const NMHDR *) lParam;
2102
2103 if (nmh->hwndFrom == m_TaskBar.m_hWnd)
2104 {
2105 Ret = HandleToolbarNotification(nmh);
2106 }
2107 return Ret;
2108 }
LRESULT HandleToolbarNotification(IN const NMHDR *nmh)
Definition: taskswnd.cpp:1889
HWND hwndFrom
Definition: winuser.h:3265

◆ OnSetFont()

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

Definition at line 2293 of file taskswnd.cpp.

2294 {
2295 return m_TaskBar.SendMessageW(uMsg, wParam, lParam);
2296 }

◆ OnSettingChanged()

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

Definition at line 2298 of file taskswnd.cpp.

2299 {
2300 if (wParam == SPI_SETNONCLIENTMETRICS)
2301 {
2302 /* Don't update the font, this will be done when we get a WM_SETFONT from our parent */
2304 }
2305
2306 return 0;
2307 }

◆ OnShellHook()

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

Definition at line 1640 of file taskswnd.cpp.

1641 {
1642 BOOL Ret = FALSE;
1643
1644 /* In case the shell hook wasn't registered properly, ignore WM_NULLs*/
1645 if (uMsg == 0)
1646 {
1647 bHandled = FALSE;
1648 return 0;
1649 }
1650
1651 TRACE("Received shell hook message: wParam=%08lx, lParam=%08lx\n", wParam, lParam);
1652
1653 switch ((INT) wParam)
1654 {
1655 case HSHELL_APPCOMMAND:
1656 Ret = HandleAppCommand(0, lParam);
1657 break;
1658
1660 AddTask((HWND) lParam);
1661 break;
1662
1664 /* The window still exists! Delay destroying it a bit */
1667 break;
1668
1670 case HSHELL_WINDOWACTIVATED:
1673 break;
1674
1675 case HSHELL_FLASH:
1677 break;
1678
1679 case HSHELL_REDRAW:
1681 break;
1682
1683 case HSHELL_TASKMAN:
1684 ::PostMessage(m_Tray->GetHWND(), TWM_OPENSTARTMENU, 0, 0);
1685 break;
1686
1688 ::SwitchToThisWindow(m_Tray->GetHWND(), TRUE);
1689 ::SetForegroundWindow(m_Tray->GetHWND());
1690 break;
1691
1692 case HSHELL_LANGUAGE:
1693 case HSHELL_SYSMENU:
1694 case HSHELL_ENDTASK:
1695 case HSHELL_ACCESSIBILITYSTATE:
1696 case HSHELL_WINDOWREPLACED:
1697 case HSHELL_WINDOWREPLACING:
1698
1699 case HSHELL_GETMINRECT:
1700 default:
1701 {
1702#if DEBUG_SHELL_HOOK
1703 int i, found;
1704 for (i = 0, found = 0; i != _countof(hshell_msg); i++)
1705 {
1706 if (hshell_msg[i].msg == (INT) wParam)
1707 {
1708 TRACE("Shell message %ws unhandled (lParam = 0x%p)!\n", hshell_msg[i].msg_name, lParam);
1709 found = 1;
1710 break;
1711 }
1712 }
1713 if (found)
1714 break;
1715#endif
1716 TRACE("Shell message %d unhandled (lParam = 0x%p)!\n", (INT) wParam, lParam);
1717 break;
1718 }
1719 }
1720
1721 return Ret;
1722 }
#define msg(x)
Definition: auth_time.c:54
#define TWM_OPENSTARTMENU
Definition: precomp.h:133
BOOL HandleAppCommand(IN WPARAM wParam, IN LPARAM lParam)
Definition: taskswnd.cpp:1621
BOOL FlashTask(IN HWND hWnd)
Definition: taskswnd.cpp:1297
BOOL RedrawTask(IN HWND hWnd)
Definition: taskswnd.cpp:1337
void OnWindowDestroyed(_In_ HWND hwndTarget)
Definition: taskswnd.cpp:2037
BOOL DeleteTask(IN HWND hWnd)
Definition: taskswnd.cpp:1260
void OnWindowActivated(_In_ HWND hwndTarget)
Definition: taskswnd.cpp:2028
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define HSHELL_RUDEAPPACTIVATED
Definition: winuser.h:1292
#define HSHELL_ACTIVATESHELLWINDOW
Definition: winuser.h:1268
#define HSHELL_WINDOWDESTROYED
Definition: winuser.h:1267
#define HSHELL_WINDOWCREATED
Definition: winuser.h:1266
#define HSHELL_FLASH
Definition: winuser.h:1291
#define PostMessage
Definition: winuser.h:5998

◆ OnSize()

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

Definition at line 2062 of file taskswnd.cpp.

2063 {
2064 SIZE szClient;
2065
2066 szClient.cx = LOWORD(lParam);
2067 szClient.cy = HIWORD(lParam);
2068 if (m_TaskBar.m_hWnd != NULL)
2069 {
2070 m_TaskBar.SetWindowPos(NULL, 0, 0, szClient.cx, szClient.cy, SWP_NOZORDER);
2071
2073 }
2074 return TRUE;
2075 }
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1288
#define SWP_NOZORDER
Definition: winuser.h:1258
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28

◆ OnTaskbarSettingsChanged()

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

Definition at line 2183 of file taskswnd.cpp.

2184 {
2185 BOOL bSettingsChanged = FALSE;
2186 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
2187
2188 if (newSettings->bGroupButtons != g_TaskbarSettings.bGroupButtons)
2189 {
2190 bSettingsChanged = TRUE;
2193 }
2194
2195 if (newSettings->bSmallIcons != g_TaskbarSettings.bSmallIcons)
2196 {
2197 bSettingsChanged = TRUE;
2199 }
2200
2201 if (bSettingsChanged)
2202 {
2203 /* Refresh each task item view */
2206 }
2207
2208 return 0;
2209 }

◆ OnThemeChanged()

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

Definition at line 1510 of file taskswnd.cpp.

1511 {
1512 TRACE("OmThemeChanged\n");
1513
1514 if (m_Theme)
1516
1517 if (IsThemeActive())
1518 m_Theme = OpenThemeData(m_hWnd, L"TaskBand");
1519 else
1520 m_Theme = NULL;
1521
1522 return TRUE;
1523 }
BOOL WINAPI IsThemeActive(void)
Definition: system.c:630
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
Definition: system.c:890

◆ OnTimer()

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

Definition at line 2262 of file taskswnd.cpp.

2263 {
2264 switch (wParam)
2265 {
2266#if DUMP_TASKS != 0
2267 case 1:
2268 DumpTasks();
2269 break;
2270#endif
2272 {
2273 // Real activation of rude app might take some time after HSHELL_...ACTIVATED.
2274 // Wait up to 5 seconds with validating the rude app at each second.
2275 HWND hwndRude = FindRudeApp(NULL);
2276 HandleFullScreenApp(hwndRude);
2277
2282 break;
2283 }
2284 default:
2285 {
2286 WARN("Unknown timer ID: %p\n", wParam);
2287 break;
2288 }
2289 }
2290 return TRUE;
2291 }
HWND FindRudeApp(_In_opt_ HWND hwndFirstCheck)
Definition: taskswnd.cpp:2002
void HandleFullScreenApp(_In_opt_ HWND hwndRude)
Definition: taskswnd.cpp:1975
#define VALIDATE_RUDE_MAX_COUNT
Definition: taskswnd.cpp:29
#define VALIDATE_RUDE_INTERVAL
Definition: taskswnd.cpp:28

◆ OnUpdateTaskbarPos()

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

Definition at line 2110 of file taskswnd.cpp.

2111 {
2112 /* Update the button spacing */
2113 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
2114 return TRUE;
2115 }

◆ OnWindowActivated()

void CTaskSwitchWnd::OnWindowActivated ( _In_ HWND  hwndTarget)
inline

Definition at line 2028 of file taskswnd.cpp.

2029 {
2030 // Re-start rude app validation
2034 }

Referenced by OnShellHook().

◆ OnWindowDestroyed()

void CTaskSwitchWnd::OnWindowDestroyed ( _In_ HWND  hwndTarget)
inline

Definition at line 2037 of file taskswnd.cpp.

2038 {
2039 if (!FindTaskItem(hwndTarget))
2040 return;
2041 HWND hwndRude = FindRudeApp(hwndTarget);
2042 HandleFullScreenApp(hwndRude);
2043 }

Referenced by OnShellHook().

◆ OnWindowPosChanged()

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

Definition at line 2017 of file taskswnd.cpp.

2018 {
2019 // Re-start rude app validation
2023 bHandled = FALSE;
2024 return 0;
2025 }

◆ OnWinMMDeviceChange()

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

Definition at line 1724 of file taskswnd.cpp.

1725 {
1726 TRACE("Audio device was added or removed, invalidating mixer\n");
1728 return TRUE;
1729 }

◆ RedrawTask()

BOOL CTaskSwitchWnd::RedrawTask ( IN HWND  hWnd)
inline

Definition at line 1337 of file taskswnd.cpp.

1338 {
1339 PTASK_ITEM TaskItem;
1340
1341 TaskItem = FindTaskItem(hWnd);
1342 if (TaskItem != NULL)
1343 {
1344 RedrawTaskItem(TaskItem);
1345 return TRUE;
1346 }
1347
1348 return FALSE;
1349 }
VOID RedrawTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1312

Referenced by OnShellHook().

◆ RedrawTaskItem()

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

Definition at line 1312 of file taskswnd.cpp.

1313 {
1314 PTASK_GROUP TaskGroup;
1315
1316 TaskGroup = TaskItem->Group;
1317 if (m_IsGroupingEnabled && TaskGroup != NULL)
1318 {
1319 if (TaskGroup->IsCollapsed && TaskGroup->Index >= 0)
1320 {
1321 UpdateTaskGroupButton(TaskGroup);
1322 }
1323 else if (TaskItem->Index >= 0)
1324 {
1325 goto UpdateTaskItem;
1326 }
1327 }
1328 else if (TaskItem->Index >= 0)
1329 {
1330 UpdateTaskItem:
1331 TaskItem->RenderFlashed = 0;
1332 UpdateTaskItemButton(TaskItem);
1333 }
1334 }

Referenced by RedrawTask().

◆ RefreshWindowList()

BOOL CTaskSwitchWnd::RefreshWindowList ( )
inline

Definition at line 1503 of file taskswnd.cpp.

1504 {
1505 TRACE("Refreshing window list...\n");
1506 /* Add all windows to the toolbar */
1507 return EnumWindows(s_EnumWindowsProc, (LPARAM)this);
1508 }
static BOOL CALLBACK s_EnumWindowsProc(IN HWND hWnd, IN LPARAM lParam)
Definition: taskswnd.cpp:1496

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

◆ RemoveIcon()

VOID CTaskSwitchWnd::RemoveIcon ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 667 of file taskswnd.cpp.

668 {
669 TBBUTTONINFO tbbi;
670 PTASK_ITEM currentTaskItem, LastItem;
671
672 if (TaskItem->IconIndex == -1)
673 return;
674
675 tbbi.cbSize = sizeof(tbbi);
676 tbbi.dwMask = TBIF_IMAGE;
677
678 currentTaskItem = m_TaskItems;
679 LastItem = currentTaskItem + m_TaskItemCount;
680 while (currentTaskItem != LastItem)
681 {
682 if (currentTaskItem->IconIndex > TaskItem->IconIndex)
683 {
684 currentTaskItem->IconIndex--;
685 tbbi.iImage = currentTaskItem->IconIndex;
686
687 m_TaskBar.SetButtonInfo(currentTaskItem->Index, &tbbi);
688 }
689 currentTaskItem++;
690 }
691
692 ImageList_Remove(m_ImageList, TaskItem->IconIndex);
693 }
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
Definition: imagelist.c:2628
#define TBIF_IMAGE
Definition: commctrl.h:1219
#define TBBUTTONINFO
Definition: commctrl.h:1254
INT IconIndex
Definition: taskswnd.cpp:176

Referenced by DeleteTaskItemButton().

◆ RemoveTaskFromTaskGroup()

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

Definition at line 916 of file taskswnd.cpp.

917 {
918 PTASK_GROUP TaskGroup, CurrentGroup, *PrevLink;
919
920 TaskGroup = TaskItem->Group;
921 if (TaskGroup != NULL)
922 {
923 DWORD dwNewTaskCount = --TaskGroup->dwTaskCount;
924 if (dwNewTaskCount == 0)
925 {
926 /* Find the previous pointer in the chain */
927 CurrentGroup = m_TaskGroups;
928 PrevLink = &m_TaskGroups;
929 while (CurrentGroup != TaskGroup)
930 {
931 PrevLink = &CurrentGroup->Next;
932 CurrentGroup = CurrentGroup->Next;
933 }
934
935 /* Remove the group from the list */
936 ASSERT(TaskGroup == CurrentGroup);
937 *PrevLink = TaskGroup->Next;
938
939 /* Free the task group */
941 0,
942 TaskGroup);
943 }
944 else if (TaskGroup->IsCollapsed &&
945 TaskGroup->Index >= 0)
946 {
947 if (dwNewTaskCount > 1)
948 {
949 /* FIXME: Check if we should expand the group */
950 /* Update the task group button */
951 UpdateTaskGroupButton(TaskGroup);
952 }
953 else
954 {
955 /* Expand the group of one task button to a task button */
956 ExpandTaskGroup(TaskGroup);
957 }
958 }
959 }
960 }
VOID ExpandTaskGroup(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:577
#define HeapFree(x, y, z)
Definition: compat.h:735

Referenced by DeleteTaskItem().

◆ s_EnumWindowsProc()

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

Definition at line 1496 of file taskswnd.cpp.

1497 {
1499
1500 return This->EnumWindowsProc(hWnd);
1501 }

Referenced by RefreshWindowList().

◆ SendAsyncProc()

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

Definition at line 1794 of file taskswnd.cpp.

1795 {
1796 ::PostMessageW(hwnd, WM_NULL, 0, 0);
1797 }
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_NULL
Definition: winuser.h:1635

Referenced by HandleTaskItemRightClick(), and OnActivateTaskIndex().

◆ UpdateButtonsSize()

VOID CTaskSwitchWnd::UpdateButtonsSize ( IN BOOL  bRedrawDisabled)
inline

Definition at line 1351 of file taskswnd.cpp.

1352 {
1353 RECT rcClient;
1354 UINT uiRows, uiMax, uiMin, uiBtnsPerLine, ui;
1355 LONG NewBtnSize;
1356 BOOL Horizontal;
1357
1358 /* Update the size of the image list if needed */
1359 int cx, cy;
1363 {
1367
1368 /* SetIconSize removes all icons so we have to reinsert them */
1369 PTASK_ITEM TaskItem = m_TaskItems;
1370 PTASK_ITEM LastTaskItem = m_TaskItems + m_TaskItemCount;
1371 while (TaskItem != LastTaskItem)
1372 {
1373 TaskItem->IconIndex = -1;
1374 UpdateTaskItemButton(TaskItem);
1375
1376 TaskItem++;
1377 }
1378 m_TaskBar.SetImageList(m_ImageList);
1379 }
1380
1381 if (GetClientRect(&rcClient) && !IsRectEmpty(&rcClient))
1382 {
1383 if (m_ButtonCount > 0)
1384 {
1385 Horizontal = m_Tray->IsHorizontal();
1386
1387 if (Horizontal)
1388 {
1389 TBMETRICS tbm = { 0 };
1390 tbm.cbSize = sizeof(tbm);
1392 m_TaskBar.GetMetrics(&tbm);
1393
1394 if (m_ButtonSize.cy + tbm.cyButtonSpacing != 0)
1395 uiRows = (rcClient.bottom + tbm.cyButtonSpacing) / (m_ButtonSize.cy + tbm.cyButtonSpacing);
1396 else
1397 uiRows = 1;
1398
1399 if (uiRows == 0)
1400 uiRows = 1;
1401
1402 uiBtnsPerLine = (m_ButtonCount + uiRows - 1) / uiRows;
1403 }
1404 else
1405 {
1406 uiBtnsPerLine = 1;
1407 uiRows = m_ButtonCount;
1408 }
1409
1410 if (!bRedrawDisabled)
1412
1413 /* We might need to update the button spacing */
1414 int cxButtonSpacing = m_TaskBar.UpdateTbButtonSpacing(
1415 Horizontal, m_Theme != NULL,
1416 uiRows, uiBtnsPerLine);
1417
1418 /* Determine the minimum and maximum width of a button */
1420 if (Horizontal)
1421 {
1423
1424 /* Calculate the ideal width and make sure it's within the allowed range */
1425 NewBtnSize = (rcClient.right - (uiBtnsPerLine * cxButtonSpacing)) / uiBtnsPerLine;
1426
1427 if (NewBtnSize < (LONG) uiMin)
1428 NewBtnSize = uiMin;
1429 if (NewBtnSize >(LONG)uiMax)
1430 NewBtnSize = uiMax;
1431
1432 /* Recalculate how many buttons actually fit into one line */
1433 uiBtnsPerLine = rcClient.right / (NewBtnSize + cxButtonSpacing);
1434 if (uiBtnsPerLine == 0)
1435 uiBtnsPerLine++;
1436 }
1437 else
1438 {
1439 NewBtnSize = uiMax = rcClient.right;
1440 }
1441
1442 m_ButtonSize.cx = NewBtnSize;
1443
1444 m_ButtonsPerLine = uiBtnsPerLine;
1445
1446 for (ui = 0; ui != m_ButtonCount; ui++)
1447 {
1448 TBBUTTONINFOW tbbi = { 0 };
1449 tbbi.cbSize = sizeof(tbbi);
1451 tbbi.cx = (INT) NewBtnSize;
1452 tbbi.fsState = TBSTATE_ENABLED;
1453
1454 /* Check if we're updating a button that is the last one in the
1455 line. If so, we need to set the TBSTATE_WRAP flag! */
1456 if (Horizontal)
1457 {
1458 if ((ui + 1) % uiBtnsPerLine == 0)
1459 tbbi.fsState |= TBSTATE_WRAP;
1460 }
1461 else
1462 {
1463 tbbi.fsState |= TBSTATE_WRAP;
1464 }
1465
1466 if (m_ActiveTaskItem != NULL &&
1468 {
1469 tbbi.fsState |= TBSTATE_CHECKED;
1470 }
1471
1472 m_TaskBar.SetButtonInfo(ui, &tbbi);
1473 }
1474 }
1475 else
1476 {
1477 m_ButtonsPerLine = 0;
1478 m_ButtonSize.cx = 0;
1479 }
1480 }
1481
1482 // FIXME: This seems to be enabling redraws prematurely, but moving it to its right place doesn't work!
1484 }
BOOL WINAPI ImageList_SetIconSize(HIMAGELIST himl, INT cx, INT cy)
Definition: imagelist.c:3132
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
Definition: imagelist.c:2055
UINT ui
Definition: oleauto.h:49
long LONG
Definition: pedump.c:60
#define INT
Definition: polytest.cpp:20
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TBIF_SIZE
Definition: commctrl.h:1225
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TBMF_BUTTONSPACING
Definition: commctrl.h:1289
#define TBIF_BYINDEX
Definition: commctrl.h:1226
#define TBSTATE_WRAP
Definition: commctrl.h:977
#define TBSTATE_CHECKED
Definition: commctrl.h:972
#define TBIF_STATE
Definition: commctrl.h:1221
#define SM_CXMINIMIZED
Definition: winuser.h:1031
#define SM_CXEDGE
Definition: winuser.h:1019
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define SM_CXSIZE
Definition: winuser.h:1002
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
DWORD dwMask
Definition: commctrl.h:1243
int cyButtonSpacing
Definition: commctrl.h:1299
DWORD dwMask
Definition: commctrl.h:1293
UINT cbSize
Definition: commctrl.h:1292

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

◆ UpdateIndexesAfter()

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

Definition at line 505 of file taskswnd.cpp.

506 {
507 PTASK_GROUP CurrentGroup;
508 PTASK_ITEM CurrentTaskItem, LastTaskItem;
509 INT NewIndex;
510
511 int offset = bInserted ? +1 : -1;
512
514 {
515 /* Update all affected groups */
516 CurrentGroup = m_TaskGroups;
517 while (CurrentGroup != NULL)
518 {
519 if (CurrentGroup->IsCollapsed &&
520 CurrentGroup->Index >= iIndex)
521 {
522 /* Update the toolbar buttons */
523 NewIndex = CurrentGroup->Index + offset;
524 if (m_TaskBar.SetButtonCommandId(CurrentGroup->Index + offset, NewIndex))
525 {
526 CurrentGroup->Index = NewIndex;
527 }
528 else
529 CurrentGroup->Index = -1;
530 }
531
532 CurrentGroup = CurrentGroup->Next;
533 }
534 }
535
536 /* Update all affected task items */
537 CurrentTaskItem = m_TaskItems;
538 LastTaskItem = CurrentTaskItem + m_TaskItemCount;
539 while (CurrentTaskItem != LastTaskItem)
540 {
541 CurrentGroup = CurrentTaskItem->Group;
542 if (CurrentGroup != NULL)
543 {
544 if (!CurrentGroup->IsCollapsed &&
545 CurrentTaskItem->Index >= iIndex)
546 {
547 goto UpdateTaskItemBtn;
548 }
549 }
550 else if (CurrentTaskItem->Index >= iIndex)
551 {
552 UpdateTaskItemBtn:
553 /* Update the toolbar buttons */
554 NewIndex = CurrentTaskItem->Index + offset;
555 if (m_TaskBar.SetButtonCommandId(CurrentTaskItem->Index + offset, NewIndex))
556 {
557 CurrentTaskItem->Index = NewIndex;
558 }
559 else
560 CurrentTaskItem->Index = -1;
561 }
562
563 CurrentTaskItem++;
564 }
565 }
BOOL SetButtonCommandId(IN INT iButtonIndex, IN INT iCommandId)
Definition: taskswnd.cpp:337
GLintptr offset
Definition: glext.h:5920

Referenced by AddTaskItemButton(), and DeleteTaskItemButton().

◆ UpdateTaskGroupButton()

INT CTaskSwitchWnd::UpdateTaskGroupButton ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 568 of file taskswnd.cpp.

569 {
570 ASSERT(TaskGroup->Index >= 0);
571
572 /* FIXME: Implement */
573
574 return TaskGroup->Index;
575 }

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

◆ UpdateTaskItemButton()

INT CTaskSwitchWnd::UpdateTaskItemButton ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 621 of file taskswnd.cpp.

622 {
623 TBBUTTONINFO tbbi = { 0 };
624 HICON icon;
625 WCHAR windowText[255];
626
627 ASSERT(TaskItem->Index >= 0);
628
629 tbbi.cbSize = sizeof(tbbi);
630 tbbi.dwMask = TBIF_BYINDEX | TBIF_STATE | TBIF_TEXT | TBIF_IMAGE;
631 tbbi.fsState = TBSTATE_ENABLED;
632 if (m_ActiveTaskItem == TaskItem)
633 tbbi.fsState |= TBSTATE_CHECKED;
634
635 if (TaskItem->RenderFlashed)
636 tbbi.fsState |= TBSTATE_MARKED;
637
638 /* Check if we're updating a button that is the last one in the
639 line. If so, we need to set the TBSTATE_WRAP flag! */
640 if (!m_Tray->IsHorizontal() || (m_ButtonsPerLine != 0 &&
641 (TaskItem->Index + 1) % m_ButtonsPerLine == 0))
642 {
643 tbbi.fsState |= TBSTATE_WRAP;
644 }
645
647 {
648 tbbi.pszText = windowText;
649 }
650
651 icon = GetWndIcon(TaskItem->hWnd);
652 if (!icon)
653 icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
654 TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, TaskItem->IconIndex, icon);
655 tbbi.iImage = TaskItem->IconIndex;
656
657 if (!m_TaskBar.SetButtonInfo(TaskItem->Index, &tbbi))
658 {
659 TaskItem->Index = -1;
660 return -1;
661 }
662
663 TRACE("Updated button %d for hwnd 0x%p\n", TaskItem->Index, TaskItem->hWnd);
664 return TaskItem->Index;
665 }
#define TBIF_TEXT
Definition: commctrl.h:1220
#define TBSTATE_MARKED
Definition: commctrl.h:979

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

Member Data Documentation

◆ m_ActiveTaskItem

◆ m_AllocatedTaskItems

WORD CTaskSwitchWnd::m_AllocatedTaskItems
private

Definition at line 400 of file taskswnd.cpp.

Referenced by AllocTaskItem().

◆ m_ButtonCount

WORD CTaskSwitchWnd::m_ButtonCount
private

◆ m_ButtonSize

SIZE CTaskSwitchWnd::m_ButtonSize
private

Definition at line 417 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and UpdateButtonsSize().

◆ m_ButtonsPerLine

UINT CTaskSwitchWnd::m_ButtonsPerLine
private

Definition at line 407 of file taskswnd.cpp.

Referenced by UpdateButtonsSize(), and UpdateTaskItemButton().

◆ m_HardErrorThread

CHardErrorThread CTaskSwitchWnd::m_HardErrorThread
private

Definition at line 420 of file taskswnd.cpp.

Referenced by OnCopyData().

◆ m_ImageList

HIMAGELIST CTaskSwitchWnd::m_ImageList
private

◆ m_IsDestroying

BOOL CTaskSwitchWnd::m_IsDestroying
private

Definition at line 413 of file taskswnd.cpp.

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

◆ m_IsGroupingEnabled

◆ m_Mixer

CMultimediaBackend CTaskSwitchWnd::m_Mixer
private

Definition at line 421 of file taskswnd.cpp.

Referenced by HandleAppCommand(), OnCreate(), and OnWinMMDeviceChange().

◆ m_nRudeAppValidationCounter

INT CTaskSwitchWnd::m_nRudeAppValidationCounter
private

Definition at line 415 of file taskswnd.cpp.

Referenced by OnTimer(), OnWindowActivated(), and OnWindowPosChanged().

◆ m_ShellHookMsg

UINT CTaskSwitchWnd::m_ShellHookMsg
private

Definition at line 396 of file taskswnd.cpp.

Referenced by OnCreate().

◆ m_TaskBar

◆ m_TaskGroups

PTASK_GROUP CTaskSwitchWnd::m_TaskGroups
private

◆ m_TaskItemCount

◆ m_TaskItems

◆ m_Theme

HTHEME CTaskSwitchWnd::m_Theme
private

◆ m_Tray

◆ m_uHardErrorMsg

UINT CTaskSwitchWnd::m_uHardErrorMsg
private

Definition at line 419 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and OnCopyData().

◆ m_WinMMDevChgMsg

UINT CTaskSwitchWnd::m_WinMMDevChgMsg
private

Definition at line 397 of file taskswnd.cpp.

Referenced by OnCreate().


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