ReactOS 0.4.17-dev-806-gffa4164
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::tagRUDEAPPDATAPRUDEAPPDATA
 
typedef struct CTaskSwitchWnd::tagFULLSCREENDATA FULLSCREENDATA
 
typedef struct CTaskSwitchWnd::tagFULLSCREENDATAPFULLSCREENDATA
 
- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 

Public 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 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_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CTaskSwitchWnd, CWindow, CControlWinTraits >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Private Attributes

CTaskToolbar m_TaskBar
 
CComPtr< ITrayWindow > m_Tray
 
UINT m_ShellHookMsg
 
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_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 368 of file taskswnd.cpp.

Member Typedef Documentation

◆ FULLSCREENDATA

◆ PFULLSCREENDATA

◆ PRUDEAPPDATA

◆ RUDEAPPDATA

Constructor & Destructor Documentation

◆ CTaskSwitchWnd()

CTaskSwitchWnd::CTaskSwitchWnd ( )
inline

Definition at line 406 of file taskswnd.cpp.

406 :
414 m_Theme(NULL),
416 m_ButtonCount(0),
421 {
424 }
UINT m_ShellHookMsg
Definition: taskswnd.cpp:378
PTASK_ITEM m_ActiveTaskItem
Definition: taskswnd.cpp:386
PTASK_ITEM m_TaskItems
Definition: taskswnd.cpp:385
INT m_nRudeAppValidationCounter
Definition: taskswnd.cpp:397
UINT m_uHardErrorMsg
Definition: taskswnd.cpp:401
BOOL m_IsDestroying
Definition: taskswnd.cpp:395
WORD m_ButtonCount
Definition: taskswnd.cpp:390
HTHEME m_Theme
Definition: taskswnd.cpp:388
UINT m_WinMMDevChgMsg
Definition: taskswnd.cpp:379
PTASK_GROUP m_TaskGroups
Definition: taskswnd.cpp:384
BOOL m_IsGroupingEnabled
Definition: taskswnd.cpp:394
WORD m_AllocatedTaskItems
Definition: taskswnd.cpp:382
HIMAGELIST m_ImageList
Definition: taskswnd.cpp:392
WORD m_TaskItemCount
Definition: taskswnd.cpp:381
UINT m_ButtonsPerLine
Definition: taskswnd.cpp:389
#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 425 of file taskswnd.cpp.

425{ }

Member Function Documentation

◆ ActivateTask()

BOOL CTaskSwitchWnd::ActivateTask ( IN HWND  hWnd)
inline

Definition at line 1218 of file taskswnd.cpp.

1219 {
1220 PTASK_ITEM TaskItem;
1221
1222 if (!hWnd)
1223 {
1224 return ActivateTaskItem(NULL);
1225 }
1226
1227 TaskItem = FindTaskItem(hWnd);
1228 if (TaskItem == NULL)
1229 {
1230 TaskItem = FindOtherTaskItem(hWnd);
1231 }
1232
1233 if (TaskItem == NULL)
1234 {
1235 WARN("Activate window 0x%p, could not find task\n", hWnd);
1237 }
1238
1239 return ActivateTaskItem(TaskItem);
1240 }
HWND hWnd
Definition: settings.c:17
#define WARN(fmt,...)
Definition: precomp.h:61
PTASK_ITEM FindOtherTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:961
BOOL ActivateTaskItem(IN OUT PTASK_ITEM TaskItem OPTIONAL)
Definition: taskswnd.cpp:1207
BOOL RefreshWindowList()
Definition: taskswnd.cpp:1485
PTASK_ITEM FindTaskItem(IN HWND hWnd)
Definition: taskswnd.cpp:944

Referenced by HandleTaskItemRightClick(), and OnShellHook().

◆ ActivateTaskItem()

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

Definition at line 1207 of file taskswnd.cpp.

1208 {
1209 if (TaskItem != NULL)
1210 {
1211 TRACE("Activate window 0x%p on button %d\n", TaskItem->hWnd, TaskItem->Index);
1212 }
1213
1214 CheckActivateTaskItem(TaskItem);
1215 return FALSE;
1216 }
VOID CheckActivateTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1087
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by ActivateTask().

◆ AddTask()

BOOL CTaskSwitchWnd::AddTask ( IN HWND  hWnd)
inline

Definition at line 1178 of file taskswnd.cpp.

1179 {
1180 PTASK_ITEM TaskItem;
1181
1182 if (!::IsWindow(hWnd) || m_Tray->IsSpecialHWND(hWnd))
1183 return FALSE;
1184
1185 TaskItem = FindTaskItem(hWnd);
1186 if (TaskItem == NULL)
1187 {
1188 TRACE("Add window 0x%p\n", hWnd);
1189 TaskItem = AllocTaskItem();
1190 if (TaskItem != NULL)
1191 {
1192 ZeroMemory(TaskItem, sizeof(*TaskItem));
1193 TaskItem->hWnd = hWnd;
1194 TaskItem->Index = -1;
1195 TaskItem->Group = AddToTaskGroup(hWnd);
1196
1197 if (!m_IsDestroying)
1198 {
1199 AddTaskItemButton(TaskItem);
1200 }
1201 }
1202 }
1203
1204 return TaskItem != NULL;
1205 }
BOOL IsWindow() const
Definition: atlwin.h:947
PTASK_GROUP AddToTaskGroup(IN HWND hWnd)
Definition: taskswnd.cpp:854
CComPtr< ITrayWindow > m_Tray
Definition: taskswnd.cpp:376
PTASK_ITEM AllocTaskItem()
Definition: taskswnd.cpp:1002
INT AddTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:759
PTASK_GROUP Group
Definition: taskswnd.cpp:156

Referenced by EnumWindowsProc(), and OnShellHook().

◆ AddTaskItemButton()

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

Definition at line 759 of file taskswnd.cpp.

760 {
761 WCHAR windowText[255];
762 TBBUTTON tbBtn = { 0 };
763 INT iIndex;
764 HICON icon;
765
766 if (TaskItem->Index >= 0)
767 {
768 return UpdateTaskItemButton(TaskItem);
769 }
770
771 if (TaskItem->Group != NULL &&
772 TaskItem->Group->IsCollapsed)
773 {
774 /* The task group is collapsed, we only need to update the group button */
775 return UpdateTaskGroupButton(TaskItem->Group);
776 }
777
778 icon = GetWndIcon(TaskItem->hWnd);
779 if (!icon)
780 icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
781 TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, -1, icon);
782
783 tbBtn.iBitmap = TaskItem->IconIndex;
786 tbBtn.dwData = TaskItem->Index;
787
789 {
790 tbBtn.iString = (DWORD_PTR) windowText;
791 }
792
793 /* Find out where to insert the new button */
794 iIndex = CalculateTaskItemNewButtonIndex(TaskItem);
795 ASSERT(iIndex >= 0);
796 tbBtn.idCommand = iIndex;
797
799
800 if (m_TaskBar.InsertButton(iIndex, &tbBtn))
801 {
802 UpdateIndexesAfter(iIndex, TRUE);
803
804 TRACE("Added button %d for hwnd 0x%p\n", iIndex, TaskItem->hWnd);
805
806 TaskItem->Index = iIndex;
808
809 /* Update button sizes and fix the button wrapping */
811 return iIndex;
812 }
813
815
816 return -1;
817 }
WCHAR windowText[1024]
Definition: appswitch.c:48
INT UpdateTaskItemButton(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:603
INT GetWndTextFromTaskItem(IN PTASK_ITEM TaskItem, LPWSTR szBuf, DWORD cchBuf)
Definition: taskswnd.cpp:427
VOID UpdateButtonsSize(IN BOOL bRedrawDisabled)
Definition: taskswnd.cpp:1333
CTaskToolbar m_TaskBar
Definition: taskswnd.cpp:374
VOID UpdateIndexesAfter(IN INT iIndex, BOOL bInserted)
Definition: taskswnd.cpp:487
INT UpdateTaskGroupButton(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:550
HICON GetWndIcon(HWND hwnd)
Definition: taskswnd.cpp:568
INT CalculateTaskItemNewButtonIndex(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:715
VOID BeginUpdate()
Definition: taskswnd.cpp:308
VOID EndUpdate()
Definition: taskswnd.cpp:313
#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 _countof(array)
Definition: sndvol32.h:70
BYTE fsState
Definition: commctrl.h:951
INT_PTR iString
Definition: commctrl.h:959
int idCommand
Definition: commctrl.h:950
DWORD_PTR dwData
Definition: commctrl.h:958
int iBitmap
Definition: commctrl.h:949
BYTE fsStyle
Definition: commctrl.h:952
#define DWORD_PTR
Definition: treelist.c:76
int32_t INT
Definition: typedefs.h:58
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2572
#define LR_SHARED
Definition: winuser.h:1111
#define LR_DEFAULTSIZE
Definition: winuser.h:1105
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by AddTask().

◆ AddToTaskGroup()

PTASK_GROUP CTaskSwitchWnd::AddToTaskGroup ( IN HWND  hWnd)
inline

Definition at line 854 of file taskswnd.cpp.

855 {
857 PTASK_GROUP TaskGroup, *PrevLink;
858
860 &dwProcessId))
861 {
862 TRACE("Cannot get process id of hwnd 0x%p\n", hWnd);
863 return NULL;
864 }
865
866 /* Try to find an existing task group */
867 TaskGroup = m_TaskGroups;
868 PrevLink = &m_TaskGroups;
869 while (TaskGroup != NULL)
870 {
871 if (TaskGroup->dwProcessId == dwProcessId)
872 {
873 TaskGroup->dwTaskCount++;
874 return TaskGroup;
875 }
876
877 PrevLink = &TaskGroup->Next;
878 TaskGroup = TaskGroup->Next;
879 }
880
881 /* Allocate a new task group */
882 TaskGroup = (PTASK_GROUP) HeapAlloc(hProcessHeap,
884 sizeof(*TaskGroup));
885 if (TaskGroup != NULL)
886 {
887 TaskGroup->dwTaskCount = 1;
888 TaskGroup->dwProcessId = dwProcessId;
889 TaskGroup->Index = -1;
890
891 /* Add the task group to the list */
892 *PrevLink = TaskGroup;
893 }
894
895 return TaskGroup;
896 }
#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:137
DWORD dwTaskCount
Definition: taskswnd.cpp:139
DWORD dwProcessId
Definition: taskswnd.cpp:140
struct _TASK_GROUP * PTASK_GROUP
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)

Referenced by AddTask().

◆ AllocTaskItem()

PTASK_ITEM CTaskSwitchWnd::AllocTaskItem ( )
inline

Definition at line 1002 of file taskswnd.cpp.

1003 {
1005 {
1006 /* We need the most significant bit in 16 bit command IDs to indicate whether it
1007 is a task group or task item. WM_COMMAND limits command IDs to 16 bits! */
1008 return NULL;
1009 }
1010
1012
1013 if (m_TaskItemCount == 0)
1014 {
1016 0,
1018 if (m_TaskItems != NULL)
1019 {
1021 }
1022 else
1023 return NULL;
1024 }
1026 {
1027 PTASK_ITEM NewArray;
1028 SIZE_T NewArrayLength, ActiveTaskItemIndex;
1029
1031
1032 NewArray = (PTASK_ITEM) HeapReAlloc(hProcessHeap,
1033 0,
1035 NewArrayLength * sizeof(*m_TaskItems));
1036 if (NewArray != NULL)
1037 {
1038 if (m_ActiveTaskItem != NULL)
1039 {
1040 /* Fixup the ActiveTaskItem pointer */
1041 ActiveTaskItemIndex = m_ActiveTaskItem - m_TaskItems;
1042 m_ActiveTaskItem = NewArray + ActiveTaskItemIndex;
1043 }
1044 m_AllocatedTaskItems = (WORD) NewArrayLength;
1045 m_TaskItems = NewArray;
1046 }
1047 else
1048 return NULL;
1049 }
1050
1051 return m_TaskItems + m_TaskItemCount++;
1052 }
#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:21
#define MAX_TASKS_COUNT
Definition: taskswnd.cpp:20
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by AddTask().

◆ CalculateTaskItemNewButtonIndex()

INT CTaskSwitchWnd::CalculateTaskItemNewButtonIndex ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 715 of file taskswnd.cpp.

716 {
717 PTASK_GROUP TaskGroup;
718 PTASK_ITEM LastTaskItem;
719
720 /* NOTE: This routine assumes that the group is *not* collapsed! */
721
722 TaskGroup = TaskItem->Group;
724 {
725 if (TaskGroup != NULL)
726 {
727 ASSERT(TaskGroup->Index < 0);
728 ASSERT(!TaskGroup->IsCollapsed);
729
730 if (TaskGroup->dwTaskCount > 1)
731 {
732 LastTaskItem = FindLastTaskItemOfGroup(TaskGroup, TaskItem);
733 if (LastTaskItem != NULL)
734 {
735 /* Since the group is expanded the task items must have an index */
736 ASSERT(LastTaskItem->Index >= 0);
737
738 return LastTaskItem->Index + 1;
739 }
740 }
741 }
742 else
743 {
744 /* Find the last NULL group button. NULL groups are added at the end of the
745 task item list when grouping is enabled */
746 LastTaskItem = FindLastTaskItemOfGroup(NULL, TaskItem);
747 if (LastTaskItem != NULL)
748 {
749 ASSERT(LastTaskItem->Index >= 0);
750
751 return LastTaskItem->Index + 1;
752 }
753 }
754 }
755
756 return m_ButtonCount;
757 }
PTASK_ITEM FindLastTaskItemOfGroup(IN PTASK_GROUP TaskGroup OPTIONAL, IN PTASK_ITEM NewTaskItem OPTIONAL)
Definition: taskswnd.cpp:677
DWORD IsCollapsed
Definition: taskswnd.cpp:148

Referenced by AddTaskItemButton().

◆ CheckActivateTaskItem()

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

Definition at line 1087 of file taskswnd.cpp.

1088 {
1089 PTASK_ITEM CurrentTaskItem;
1090 PTASK_GROUP TaskGroup = NULL;
1091
1092 CurrentTaskItem = m_ActiveTaskItem;
1093
1094 if (TaskItem != NULL)
1095 TaskGroup = TaskItem->Group;
1096
1097 if (m_IsGroupingEnabled &&
1098 TaskGroup != NULL &&
1099 TaskGroup->IsCollapsed)
1100 {
1101 /* FIXME */
1102 return;
1103 }
1104
1105 if (CurrentTaskItem != NULL)
1106 {
1107 PTASK_GROUP CurrentTaskGroup;
1108
1109 if (CurrentTaskItem == TaskItem)
1110 return;
1111
1112 CurrentTaskGroup = CurrentTaskItem->Group;
1113
1114 if (m_IsGroupingEnabled &&
1115 CurrentTaskGroup != NULL &&
1116 CurrentTaskGroup->IsCollapsed)
1117 {
1118 if (CurrentTaskGroup == TaskGroup)
1119 return;
1120
1121 /* FIXME */
1122 }
1123 else
1124 {
1126 if (CurrentTaskItem->Index >= 0)
1127 {
1128 UpdateTaskItemButton(CurrentTaskItem);
1129 }
1130 }
1131 }
1132
1133 m_ActiveTaskItem = TaskItem;
1134
1135 if (TaskItem != NULL && TaskItem->Index >= 0)
1136 {
1137 UpdateTaskItemButton(TaskItem);
1138 }
1139 else if (TaskItem == NULL)
1140 {
1141 TRACE("Active TaskItem now NULL\n");
1142 }
1143 }

Referenced by ActivateTaskItem().

◆ ContextSensitiveHelp()

STDMETHODIMP CTaskSwitchWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inlineoverride

Implements IOleWindow.

Definition at line 2263 of file taskswnd.cpp.

2264 {
2265 return E_NOTIMPL;
2266 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DeleteAllTasks()

VOID CTaskSwitchWnd::DeleteAllTasks ( )
inline

Definition at line 1259 of file taskswnd.cpp.

1260 {
1261 PTASK_ITEM CurrentTask;
1262
1263 if (m_TaskItemCount > 0)
1264 {
1265 CurrentTask = m_TaskItems + m_TaskItemCount;
1266 do
1267 {
1268 DeleteTaskItem(--CurrentTask);
1269 } while (CurrentTask != m_TaskItems);
1270 }
1271 }
VOID DeleteTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1072

Referenced by OnDestroy().

◆ DeleteTask()

BOOL CTaskSwitchWnd::DeleteTask ( IN HWND  hWnd)
inline

Definition at line 1242 of file taskswnd.cpp.

1243 {
1244 PTASK_ITEM TaskItem;
1245
1246 TaskItem = FindTaskItem(hWnd);
1247 if (TaskItem != NULL)
1248 {
1249 TRACE("Delete window 0x%p on button %d\n", hWnd, TaskItem->Index);
1250 DeleteTaskItem(TaskItem);
1251 return TRUE;
1252 }
1253 //else
1254 //TRACE("Failed to delete window 0x%p\n", hWnd);
1255
1256 return FALSE;
1257 }

Referenced by OnShellHook().

◆ DeleteTaskItem()

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

Definition at line 1072 of file taskswnd.cpp.

1073 {
1074 if (!m_IsDestroying)
1075 {
1076 /* Delete the task button from the toolbar */
1077 DeleteTaskItemButton(TaskItem);
1078 }
1079
1080 /* Remove the task from it's group */
1081 RemoveTaskFromTaskGroup(TaskItem);
1082
1083 /* Free the task item */
1084 FreeTaskItem(TaskItem);
1085 }
VOID FreeTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1054
VOID RemoveTaskFromTaskGroup(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:898
BOOL DeleteTaskItemButton(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:819

Referenced by DeleteAllTasks(), and DeleteTask().

◆ DeleteTaskItemButton()

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

Definition at line 819 of file taskswnd.cpp.

820 {
821 PTASK_GROUP TaskGroup;
822 INT iIndex;
823
824 TaskGroup = TaskItem->Group;
825
826 if (TaskItem->Index >= 0)
827 {
828 if ((TaskGroup != NULL && !TaskGroup->IsCollapsed) ||
829 TaskGroup == NULL)
830 {
832
833 RemoveIcon(TaskItem);
834 iIndex = TaskItem->Index;
835 if (m_TaskBar.DeleteButton(iIndex))
836 {
837 TaskItem->Index = -1;
839
840 UpdateIndexesAfter(iIndex, FALSE);
841
842 /* Update button sizes and fix the button wrapping */
844 return TRUE;
845 }
846
848 }
849 }
850
851 return FALSE;
852 }
VOID RemoveIcon(IN PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:649

Referenced by DeleteTaskItem().

◆ EnumWindowsProc()

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

Definition at line 1468 of file taskswnd.cpp.

1469 {
1470 if (m_Tray->IsTaskWnd(hWnd))
1471 {
1472 TRACE("Adding task for %p...\n", hWnd);
1473 AddTask(hWnd);
1474 }
1475 return TRUE;
1476 }
BOOL AddTask(IN HWND hWnd)
Definition: taskswnd.cpp:1178

◆ ExpandTaskGroup()

VOID CTaskSwitchWnd::ExpandTaskGroup ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 559 of file taskswnd.cpp.

560 {
561 ASSERT(TaskGroup->dwTaskCount > 0);
562 ASSERT(TaskGroup->IsCollapsed);
563 ASSERT(TaskGroup->Index >= 0);
564
565 /* FIXME: Implement */
566 }

Referenced by RemoveTaskFromTaskGroup().

◆ FindLastTaskItemOfGroup()

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

Definition at line 677 of file taskswnd.cpp.

680 {
681 PTASK_ITEM TaskItem, LastTaskItem, FoundTaskItem = NULL;
682 DWORD dwTaskCount;
683
685
686 TaskItem = m_TaskItems;
687 LastTaskItem = TaskItem + m_TaskItemCount;
688
689 dwTaskCount = (TaskGroup != NULL ? TaskGroup->dwTaskCount : MAX_TASKS_COUNT);
690
691 ASSERT(dwTaskCount > 0);
692
693 while (TaskItem != LastTaskItem)
694 {
695 if (TaskItem->Group == TaskGroup)
696 {
697 if ((NewTaskItem != NULL && TaskItem != NewTaskItem) || NewTaskItem == NULL)
698 {
699 FoundTaskItem = TaskItem;
700 }
701
702 if (--dwTaskCount == 0)
703 {
704 /* We found the last task item in the group! */
705 break;
706 }
707 }
708
709 TaskItem++;
710 }
711
712 return FoundTaskItem;
713 }

Referenced by CalculateTaskItemNewButtonIndex().

◆ FindOtherTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindOtherTaskItem ( IN HWND  hWnd)
inline

Definition at line 961 of file taskswnd.cpp.

962 {
963 PTASK_ITEM LastItem, TaskItem;
964 PTASK_GROUP TaskGroup;
966
968 {
969 return NULL;
970 }
971
972 /* Try to find another task that belongs to the same
973 process as the given window */
974 TaskItem = m_TaskItems;
975 LastItem = TaskItem + m_TaskItemCount;
976 while (TaskItem != LastItem)
977 {
978 TaskGroup = TaskItem->Group;
979 if (TaskGroup != NULL)
980 {
981 if (TaskGroup->dwProcessId == dwProcessId)
982 return TaskItem;
983 }
984 else
985 {
986 DWORD dwProcessIdTask;
987
988 if (GetWindowThreadProcessId(TaskItem->hWnd,
989 &dwProcessIdTask) &&
990 dwProcessIdTask == dwProcessId)
991 {
992 return TaskItem;
993 }
994 }
995
996 TaskItem++;
997 }
998
999 return NULL;
1000 }

Referenced by ActivateTask().

◆ FindRudeApp()

HWND CTaskSwitchWnd::FindRudeApp ( _In_opt_ HWND  hwndFirstCheck)
inline

Definition at line 1984 of file taskswnd.cpp.

1985 {
1986 // Quick check
1987 HMONITOR hMon = MonitorFromWindow(hwndFirstCheck, MONITOR_DEFAULTTONEAREST);
1988 RUDEAPPDATA data = { hMon, NULL, hwndFirstCheck };
1989 if (::IsWindow(hwndFirstCheck) && !IsRudeEnumProc(hwndFirstCheck, (LPARAM)&data))
1990 return hwndFirstCheck;
1991
1992 // Slow check
1994
1995 return data.hwndFound;
1996 }
static BOOL CALLBACK IsRudeEnumProc(_In_ HWND hwnd, _In_ LPARAM lParam)
Definition: taskswnd.cpp:1913
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 1162 of file taskswnd.cpp.

1163 {
1164 PTASK_GROUP CurrentGroup;
1165
1166 CurrentGroup = m_TaskGroups;
1167 while (CurrentGroup != NULL)
1168 {
1169 if (CurrentGroup->Index == Index)
1170 break;
1171
1172 CurrentGroup = CurrentGroup->Next;
1173 }
1174
1175 return CurrentGroup;
1176 }
_In_ WDFCOLLECTION _In_ ULONG Index

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

◆ FindTaskItem()

PTASK_ITEM CTaskSwitchWnd::FindTaskItem ( IN HWND  hWnd)
inline

Definition at line 944 of file taskswnd.cpp.

945 {
946 PTASK_ITEM TaskItem, LastItem;
947
948 TaskItem = m_TaskItems;
949 LastItem = TaskItem + m_TaskItemCount;
950 while (TaskItem != LastItem)
951 {
952 if (TaskItem->hWnd == hWnd)
953 return TaskItem;
954
955 TaskItem++;
956 }
957
958 return NULL;
959 }

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

◆ FindTaskItemByIndex()

PTASK_ITEM CTaskSwitchWnd::FindTaskItemByIndex ( IN INT  Index)
inline

Definition at line 1145 of file taskswnd.cpp.

1146 {
1147 PTASK_ITEM TaskItem, LastItem;
1148
1149 TaskItem = m_TaskItems;
1150 LastItem = TaskItem + m_TaskItemCount;
1151 while (TaskItem != LastItem)
1152 {
1153 if (TaskItem->Index == Index)
1154 return TaskItem;
1155
1156 TaskItem++;
1157 }
1158
1159 return NULL;
1160 }

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

◆ FlashTask()

BOOL CTaskSwitchWnd::FlashTask ( IN HWND  hWnd)
inline

Definition at line 1279 of file taskswnd.cpp.

1280 {
1281 PTASK_ITEM TaskItem;
1282
1283 TaskItem = FindTaskItem(hWnd);
1284 if (TaskItem != NULL)
1285 {
1286 TRACE("Flashing window 0x%p on button %d\n", hWnd, TaskItem->Index);
1287 FlashTaskItem(TaskItem);
1288 return TRUE;
1289 }
1290
1291 return FALSE;
1292 }
VOID FlashTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1273

Referenced by OnShellHook().

◆ FlashTaskItem()

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

Definition at line 1273 of file taskswnd.cpp.

1274 {
1275 TaskItem->RenderFlashed = 1;
1276 UpdateTaskItemButton(TaskItem);
1277 }

Referenced by FlashTask().

◆ FreeTaskItem()

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

Definition at line 1054 of file taskswnd.cpp.

1055 {
1056 WORD wIndex;
1057
1058 if (TaskItem == m_ActiveTaskItem)
1060
1061 wIndex = (WORD) (TaskItem - m_TaskItems);
1062 if (wIndex + 1 < m_TaskItemCount)
1063 {
1064 MoveMemory(TaskItem,
1065 TaskItem + 1,
1066 (m_TaskItemCount - wIndex - 1) * sizeof(*TaskItem));
1067 }
1068
1070 }
#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 1939 of file taskswnd.cpp.

1940 {
1942
1943 BOOL bFullOpening = (pData->hTargetMonitor == hMonitor);
1944 if (!bFullOpening && pData->pRect)
1945 {
1946 RECT rc, rcMon;
1947 SHELL_GetMonitorRect(hMonitor, &rcMon, FALSE);
1948 ::IntersectRect(&rc, &rcMon, pData->pRect);
1949 bFullOpening = ::EqualRect(&rc, &rcMon);
1950 }
1951
1952 // Notify ABN_FULLSCREENAPP to appbars
1953 pData->pTray->NotifyFullScreenToAppBars(hMonitor, bFullOpening);
1954 return TRUE;
1955 }
struct CTaskSwitchWnd::tagFULLSCREENDATA * PFULLSCREENDATA
LPARAM lParam
Definition: combotst.c:139
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL SHELL_GetMonitorRect(_In_opt_ HMONITOR hMonitor, _Out_opt_ PRECT prcDest, _In_ BOOL bWorkAreaOnly)
Definition: taskswnd.cpp:31
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)

Referenced by HandleFullScreenApp().

◆ GetWindow()

STDMETHODIMP CTaskSwitchWnd::GetWindow ( HWND phwnd)
inlineoverride

Implements IOleWindow.

Definition at line 2254 of file taskswnd.cpp.

2255 {
2256 if (!phwnd)
2257 return E_INVALIDARG;
2258 *phwnd = m_hWnd;
2259 return S_OK;
2260 }
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 568 of file taskswnd.cpp.

569 {
570 HICON hIcon = NULL;
571
572 /* Retrieve icon by sending a message */
573#define GET_ICON(type) \
574 SendMessageTimeout(hwnd, WM_GETICON, (type), 0, SMTO_NOTIMEOUTIFNOTHUNG, 100, (PDWORD_PTR)&hIcon)
575
576 LRESULT bAlive = GET_ICON(g_TaskbarSettings.bSmallIcons ? ICON_SMALL2 : ICON_BIG);
577 if (hIcon)
578 return hIcon;
579
580 if (bAlive)
581 {
582 bAlive = GET_ICON(ICON_SMALL);
583 if (hIcon)
584 return hIcon;
585 }
586
587 if (bAlive)
588 {
590 if (hIcon)
591 return hIcon;
592 }
593#undef GET_ICON
594
595 /* If we failed, retrieve icon from the window class */
597 if (hIcon)
598 return hIcon;
599
601 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
LONG_PTR LRESULT
Definition: minwindef.h:176
HICON hIcon
Definition: msconfig.c:44
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
#define GCLP_HICONSM
Definition: winuser.h:683
#define GCLP_HICON
Definition: winuser.h:682
#define GetClassLongPtr
Definition: winuser.h:5948

Referenced by AddTaskItemButton(), and UpdateTaskItemButton().

◆ GetWndTextFromTaskItem()

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

Definition at line 427 of file taskswnd.cpp.

428 {
429 /* Get the window text without sending a message so we don't hang if an
430 application isn't responding! */
431 return InternalGetWindowText(TaskItem->hWnd, szBuf, cchBuf);
432 }
_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 1603 of file taskswnd.cpp.

1604 {
1605 const UINT uAppCmd = GET_APPCOMMAND_LPARAM(lParam);
1606 if (InvokeRegistryAppKeyCommand(uAppCmd))
1607 return TRUE;
1608 switch (uAppCmd)
1609 {
1610 // TODO: When MMDevAPI arrives, try IMMDeviceEnumerator::GetDefaultAudioEndpoint first and then fall back to WinMM.
1611 case APPCOMMAND_VOLUME_MUTE:
1612 return m_Mixer.Mute();
1613 case APPCOMMAND_VOLUME_DOWN:
1614 case APPCOMMAND_VOLUME_UP:
1615 return m_Mixer.AdjustVolume(uAppCmd, hProcessHeap);
1616 case APPCOMMAND_BROWSER_SEARCH:
1617 return SHFindFiles(NULL, NULL);
1618 }
1619 return FALSE;
1620 }
bool AdjustVolume(_In_ UINT direction, _In_ HANDLE hProcessHeap)
Definition: mediabtns.cpp:184
CMultimediaBackend m_Mixer
Definition: taskswnd.cpp:403
static BOOL InvokeRegistryAppKeyCommand(UINT uAppCmd)
Definition: taskswnd.cpp:1566
unsigned int UINT
Definition: sysinfo.c:13
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2488

Referenced by OnShellHook().

◆ HandleButtonClick()

BOOL CTaskSwitchWnd::HandleButtonClick ( IN WORD  wIndex)
inline

Definition at line 1750 of file taskswnd.cpp.

1751 {
1752 PTASK_ITEM TaskItem;
1753 PTASK_GROUP TaskGroup;
1754
1756 {
1757 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1758 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1759 {
1760 HandleTaskGroupClick(TaskGroup);
1761 return TRUE;
1762 }
1763 }
1764
1765 TaskItem = FindTaskItemByIndex((INT) wIndex);
1766 if (TaskItem != NULL)
1767 {
1768 HandleTaskItemClick(TaskItem);
1769 return TRUE;
1770 }
1771
1772 return FALSE;
1773 }
PTASK_GROUP FindTaskGroupByIndex(IN INT Index)
Definition: taskswnd.cpp:1162
VOID HandleTaskGroupClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1745
PTASK_ITEM FindTaskItemByIndex(IN INT Index)
Definition: taskswnd.cpp:1145
VOID HandleTaskItemClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1713

Referenced by OnCommand().

◆ HandleButtonRightClick()

BOOL CTaskSwitchWnd::HandleButtonRightClick ( IN WORD  wIndex)
inline

Definition at line 1802 of file taskswnd.cpp.

1803 {
1804 PTASK_ITEM TaskItem;
1805 PTASK_GROUP TaskGroup;
1807 {
1808 TaskGroup = FindTaskGroupByIndex((INT) wIndex);
1809 if (TaskGroup != NULL && TaskGroup->IsCollapsed)
1810 {
1811 HandleTaskGroupRightClick(TaskGroup);
1812 return TRUE;
1813 }
1814 }
1815
1816 TaskItem = FindTaskItemByIndex((INT) wIndex);
1817
1818 if (TaskItem != NULL)
1819 {
1820 HandleTaskItemRightClick(TaskItem);
1821 return TRUE;
1822 }
1823
1824 return FALSE;
1825 }
VOID HandleTaskGroupRightClick(IN OUT PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:1797
VOID HandleTaskItemRightClick(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1781

Referenced by OnContextMenu().

◆ HandleFullScreenApp()

void CTaskSwitchWnd::HandleFullScreenApp ( _In_opt_ HWND  hwndRude)
inline

Definition at line 1957 of file taskswnd.cpp.

1958 {
1959 // Notify ABN_FULLSCREENAPP for every monitor
1960 RECT rc;
1962 if (hwndRude && ::GetWindowRect(hwndRude, &rc))
1963 {
1964 Data.pRect = &rc;
1965 Data.hTargetMonitor = ::MonitorFromWindow(hwndRude, MONITOR_DEFAULTTONULL);
1966 }
1967 Data.pTray = m_Tray;
1969
1970 if (hwndRude)
1971 {
1972 // Make the taskbar bottom
1974 HWND hwndTray = m_Tray->GetHWND();
1975 ::SetWindowPos(hwndTray, HWND_BOTTOM, 0, 0, 0, 0, uFlags);
1976
1977 // Switch to the rude app if necessary
1978 DWORD exstyle = (DWORD)::GetWindowLongPtrW(hwndRude, GWL_EXSTYLE);
1979 if (!(exstyle & WS_EX_TOPMOST) && !SHELL_IsRudeWindowActive(hwndRude))
1980 ::SwitchToThisWindow(hwndRude, TRUE);
1981 }
1982 }
static BOOL CALLBACK FullScreenEnumProc(_In_ HMONITOR hMonitor, _In_opt_ HDC hDC, _In_ LPRECT prc, _In_ LPARAM lParam)
Definition: taskswnd.cpp:1939
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
static BOOL SHELL_IsRudeWindowActive(_In_ HWND hWnd)
Definition: taskswnd.cpp:67
VOID WINAPI SwitchToThisWindow(HWND hwnd, BOOL fAltTab)
Definition: window.c:82
#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

Referenced by OnTimer(), and OnWindowDestroyed().

◆ HandleItemPaint()

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

Definition at line 1828 of file taskswnd.cpp.

1829 {
1830 LRESULT Ret = CDRF_DODEFAULT;
1831 PTASK_GROUP TaskGroup;
1832 PTASK_ITEM TaskItem;
1833
1834 TaskItem = FindTaskItemByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1835 TaskGroup = FindTaskGroupByIndex((INT) nmtbcd->nmcd.dwItemSpec);
1836 if (TaskGroup == NULL && TaskItem != NULL)
1837 {
1838 ASSERT(TaskItem != NULL);
1839
1840 if (TaskItem != NULL && ::IsWindow(TaskItem->hWnd))
1841 {
1842 /* Make the entire button flashing if necessary */
1843 if (nmtbcd->nmcd.uItemState & CDIS_MARKED)
1844 {
1845 Ret = TBCDRF_NOBACKGROUND;
1846 if (!m_Theme)
1847 {
1848 SelectObject(nmtbcd->nmcd.hdc, GetSysColorBrush(COLOR_HIGHLIGHT));
1849 Rectangle(nmtbcd->nmcd.hdc,
1850 nmtbcd->nmcd.rc.left,
1851 nmtbcd->nmcd.rc.top,
1852 nmtbcd->nmcd.rc.right,
1853 nmtbcd->nmcd.rc.bottom);
1854 }
1855 else
1856 {
1857 DrawThemeBackground(m_Theme, nmtbcd->nmcd.hdc, TDP_FLASHBUTTON, 0, &nmtbcd->nmcd.rc, 0);
1858 }
1859 nmtbcd->clrText = GetSysColor(COLOR_HIGHLIGHTTEXT);
1860 return Ret;
1861 }
1862 }
1863 }
1864 else if (TaskGroup != NULL)
1865 {
1866 /* FIXME: Implement painting for task groups */
1867 }
1868 return Ret;
1869 }
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
#define CDRF_DODEFAULT
Definition: commctrl.h:268
#define TBCDRF_NOBACKGROUND
Definition: commctrl.h:1040
#define CDIS_MARKED
Definition: commctrl.h:298
@ TDP_FLASHBUTTON
Definition: vssym32.h:578
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_HIGHLIGHT
Definition: winuser.h:937
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define COLOR_HIGHLIGHTTEXT
Definition: winuser.h:938

Referenced by HandleToolbarNotification().

◆ HandleTaskGroupClick()

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

Definition at line 1745 of file taskswnd.cpp.

1746 {
1747 /* TODO: Show task group menu */
1748 }

Referenced by HandleButtonClick().

◆ HandleTaskGroupRightClick()

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

Definition at line 1797 of file taskswnd.cpp.

1798 {
1799 /* TODO: Show task group right click menu */
1800 }

Referenced by HandleButtonRightClick().

◆ HandleTaskItemClick()

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

Definition at line 1713 of file taskswnd.cpp.

1714 {
1715 BOOL bIsMinimized;
1716 BOOL bIsActive;
1717
1718 if (::IsWindow(TaskItem->hWnd))
1719 {
1720 bIsMinimized = ::IsIconic(TaskItem->hWnd);
1721 bIsActive = (TaskItem == m_ActiveTaskItem);
1722
1723 TRACE("Active TaskItem %p, selected TaskItem %p\n", m_ActiveTaskItem, TaskItem);
1724 if (m_ActiveTaskItem)
1725 TRACE("Active TaskItem hWnd=%p, TaskItem hWnd %p\n", m_ActiveTaskItem->hWnd, TaskItem->hWnd);
1726
1727 TRACE("Valid button clicked. HWND=%p, IsMinimized=%s, IsActive=%s...\n",
1728 TaskItem->hWnd, bIsMinimized ? "Yes" : "No", bIsActive ? "Yes" : "No");
1729
1730 if (!bIsMinimized && bIsActive)
1731 {
1732 if (!::IsHungAppWindow(TaskItem->hWnd))
1733 ::ShowWindowAsync(TaskItem->hWnd, SW_MINIMIZE);
1734 TRACE("Valid button clicked. App window Minimized.\n");
1735 }
1736 else
1737 {
1738 ::SwitchToThisWindow(TaskItem->hWnd, TRUE);
1739
1740 TRACE("Valid button clicked. App window Restored.\n");
1741 }
1742 }
1743 }
BOOL IsIconic() const
Definition: atlwin.h:932
BOOL WINAPI IsHungAppWindow(HWND hwnd)
Definition: window.c:1869
#define SW_MINIMIZE
Definition: winuser.h:787
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)

Referenced by HandleButtonClick().

◆ HandleTaskItemRightClick()

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

Definition at line 1781 of file taskswnd.cpp.

1782 {
1783 POINT pt;
1784 GetCursorPos(&pt);
1785
1786 SetForegroundWindow(TaskItem->hWnd);
1787
1788 ActivateTask(TaskItem->hWnd);
1789
1790 if (GetForegroundWindow() != TaskItem->hWnd)
1791 ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
1792
1793 ::SendMessageCallbackW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y),
1794 SendAsyncProc, (ULONG_PTR)TaskItem);
1795 }
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL ActivateTask(IN HWND hWnd)
Definition: taskswnd.cpp:1218
static VOID CALLBACK SendAsyncProc(HWND hwnd, UINT uMsg, DWORD_PTR dwData, LRESULT lResult)
Definition: taskswnd.cpp:1776
#define pt(x, y)
Definition: drawing.c:79
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define WM_POPUPSYSTEMMENU
Definition: undocuser.h:62
#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)

Referenced by HandleButtonRightClick().

◆ HandleToolbarNotification()

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

Definition at line 1871 of file taskswnd.cpp.

1872 {
1873 LRESULT Ret = 0;
1874
1875 switch (nmh->code)
1876 {
1877 case NM_CUSTOMDRAW:
1878 {
1879 LPNMTBCUSTOMDRAW nmtbcd = (LPNMTBCUSTOMDRAW) nmh;
1880
1881 switch (nmtbcd->nmcd.dwDrawStage)
1882 {
1883
1884 case CDDS_ITEMPREPAINT:
1885 Ret = HandleItemPaint(nmtbcd);
1886 break;
1887
1888 case CDDS_PREPAINT:
1889 Ret = CDRF_NOTIFYITEMDRAW;
1890 break;
1891
1892 default:
1893 Ret = CDRF_DODEFAULT;
1894 break;
1895 }
1896 break;
1897 }
1898 }
1899
1900 return Ret;
1901 }
LRESULT HandleItemPaint(IN OUT NMTBCUSTOMDRAW *nmtbcd)
Definition: taskswnd.cpp:1828
#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 2241 of file taskswnd.cpp.

2242 {
2243 m_Tray = tray;
2246 if (!m_hWnd)
2247 return E_FAIL;
2248 return S_OK;
2249 }
@ 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:107

◆ InvokeRegistryAppKeyCommand()

static BOOL CTaskSwitchWnd::InvokeRegistryAppKeyCommand ( UINT  uAppCmd)
inlinestatic

Definition at line 1566 of file taskswnd.cpp.

1567 {
1568 BOOL bResult = FALSE;
1569 WCHAR szBuf[MAX_PATH * 2];
1570 wsprintfW(szBuf, L"%s\\AppKey\\%u", REGSTR_PATH_EXPLORER, uAppCmd);
1571 HUSKEY hKey;
1573 return bResult;
1574
1575 DWORD cb = sizeof(szBuf);
1576 if (!bResult && SHRegQueryUSValueW(hKey, L"ShellExecute", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1577 {
1578 bResult = TRUE;
1579 }
1580 cb = sizeof(szBuf);
1581 if (!bResult && SHRegQueryUSValueW(hKey, L"Association", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1582 {
1583 bResult = TRUE;
1584 cb = _countof(szBuf);
1586 *szBuf = UNICODE_NULL;
1587 }
1588 cb = sizeof(szBuf);
1589 if (!bResult && SHRegQueryUSValueW(hKey, L"RegisteredApp", NULL, szBuf, &cb, FALSE, NULL, 0) == ERROR_SUCCESS)
1590 {
1591 bResult = TRUE;
1593 *szBuf = UNICODE_NULL; // Don't execute again
1594 }
1596
1597 // Note: Tweak UI uses an empty string for its "Do nothing" option.
1598 if (bResult && *szBuf)
1600 return bResult;
1601 }
#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
#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
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define SW_SHOW
Definition: winuser.h:786

Referenced by HandleAppCommand().

◆ IsRudeEnumProc()

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

Definition at line 1913 of file taskswnd.cpp.

1914 {
1916
1917 HMONITOR hMon = ::MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
1918 if (!hMon ||
1919 (pData->hTargetMonitor && pData->hTargetMonitor != hMon) ||
1920 !SHELL_IsRudeWindow(hMon, hwnd, (hwnd == pData->hwndFirstCheck)))
1921 {
1922 return TRUE; // Continue
1923 }
1924
1925 pData->hwndFound = hwnd;
1926 return FALSE; // Finish
1927 }
struct CTaskSwitchWnd::tagRUDEAPPDATA * PRUDEAPPDATA
static BOOL SHELL_IsRudeWindow(_In_opt_ HMONITOR hMonitor, _In_ HWND hWnd, _In_ BOOL bDontCheckActive)
Definition: taskswnd.cpp:76

Referenced by FindRudeApp().

◆ OnCommand()

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

Definition at line 2070 of file taskswnd.cpp.

2071 {
2072 LRESULT Ret = TRUE;
2073 if (lParam != 0 && (HWND) lParam == m_TaskBar.m_hWnd)
2074 {
2076 }
2077 return Ret;
2078 }
BOOL HandleButtonClick(IN WORD wIndex)
Definition: taskswnd.cpp:1750
WPARAM wParam
Definition: combotst.c:138
#define LOWORD(l)
Definition: pedump.c:82

◆ OnContextMenu()

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

Definition at line 2127 of file taskswnd.cpp.

2128 {
2129 LRESULT Ret = 0;
2130 INT_PTR iBtn = -1;
2131
2132 if (m_TaskBar.m_hWnd != NULL)
2133 {
2134 POINT pt;
2135
2136 pt.x = GET_X_LPARAM(lParam);
2137 pt.y = GET_Y_LPARAM(lParam);
2138
2140
2141 iBtn = m_TaskBar.HitTest(&pt);
2142 if (iBtn >= 0)
2143 {
2145 }
2146 }
2147 if (iBtn < 0)
2148 {
2149 /* Not on a taskbar button, so forward message to tray */
2150 Ret = SendMessage(m_Tray->GetHWND(), uMsg, wParam, lParam);
2151 }
2152 return Ret;
2153 }
BOOL HandleButtonRightClick(IN WORD wIndex)
Definition: taskswnd.cpp:1802
int32_t INT_PTR
Definition: typedefs.h:64
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define SendMessage
Definition: winuser.h:6009
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

◆ OnCopyData()

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

Definition at line 2225 of file taskswnd.cpp.

2226 {
2228 if (cpData->dwData == m_uHardErrorMsg)
2229 {
2230 /* A hard error balloon message */
2232 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));
2233 if (pData->cbHeaderSize == sizeof(BALLOON_HARD_ERROR_DATA))
2235 return TRUE;
2236 }
2237
2238 return FALSE;
2239 }
void StartThread(PBALLOON_HARD_ERROR_DATA pData)
Definition: taskswnd.cpp:252
CHardErrorThread m_HardErrorThread
Definition: taskswnd.cpp:402
#define ULONG_PTR
Definition: config.h:101
ULONG_PTR dwData
Definition: winuser.h:3109
struct _BALLOON_HARD_ERROR_DATA * PBALLOON_HARD_ERROR_DATA
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT

◆ OnCreate()

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

Definition at line 1507 of file taskswnd.cpp.

1508 {
1510 return FALSE;
1511
1512 SetWindowTheme(m_TaskBar.m_hWnd, L"TaskBand", NULL);
1513
1516 ILC_COLOR32 | ILC_MASK, 0, 1000);
1517 m_TaskBar.SetImageList(m_ImageList);
1518
1519 /* Set proper spacing between buttons */
1520 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
1521
1522 /* Register the shell hook */
1524
1525 TRACE("ShellHookMsg got assigned number %d\n", m_ShellHookMsg);
1526
1527 RegisterShellHook(m_hWnd, 3); /* 1 if no NT! We're targeting NT so we don't care! */
1528
1530
1531 /* Recalculate the button size */
1533
1534#if DUMP_TASKS != 0
1535 SetTimer(hwnd, 1, 5000, NULL);
1536#endif
1537
1538 /* WinMM is needed to change system volume via media buttons */
1539 m_WinMMDevChgMsg = RegisterWindowMessageW(L"winmm_devicechange");
1541
1542 return TRUE;
1543 }
INT UpdateTbButtonSpacing(IN BOOL bHorizontal, IN BOOL bThemed, IN UINT uiRows=0, IN UINT uiBtnsPerLine=0)
Definition: taskswnd.cpp:276
BOOL Initialize(HWND hWndParent)
Definition: taskswnd.cpp:355
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
BOOL WINAPI RegisterShellHook(HWND hWnd, DWORD dwType)
Definition: shellord.c:517
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
#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)

◆ OnDestroy()

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

Definition at line 1545 of file taskswnd.cpp.

1546 {
1548
1550
1551 /* Unregister the shell hook */
1553
1556
1557 if (m_ImageList)
1558 {
1560 m_ImageList = NULL;
1561 }
1562
1563 return TRUE;
1564 }
VOID DeleteAllTasks()
Definition: taskswnd.cpp:1259
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:1036
#define TIMER_ID_VALIDATE_RUDE_APP
Definition: taskswnd.cpp:26
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

◆ OnEraseBackground()

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

Definition at line 2027 of file taskswnd.cpp.

2028 {
2029 HDC hdc = (HDC) wParam;
2030
2031 if (!IsAppThemed())
2032 {
2033 bHandled = FALSE;
2034 return 0;
2035 }
2036
2037 RECT rect;
2040
2041 return TRUE;
2042 }
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 2155 of file taskswnd.cpp.

2156 {
2157 PTASK_ITEM TaskItem = FindTaskItem((HWND) wParam);
2158 if (TaskItem)
2159 {
2160 RECT* prcMinRect = (RECT*) lParam;
2161 RECT rcItem, rcToolbar;
2162 m_TaskBar.GetItemRect(TaskItem->Index, &rcItem);
2163 m_TaskBar.GetWindowRect(&rcToolbar);
2164
2165 OffsetRect(&rcItem, rcToolbar.left, rcToolbar.top);
2166
2167 *prcMinRect = rcItem;
2168 return TRUE;
2169 }
2170 return FALSE;
2171 }
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)

◆ OnMouseActivate()

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

Definition at line 2173 of file taskswnd.cpp.

2174 {
2175 return MA_NOACTIVATE;
2176 }
#define MA_NOACTIVATE
Definition: winuser.h:2539

◆ OnNcHitTest()

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

Definition at line 2059 of file taskswnd.cpp.

2060 {
2061 LRESULT Ret = TRUE;
2062 /* We want the tray window to be draggable everywhere, so make the control
2063 appear transparent */
2064 Ret = DefWindowProc(uMsg, wParam, lParam);
2065 if (Ret != HTVSCROLL && Ret != HTHSCROLL)
2066 Ret = HTTRANSPARENT;
2067 return Ret;
2068 }
#define DefWindowProc
Definition: ros2win.h:31
#define HTVSCROLL
Definition: winuser.h:2518
#define HTHSCROLL
Definition: winuser.h:2517
#define HTTRANSPARENT
Definition: winuser.h:2509

◆ OnNotify()

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

Definition at line 2080 of file taskswnd.cpp.

2081 {
2082 LRESULT Ret = TRUE;
2083 const NMHDR *nmh = (const NMHDR *) lParam;
2084
2085 if (nmh->hwndFrom == m_TaskBar.m_hWnd)
2086 {
2087 Ret = HandleToolbarNotification(nmh);
2088 }
2089 return Ret;
2090 }
LRESULT HandleToolbarNotification(IN const NMHDR *nmh)
Definition: taskswnd.cpp:1871
HWND hwndFrom
Definition: winuser.h:3265

◆ OnSetFont()

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

Definition at line 2209 of file taskswnd.cpp.

2210 {
2211 return m_TaskBar.SendMessageW(uMsg, wParam, lParam);
2212 }

◆ OnSettingChanged()

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

Definition at line 2214 of file taskswnd.cpp.

2215 {
2216 if (wParam == SPI_SETNONCLIENTMETRICS)
2217 {
2218 /* Don't update the font, this will be done when we get a WM_SETFONT from our parent */
2220 }
2221
2222 return 0;
2223 }

◆ OnShellHook()

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

Definition at line 1622 of file taskswnd.cpp.

1623 {
1624 BOOL Ret = FALSE;
1625
1626 /* In case the shell hook wasn't registered properly, ignore WM_NULLs*/
1627 if (uMsg == 0)
1628 {
1629 bHandled = FALSE;
1630 return 0;
1631 }
1632
1633 TRACE("Received shell hook message: wParam=%08lx, lParam=%08lx\n", wParam, lParam);
1634
1635 switch ((INT) wParam)
1636 {
1637 case HSHELL_APPCOMMAND:
1638 Ret = HandleAppCommand(0, lParam);
1639 break;
1640
1642 AddTask((HWND) lParam);
1643 break;
1644
1646 /* The window still exists! Delay destroying it a bit */
1649 break;
1650
1652 case HSHELL_WINDOWACTIVATED:
1655 break;
1656
1657 case HSHELL_FLASH:
1659 break;
1660
1661 case HSHELL_REDRAW:
1663 break;
1664
1665 case HSHELL_TASKMAN:
1666 ::PostMessage(m_Tray->GetHWND(), TWM_OPENSTARTMENU, 0, 0);
1667 break;
1668
1670 ::SwitchToThisWindow(m_Tray->GetHWND(), TRUE);
1671 ::SetForegroundWindow(m_Tray->GetHWND());
1672 break;
1673
1674 case HSHELL_LANGUAGE:
1675 case HSHELL_SYSMENU:
1676 case HSHELL_ENDTASK:
1677 case HSHELL_ACCESSIBILITYSTATE:
1678 case HSHELL_WINDOWREPLACED:
1679 case HSHELL_WINDOWREPLACING:
1680
1681 case HSHELL_GETMINRECT:
1682 default:
1683 {
1684#if DEBUG_SHELL_HOOK
1685 int i, found;
1686 for (i = 0, found = 0; i != _countof(hshell_msg); i++)
1687 {
1688 if (hshell_msg[i].msg == (INT) wParam)
1689 {
1690 TRACE("Shell message %ws unhandled (lParam = 0x%p)!\n", hshell_msg[i].msg_name, lParam);
1691 found = 1;
1692 break;
1693 }
1694 }
1695 if (found)
1696 break;
1697#endif
1698 TRACE("Shell message %d unhandled (lParam = 0x%p)!\n", (INT) wParam, lParam);
1699 break;
1700 }
1701 }
1702
1703 return Ret;
1704 }
#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:1603
BOOL FlashTask(IN HWND hWnd)
Definition: taskswnd.cpp:1279
BOOL RedrawTask(IN HWND hWnd)
Definition: taskswnd.cpp:1319
void OnWindowDestroyed(_In_ HWND hwndTarget)
Definition: taskswnd.cpp:2019
BOOL DeleteTask(IN HWND hWnd)
Definition: taskswnd.cpp:1242
void OnWindowActivated(_In_ HWND hwndTarget)
Definition: taskswnd.cpp:2010
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 2044 of file taskswnd.cpp.

2045 {
2046 SIZE szClient;
2047
2048 szClient.cx = LOWORD(lParam);
2049 szClient.cy = HIWORD(lParam);
2050 if (m_TaskBar.m_hWnd != NULL)
2051 {
2052 m_TaskBar.SetWindowPos(NULL, 0, 0, szClient.cx, szClient.cy, SWP_NOZORDER);
2053
2055 }
2056 return TRUE;
2057 }
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1288
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
#define HIWORD(l)
Definition: typedefs.h:247
#define SWP_NOZORDER
Definition: winuser.h:1258

◆ OnTaskbarSettingsChanged()

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

Definition at line 2099 of file taskswnd.cpp.

2100 {
2101 BOOL bSettingsChanged = FALSE;
2102 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
2103
2104 if (newSettings->bGroupButtons != g_TaskbarSettings.bGroupButtons)
2105 {
2106 bSettingsChanged = TRUE;
2109 }
2110
2111 if (newSettings->bSmallIcons != g_TaskbarSettings.bSmallIcons)
2112 {
2113 bSettingsChanged = TRUE;
2115 }
2116
2117 if (bSettingsChanged)
2118 {
2119 /* Refresh each task item view */
2122 }
2123
2124 return 0;
2125 }

◆ OnThemeChanged()

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

Definition at line 1492 of file taskswnd.cpp.

1493 {
1494 TRACE("OmThemeChanged\n");
1495
1496 if (m_Theme)
1498
1499 if (IsThemeActive())
1500 m_Theme = OpenThemeData(m_hWnd, L"TaskBand");
1501 else
1502 m_Theme = NULL;
1503
1504 return TRUE;
1505 }
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 2178 of file taskswnd.cpp.

2179 {
2180 switch (wParam)
2181 {
2182#if DUMP_TASKS != 0
2183 case 1:
2184 DumpTasks();
2185 break;
2186#endif
2188 {
2189 // Real activation of rude app might take some time after HSHELL_...ACTIVATED.
2190 // Wait up to 5 seconds with validating the rude app at each second.
2191 HWND hwndRude = FindRudeApp(NULL);
2192 HandleFullScreenApp(hwndRude);
2193
2198 break;
2199 }
2200 default:
2201 {
2202 WARN("Unknown timer ID: %p\n", wParam);
2203 break;
2204 }
2205 }
2206 return TRUE;
2207 }
HWND FindRudeApp(_In_opt_ HWND hwndFirstCheck)
Definition: taskswnd.cpp:1984
void HandleFullScreenApp(_In_opt_ HWND hwndRude)
Definition: taskswnd.cpp:1957
#define VALIDATE_RUDE_MAX_COUNT
Definition: taskswnd.cpp:28
#define VALIDATE_RUDE_INTERVAL
Definition: taskswnd.cpp:27

◆ OnUpdateTaskbarPos()

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

Definition at line 2092 of file taskswnd.cpp.

2093 {
2094 /* Update the button spacing */
2095 m_TaskBar.UpdateTbButtonSpacing(m_Tray->IsHorizontal(), m_Theme != NULL);
2096 return TRUE;
2097 }

◆ OnWindowActivated()

void CTaskSwitchWnd::OnWindowActivated ( _In_ HWND  hwndTarget)
inline

Definition at line 2010 of file taskswnd.cpp.

2011 {
2012 // Re-start rude app validation
2016 }

Referenced by OnShellHook().

◆ OnWindowDestroyed()

void CTaskSwitchWnd::OnWindowDestroyed ( _In_ HWND  hwndTarget)
inline

Definition at line 2019 of file taskswnd.cpp.

2020 {
2021 if (!FindTaskItem(hwndTarget))
2022 return;
2023 HWND hwndRude = FindRudeApp(hwndTarget);
2024 HandleFullScreenApp(hwndRude);
2025 }

Referenced by OnShellHook().

◆ OnWindowPosChanged()

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

Definition at line 1999 of file taskswnd.cpp.

2000 {
2001 // Re-start rude app validation
2005 bHandled = FALSE;
2006 return 0;
2007 }

◆ OnWinMMDeviceChange()

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

Definition at line 1706 of file taskswnd.cpp.

1707 {
1708 TRACE("Audio device was added or removed, invalidating mixer\n");
1710 return TRUE;
1711 }

◆ RedrawTask()

BOOL CTaskSwitchWnd::RedrawTask ( IN HWND  hWnd)
inline

Definition at line 1319 of file taskswnd.cpp.

1320 {
1321 PTASK_ITEM TaskItem;
1322
1323 TaskItem = FindTaskItem(hWnd);
1324 if (TaskItem != NULL)
1325 {
1326 RedrawTaskItem(TaskItem);
1327 return TRUE;
1328 }
1329
1330 return FALSE;
1331 }
VOID RedrawTaskItem(IN OUT PTASK_ITEM TaskItem)
Definition: taskswnd.cpp:1294

Referenced by OnShellHook().

◆ RedrawTaskItem()

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

Definition at line 1294 of file taskswnd.cpp.

1295 {
1296 PTASK_GROUP TaskGroup;
1297
1298 TaskGroup = TaskItem->Group;
1299 if (m_IsGroupingEnabled && TaskGroup != NULL)
1300 {
1301 if (TaskGroup->IsCollapsed && TaskGroup->Index >= 0)
1302 {
1303 UpdateTaskGroupButton(TaskGroup);
1304 }
1305 else if (TaskItem->Index >= 0)
1306 {
1307 goto UpdateTaskItem;
1308 }
1309 }
1310 else if (TaskItem->Index >= 0)
1311 {
1312 UpdateTaskItem:
1313 TaskItem->RenderFlashed = 0;
1314 UpdateTaskItemButton(TaskItem);
1315 }
1316 }

Referenced by RedrawTask().

◆ RefreshWindowList()

BOOL CTaskSwitchWnd::RefreshWindowList ( )
inline

Definition at line 1485 of file taskswnd.cpp.

1486 {
1487 TRACE("Refreshing window list...\n");
1488 /* Add all windows to the toolbar */
1489 return EnumWindows(s_EnumWindowsProc, (LPARAM)this);
1490 }
static BOOL CALLBACK s_EnumWindowsProc(IN HWND hWnd, IN LPARAM lParam)
Definition: taskswnd.cpp:1478

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

◆ RemoveIcon()

VOID CTaskSwitchWnd::RemoveIcon ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 649 of file taskswnd.cpp.

650 {
651 TBBUTTONINFO tbbi;
652 PTASK_ITEM currentTaskItem, LastItem;
653
654 if (TaskItem->IconIndex == -1)
655 return;
656
657 tbbi.cbSize = sizeof(tbbi);
658 tbbi.dwMask = TBIF_IMAGE;
659
660 currentTaskItem = m_TaskItems;
661 LastItem = currentTaskItem + m_TaskItemCount;
662 while (currentTaskItem != LastItem)
663 {
664 if (currentTaskItem->IconIndex > TaskItem->IconIndex)
665 {
666 currentTaskItem->IconIndex--;
667 tbbi.iImage = currentTaskItem->IconIndex;
668
669 m_TaskBar.SetButtonInfo(currentTaskItem->Index, &tbbi);
670 }
671 currentTaskItem++;
672 }
673
674 ImageList_Remove(m_ImageList, TaskItem->IconIndex);
675 }
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:158

Referenced by DeleteTaskItemButton().

◆ RemoveTaskFromTaskGroup()

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

Definition at line 898 of file taskswnd.cpp.

899 {
900 PTASK_GROUP TaskGroup, CurrentGroup, *PrevLink;
901
902 TaskGroup = TaskItem->Group;
903 if (TaskGroup != NULL)
904 {
905 DWORD dwNewTaskCount = --TaskGroup->dwTaskCount;
906 if (dwNewTaskCount == 0)
907 {
908 /* Find the previous pointer in the chain */
909 CurrentGroup = m_TaskGroups;
910 PrevLink = &m_TaskGroups;
911 while (CurrentGroup != TaskGroup)
912 {
913 PrevLink = &CurrentGroup->Next;
914 CurrentGroup = CurrentGroup->Next;
915 }
916
917 /* Remove the group from the list */
918 ASSERT(TaskGroup == CurrentGroup);
919 *PrevLink = TaskGroup->Next;
920
921 /* Free the task group */
923 0,
924 TaskGroup);
925 }
926 else if (TaskGroup->IsCollapsed &&
927 TaskGroup->Index >= 0)
928 {
929 if (dwNewTaskCount > 1)
930 {
931 /* FIXME: Check if we should expand the group */
932 /* Update the task group button */
933 UpdateTaskGroupButton(TaskGroup);
934 }
935 else
936 {
937 /* Expand the group of one task button to a task button */
938 ExpandTaskGroup(TaskGroup);
939 }
940 }
941 }
942 }
VOID ExpandTaskGroup(IN PTASK_GROUP TaskGroup)
Definition: taskswnd.cpp:559
#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 1478 of file taskswnd.cpp.

1479 {
1481
1482 return This->EnumWindowsProc(hWnd);
1483 }

Referenced by RefreshWindowList().

◆ SendAsyncProc()

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

Definition at line 1776 of file taskswnd.cpp.

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

Referenced by HandleTaskItemRightClick().

◆ UpdateButtonsSize()

VOID CTaskSwitchWnd::UpdateButtonsSize ( IN BOOL  bRedrawDisabled)
inline

Definition at line 1333 of file taskswnd.cpp.

1334 {
1335 RECT rcClient;
1336 UINT uiRows, uiMax, uiMin, uiBtnsPerLine, ui;
1337 LONG NewBtnSize;
1338 BOOL Horizontal;
1339
1340 /* Update the size of the image list if needed */
1341 int cx, cy;
1345 {
1349
1350 /* SetIconSize removes all icons so we have to reinsert them */
1351 PTASK_ITEM TaskItem = m_TaskItems;
1352 PTASK_ITEM LastTaskItem = m_TaskItems + m_TaskItemCount;
1353 while (TaskItem != LastTaskItem)
1354 {
1355 TaskItem->IconIndex = -1;
1356 UpdateTaskItemButton(TaskItem);
1357
1358 TaskItem++;
1359 }
1360 m_TaskBar.SetImageList(m_ImageList);
1361 }
1362
1363 if (GetClientRect(&rcClient) && !IsRectEmpty(&rcClient))
1364 {
1365 if (m_ButtonCount > 0)
1366 {
1367 Horizontal = m_Tray->IsHorizontal();
1368
1369 if (Horizontal)
1370 {
1371 TBMETRICS tbm = { 0 };
1372 tbm.cbSize = sizeof(tbm);
1374 m_TaskBar.GetMetrics(&tbm);
1375
1376 if (m_ButtonSize.cy + tbm.cyButtonSpacing != 0)
1377 uiRows = (rcClient.bottom + tbm.cyButtonSpacing) / (m_ButtonSize.cy + tbm.cyButtonSpacing);
1378 else
1379 uiRows = 1;
1380
1381 if (uiRows == 0)
1382 uiRows = 1;
1383
1384 uiBtnsPerLine = (m_ButtonCount + uiRows - 1) / uiRows;
1385 }
1386 else
1387 {
1388 uiBtnsPerLine = 1;
1389 uiRows = m_ButtonCount;
1390 }
1391
1392 if (!bRedrawDisabled)
1394
1395 /* We might need to update the button spacing */
1396 int cxButtonSpacing = m_TaskBar.UpdateTbButtonSpacing(
1397 Horizontal, m_Theme != NULL,
1398 uiRows, uiBtnsPerLine);
1399
1400 /* Determine the minimum and maximum width of a button */
1402 if (Horizontal)
1403 {
1405
1406 /* Calculate the ideal width and make sure it's within the allowed range */
1407 NewBtnSize = (rcClient.right - (uiBtnsPerLine * cxButtonSpacing)) / uiBtnsPerLine;
1408
1409 if (NewBtnSize < (LONG) uiMin)
1410 NewBtnSize = uiMin;
1411 if (NewBtnSize >(LONG)uiMax)
1412 NewBtnSize = uiMax;
1413
1414 /* Recalculate how many buttons actually fit into one line */
1415 uiBtnsPerLine = rcClient.right / (NewBtnSize + cxButtonSpacing);
1416 if (uiBtnsPerLine == 0)
1417 uiBtnsPerLine++;
1418 }
1419 else
1420 {
1421 NewBtnSize = uiMax = rcClient.right;
1422 }
1423
1424 m_ButtonSize.cx = NewBtnSize;
1425
1426 m_ButtonsPerLine = uiBtnsPerLine;
1427
1428 for (ui = 0; ui != m_ButtonCount; ui++)
1429 {
1430 TBBUTTONINFOW tbbi = { 0 };
1431 tbbi.cbSize = sizeof(tbbi);
1433 tbbi.cx = (INT) NewBtnSize;
1434 tbbi.fsState = TBSTATE_ENABLED;
1435
1436 /* Check if we're updating a button that is the last one in the
1437 line. If so, we need to set the TBSTATE_WRAP flag! */
1438 if (Horizontal)
1439 {
1440 if ((ui + 1) % uiBtnsPerLine == 0)
1441 tbbi.fsState |= TBSTATE_WRAP;
1442 }
1443 else
1444 {
1445 tbbi.fsState |= TBSTATE_WRAP;
1446 }
1447
1448 if (m_ActiveTaskItem != NULL &&
1450 {
1451 tbbi.fsState |= TBSTATE_CHECKED;
1452 }
1453
1454 m_TaskBar.SetButtonInfo(ui, &tbbi);
1455 }
1456 }
1457 else
1458 {
1459 m_ButtonsPerLine = 0;
1460 m_ButtonSize.cx = 0;
1461 }
1462 }
1463
1464 // FIXME: This seems to be enabling redraws prematurely, but moving it to its right place doesn't work!
1466 }
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
DWORD dwMask
Definition: commctrl.h:1243
int cyButtonSpacing
Definition: commctrl.h:1299
DWORD dwMask
Definition: commctrl.h:1293
UINT cbSize
Definition: commctrl.h:1292
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
#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

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

◆ UpdateIndexesAfter()

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

Definition at line 487 of file taskswnd.cpp.

488 {
489 PTASK_GROUP CurrentGroup;
490 PTASK_ITEM CurrentTaskItem, LastTaskItem;
491 INT NewIndex;
492
493 int offset = bInserted ? +1 : -1;
494
496 {
497 /* Update all affected groups */
498 CurrentGroup = m_TaskGroups;
499 while (CurrentGroup != NULL)
500 {
501 if (CurrentGroup->IsCollapsed &&
502 CurrentGroup->Index >= iIndex)
503 {
504 /* Update the toolbar buttons */
505 NewIndex = CurrentGroup->Index + offset;
506 if (m_TaskBar.SetButtonCommandId(CurrentGroup->Index + offset, NewIndex))
507 {
508 CurrentGroup->Index = NewIndex;
509 }
510 else
511 CurrentGroup->Index = -1;
512 }
513
514 CurrentGroup = CurrentGroup->Next;
515 }
516 }
517
518 /* Update all affected task items */
519 CurrentTaskItem = m_TaskItems;
520 LastTaskItem = CurrentTaskItem + m_TaskItemCount;
521 while (CurrentTaskItem != LastTaskItem)
522 {
523 CurrentGroup = CurrentTaskItem->Group;
524 if (CurrentGroup != NULL)
525 {
526 if (!CurrentGroup->IsCollapsed &&
527 CurrentTaskItem->Index >= iIndex)
528 {
529 goto UpdateTaskItemBtn;
530 }
531 }
532 else if (CurrentTaskItem->Index >= iIndex)
533 {
534 UpdateTaskItemBtn:
535 /* Update the toolbar buttons */
536 NewIndex = CurrentTaskItem->Index + offset;
537 if (m_TaskBar.SetButtonCommandId(CurrentTaskItem->Index + offset, NewIndex))
538 {
539 CurrentTaskItem->Index = NewIndex;
540 }
541 else
542 CurrentTaskItem->Index = -1;
543 }
544
545 CurrentTaskItem++;
546 }
547 }
BOOL SetButtonCommandId(IN INT iButtonIndex, IN INT iCommandId)
Definition: taskswnd.cpp:319
GLintptr offset
Definition: glext.h:5920

Referenced by AddTaskItemButton(), and DeleteTaskItemButton().

◆ UpdateTaskGroupButton()

INT CTaskSwitchWnd::UpdateTaskGroupButton ( IN PTASK_GROUP  TaskGroup)
inline

Definition at line 550 of file taskswnd.cpp.

551 {
552 ASSERT(TaskGroup->Index >= 0);
553
554 /* FIXME: Implement */
555
556 return TaskGroup->Index;
557 }

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

◆ UpdateTaskItemButton()

INT CTaskSwitchWnd::UpdateTaskItemButton ( IN PTASK_ITEM  TaskItem)
inline

Definition at line 603 of file taskswnd.cpp.

604 {
605 TBBUTTONINFO tbbi = { 0 };
606 HICON icon;
607 WCHAR windowText[255];
608
609 ASSERT(TaskItem->Index >= 0);
610
611 tbbi.cbSize = sizeof(tbbi);
612 tbbi.dwMask = TBIF_BYINDEX | TBIF_STATE | TBIF_TEXT | TBIF_IMAGE;
613 tbbi.fsState = TBSTATE_ENABLED;
614 if (m_ActiveTaskItem == TaskItem)
615 tbbi.fsState |= TBSTATE_CHECKED;
616
617 if (TaskItem->RenderFlashed)
618 tbbi.fsState |= TBSTATE_MARKED;
619
620 /* Check if we're updating a button that is the last one in the
621 line. If so, we need to set the TBSTATE_WRAP flag! */
622 if (!m_Tray->IsHorizontal() || (m_ButtonsPerLine != 0 &&
623 (TaskItem->Index + 1) % m_ButtonsPerLine == 0))
624 {
625 tbbi.fsState |= TBSTATE_WRAP;
626 }
627
629 {
630 tbbi.pszText = windowText;
631 }
632
633 icon = GetWndIcon(TaskItem->hWnd);
634 if (!icon)
635 icon = static_cast<HICON>(LoadImageW(NULL, MAKEINTRESOURCEW(OIC_SAMPLE), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
636 TaskItem->IconIndex = ImageList_ReplaceIcon(m_ImageList, TaskItem->IconIndex, icon);
637 tbbi.iImage = TaskItem->IconIndex;
638
639 if (!m_TaskBar.SetButtonInfo(TaskItem->Index, &tbbi))
640 {
641 TaskItem->Index = -1;
642 return -1;
643 }
644
645 TRACE("Updated button %d for hwnd 0x%p\n", TaskItem->Index, TaskItem->hWnd);
646 return TaskItem->Index;
647 }
#define TBIF_TEXT
Definition: commctrl.h:1220
#define TBSTATE_MARKED
Definition: commctrl.h:979

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

Member Data Documentation

◆ m_ActiveTaskItem

PTASK_ITEM CTaskSwitchWnd::m_ActiveTaskItem
private

◆ m_AllocatedTaskItems

WORD CTaskSwitchWnd::m_AllocatedTaskItems
private

Definition at line 382 of file taskswnd.cpp.

Referenced by AllocTaskItem().

◆ m_ButtonCount

WORD CTaskSwitchWnd::m_ButtonCount
private

◆ m_ButtonSize

SIZE CTaskSwitchWnd::m_ButtonSize
private

Definition at line 399 of file taskswnd.cpp.

Referenced by CTaskSwitchWnd(), and UpdateButtonsSize().

◆ m_ButtonsPerLine

UINT CTaskSwitchWnd::m_ButtonsPerLine
private

Definition at line 389 of file taskswnd.cpp.

Referenced by UpdateButtonsSize(), and UpdateTaskItemButton().

◆ m_HardErrorThread

CHardErrorThread CTaskSwitchWnd::m_HardErrorThread
private

Definition at line 402 of file taskswnd.cpp.

Referenced by OnCopyData().

◆ m_ImageList

HIMAGELIST CTaskSwitchWnd::m_ImageList
private

◆ m_IsDestroying

BOOL CTaskSwitchWnd::m_IsDestroying
private

Definition at line 395 of file taskswnd.cpp.

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

◆ m_IsGroupingEnabled

◆ m_Mixer

CMultimediaBackend CTaskSwitchWnd::m_Mixer
private

Definition at line 403 of file taskswnd.cpp.

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

◆ m_nRudeAppValidationCounter

INT CTaskSwitchWnd::m_nRudeAppValidationCounter
private

Definition at line 397 of file taskswnd.cpp.

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

◆ m_ShellHookMsg

UINT CTaskSwitchWnd::m_ShellHookMsg
private

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

Referenced by CTaskSwitchWnd(), and OnCopyData().

◆ m_WinMMDevChgMsg

UINT CTaskSwitchWnd::m_WinMMDevChgMsg
private

Definition at line 379 of file taskswnd.cpp.

Referenced by OnCreate().


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