ReactOS 0.4.16-dev-1264-g92ff994
CTrayWindow Class Reference
Inheritance diagram for CTrayWindow:
Collaboration diagram for CTrayWindow:

Classes

struct  MINIMIZE_INFO
 

Public Member Functions

 CTrayWindow ()
 
virtual ~CTrayWindow ()
 
HRESULT ExecResourceCmd (int id)
 
void SaveState ()
 
LRESULT DoExitWindows ()
 
DWORD WINAPI RunFileDlgThread ()
 
void DisplayRunFileDlg ()
 
DWORD WINAPI TrayPropertiesThread ()
 
HWND STDMETHODCALLTYPE DisplayProperties ()
 
VOID OpenCommonStartMenuDirectory (IN HWND hWndOwner, IN LPCTSTR lpOperation)
 
VOID OpenTaskManager (IN HWND hWndOwner)
 
VOID ToggleDesktop ()
 
BOOL STDMETHODCALLTYPE ExecContextMenuCmd (IN UINT uiCmd)
 
VOID HideStartMenu ()
 
LRESULT HandleHotKey (DWORD id)
 
LRESULT HandleCommand (UINT uCommand)
 
UINT TrackMenu (IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
 
HRESULT TrackCtxMenu (IN IContextMenu *contextMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN PVOID Context OPTIONAL)
 
void UpdateFonts ()
 
HMONITOR GetScreenRectFromRect (IN OUT RECT *pRect, IN DWORD dwFlags)
 
HMONITOR GetMonitorFromRect (IN const RECT *pRect)
 
HMONITOR GetScreenRect (IN HMONITOR hMonitor, IN OUT RECT *pRect)
 
VOID AdjustSizerRect (RECT *rc, DWORD pos)
 
VOID MakeTrayRectWithSize (IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
 
VOID GetTrayRectFromScreenRect (IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
 
BOOL IsPosHorizontal ()
 
HMONITOR CalculateValidSize (IN DWORD Position, IN OUT RECT *pRect)
 
DWORD GetDraggingRectFromPt (IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
 
DWORD GetDraggingRectFromRect (IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
 
VOID ChangingWinPos (IN OUT LPWINDOWPOS pwp)
 
VOID ApplyClipping (IN BOOL Clip)
 
VOID ResizeWorkArea ()
 
VOID CheckTrayWndPosition ()
 
VOID RegLoadSettings ()
 
VOID AlignControls (IN PRECT prcClient OPTIONAL)
 
void FitToRebar (PRECT pRect)
 
void PopupStartMenu ()
 
void ProcessMouseTracking ()
 
void ProcessAutoHide ()
 
LRESULT EraseBackgroundWithTheme (HDC hdc)
 
int DrawSizerWithTheme (IN HRGN hRgn)
 
HRESULT STDMETHODCALLTYPE Open ()
 
HRESULT STDMETHODCALLTYPE Close ()
 
HWND STDMETHODCALLTYPE GetHWND ()
 
BOOL STDMETHODCALLTYPE IsSpecialHWND (IN HWND hWnd)
 
BOOL STDMETHODCALLTYPE IsHorizontal ()
 
BOOL STDMETHODCALLTYPE Lock (IN BOOL bLock)
 
BOOL STDMETHODCALLTYPE IsTaskWnd (HWND hWnd)
 
HRESULT STDMETHODCALLTYPE QueryContextMenu (HMENU hPopup, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
HRESULT STDMETHODCALLTYPE InvokeCommand (LPCMINVOKECOMMANDINFO lpici)
 
HRESULT STDMETHODCALLTYPE GetCommandString (UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax)
 
LRESULT OnCreate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDestroy (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEndSession (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnThemeChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSettingChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEraseBackground (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDisplayChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCopyData (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
void DrawShowDesktopButton ()
 
LRESULT OnNcPaint (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCtlColorBtn (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysColorChange (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcHitTest (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMoving (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSizing (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnWindowPosChanging (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnEnterSizeMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnExitSizeMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysChar (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
BOOL IsPointWithinStartButton (LPPOINT ppt, LPRECT prcStartBtn, PWINDOWINFO pwi)
 
BOOL IsPointWithinShowDesktopButton (LPPOINT ppt, LPRECT prcShowDesktopBtn, PWINDOWINFO pwi)
 
LRESULT OnNcLButtonDown (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcRButtonUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnContextMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNotify (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcLButtonDblClick (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcLButtonUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnLButtonUp (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnAppTrayDestroy (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnOpenStartMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnDoExitWindows (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSysCommand (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetTaskSwitch (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
void RestoreMinimizedNonTaskWnds (BOOL bDestroyed, HWND hwndActive)
 
LRESULT OnPulse (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetZOrder (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnHotkey (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
VOID MinimizeAll (BOOL bShowDesktop=FALSE)
 
VOID ShowDesktop ()
 
VOID RestoreAll ()
 
LRESULT OnCommand (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMouseMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnTimer (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcActivate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcCalcSize (INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnInitMenuPopup (INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnActivate (INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSetFocus (INT code, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnRebarAutoSize (INT code, LPNMHDR nmhdr, BOOL &bHandled)
 
LRESULT OnTaskbarSettingsChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
 if (m_StartMenuBand !=NULL)
 
VOID TrayProcessMessages ()
 
VOID TrayMessageLoop ()
 
 GetState () override
 
STDMETHODIMP GetTrayWindow (OUT HWND *phWndTray) override
 
STDMETHODIMP RegisterDesktopWindow (IN HWND hWndDesktop) override
 
STDMETHODIMP Unknown (IN DWORD dwUnknown1, IN DWORD dwUnknown2) override
 
virtual HRESULT RaiseStartButton ()
 
STDMETHODIMP GetWindow (HWND *phwnd) override
 
STDMETHODIMP ContextSensitiveHelp (BOOL fEnterMode) override
 
void _Init ()
 
- 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< CTrayWindow, 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
 
- Public Member Functions inherited from CAppBarManager
 CAppBarManager ()
 
virtual ~CAppBarManager ()
 
LRESULT OnAppBarMessage (_Inout_ PCOPYDATASTRUCT pCopyData)
 
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 ()
 
HRESULT QueryContextMenu ([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags)
 
HRESULT InvokeCommand ([in] LPCMINVOKECOMMANDINFO lpici)
 
HRESULT GetCommandString ([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
 

Static Public Member Functions

static DWORD WINAPI s_RunFileDlgThread (IN OUT PVOID pParam)
 
static DWORD WINAPI s_TrayPropertiesThread (IN OUT PVOID pParam)
 
static BOOL IsDialog (HWND hwnd)
 
static BOOL CALLBACK MinimizeWindowsProc (HWND hwnd, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CComCoClass< CTrayWindow >
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< CTrayWindow, 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)
 

Public Attributes

CComPtr< ITrayBandSite > m_TrayBandSite
 
union {
   DWORD   Flags
 
   struct {
      DWORD   InSizeMove: 1
 
      DWORD   IsDragging: 1
 
      DWORD   NewPosSize: 1
 
      DWORD   IgnorePulse: 1
 
   } 
 
}; 
 
- 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
 

Protected Member Functions

BOOL IsAutoHideState () const override
 
BOOL IsHidingState () const override
 
BOOL IsAlwaysOnTop () const override
 
HMONITORGetMonitor () override
 
HMONITORGetPreviousMonitor () override
 
INT GetPosition () const override
 
const RECTGetTrayRect () override
 
HWND GetTrayWnd () const override
 
HWND GetDesktopWnd () const override
 
void SetAutoHideState (_In_ BOOL bAutoHide) override
 
void UpdateAlwaysOnTop (_In_ BOOL bAlwaysOnTop) override
 
- Protected Member Functions inherited from CAppBarManager
PAPPBAR FindAppBar (_In_ HWND hwndAppBar) const
 
void EliminateAppBar (_In_ INT iItem)
 
void DestroyAppBarDPA ()
 
void AppBarSubtractRect (_In_ PAPPBAR pAppBar, _Inout_ PRECT prc)
 
BOOL AppBarOutsideOf (_In_ const APPBAR *pAppBar1, _In_ const APPBAR *pAppBar2)
 
void ComputeHiddenRect (_Inout_ PRECT prc, _In_ UINT uSide)
 
PAPPBAR_COMMAND GetAppBarMessage (_Inout_ PCOPYDATASTRUCT pCopyData)
 
void GetDockedRect (_Out_ PRECT prcDocked)
 
BOOL SetAutoHideBar (_In_ HWND hwndTarget, _In_ BOOL bSetOrReset, _In_ UINT uSide)
 
void OnAppBarActivationChange2 (_In_ HWND hwndNewAutoHide, _In_ UINT uSide)
 
BOOL OnAppBarNew (_In_ const APPBAR_COMMAND *pData)
 
void OnAppBarRemove (_In_ const APPBAR_COMMAND *pData)
 
void OnAppBarQueryPos (_Inout_ PAPPBAR_COMMAND pData)
 
void OnAppBarSetPos (_Inout_ PAPPBAR_COMMAND pData)
 
UINT OnAppBarGetState ()
 
BOOL OnAppBarGetTaskbarPos (_Inout_ PAPPBAR_COMMAND pData)
 
void OnAppBarActivationChange (_In_ const APPBAR_COMMAND *pData)
 
HWND OnAppBarGetAutoHideBar (_In_ UINT uSide)
 
BOOL OnAppBarSetAutoHideBar (_In_ const APPBAR_COMMAND *pData)
 
void OnAppBarSetState (_In_ UINT uState)
 
void OnAppBarNotifyAll (_In_opt_ HMONITOR hMon, _In_opt_ HWND hwndIgnore, _In_ DWORD dwNotify, _In_opt_ LPARAM lParam)
 
WORKAREA_TYPE RecomputeWorkArea (_In_ const RECT *prcTray, _In_ HMONITOR hMonitor, _Out_ PRECT prcWorkArea)
 
void RecomputeAllWorkareas ()
 
void StuckAppChange (_In_opt_ HWND hwndTarget, _In_opt_ const RECT *prcOld, _In_opt_ const RECT *prcNew, _In_ BOOL bTray)
 
void RedrawDesktop (_In_ HWND hwndDesktop, _Inout_ PRECT prc)
 
virtual BOOL IsAutoHideState () const =0
 
virtual BOOL IsHidingState () const =0
 
virtual BOOL IsAlwaysOnTop () const =0
 
virtual HMONITORGetMonitor ()=0
 
virtual HMONITORGetPreviousMonitor ()=0
 
virtual INT GetPosition () const =0
 
virtual const RECTGetTrayRect ()=0
 
virtual HWND GetTrayWnd () const =0
 
virtual HWND GetDesktopWnd () const =0
 
virtual void SetAutoHideState (_In_ BOOL bAutoHide)=0
 
virtual void UpdateAlwaysOnTop (_In_ BOOL bAlwaysOnTop)=0
 

Private Attributes

CStartButton m_StartButton
 
CTrayShowDesktopButtonm_pShowDesktopButton
 
CComPtr< IMenuBandm_StartMenuBand
 
CComPtr< IMenuPopupm_StartMenuPopup
 
CComPtr< IDeskBandm_TaskBand
 
CComPtr< IContextMenum_ContextMenu
 
HTHEME m_Theme
 
HFONT m_Font
 
HWND m_DesktopWnd
 
HWND m_Rebar
 
HWND m_TaskSwitch
 
HWND m_TrayNotify
 
CComPtr< IUnknownm_TrayNotifyInstance
 
DWORD m_Position
 
HMONITOR m_Monitor
 
HMONITOR m_PreviousMonitor
 
DWORD m_DraggingPosition
 
HMONITOR m_DraggingMonitor
 
RECT m_TrayRects [4]
 
SIZE m_TraySize
 
HWND m_TrayPropertiesOwner
 
HWND m_RunFileDlgOwner
 
UINT m_AutoHideState
 
SIZE m_AutoHideOffset
 
TRACKMOUSEEVENT m_MouseTrackingInfo
 
HDPA m_ShellServices
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Public Types inherited from IOleWindow
typedef IOleWindowLPOLEWINDOW
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IContextMenu
typedef IContextMenuLPCONTEXTMENU
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFOLPCMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
 
typedef struct IContextMenu::tagCMInvokeCommandInfoExLPCMINVOKECOMMANDINFOEX
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 
- Static Public Attributes inherited from IContextMenu
static const WCHAR CMDSTR_NEWFOLDERW [] = {'N','e','w','F','o','l','d','e','r',0}
 
static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0}
 
static const WCHAR CMDSTR_VIEWDETAILSW [] = {'V','i','e','w','D','e','t','a','i','l','s',0}
 
- Static Protected Member Functions inherited from CAppBarManager
static BOOL CALLBACK MonitorEnumProc (_In_ HMONITOR hMonitor, _In_ HDC hDC, _In_ LPRECT prc, _Inout_ LPARAM lParam)
 
- Protected Attributes inherited from CAppBarManager
HDPA m_hAppBarDPA
 
HWND m_ahwndAutoHideBars [4]
 

Detailed Description

Definition at line 306 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindow()

CTrayWindow::CTrayWindow ( )
inline

Definition at line 370 of file traywnd.cpp.

370 :
373 m_Theme(NULL),
374 m_Font(NULL),
376 m_Rebar(NULL),
379 m_Position(0),
388 Flags(0)
389 {
395 }
DWORD m_DraggingPosition
Definition: traywnd.cpp:338
HWND m_TaskSwitch
Definition: traywnd.cpp:330
DWORD Flags
Definition: traywnd.cpp:358
HWND m_Rebar
Definition: traywnd.cpp:329
HMONITOR m_Monitor
Definition: traywnd.cpp:336
DWORD IgnorePulse
Definition: traywnd.cpp:365
CStartButton m_StartButton
Definition: traywnd.cpp:316
DWORD m_Position
Definition: traywnd.cpp:335
HTHEME m_Theme
Definition: traywnd.cpp:324
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:349
HMONITOR m_PreviousMonitor
Definition: traywnd.cpp:337
HDPA m_ShellServices
Definition: traywnd.cpp:351
SIZE m_TraySize
Definition: traywnd.cpp:342
RECT m_TrayRects[4]
Definition: traywnd.cpp:341
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:339
UINT m_AutoHideState
Definition: traywnd.cpp:347
CTrayShowDesktopButton * m_pShowDesktopButton
Definition: traywnd.cpp:317
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:344
SIZE m_AutoHideOffset
Definition: traywnd.cpp:348
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:345
HFONT m_Font
Definition: traywnd.cpp:326
HWND m_DesktopWnd
Definition: traywnd.cpp:328
HWND m_TrayNotify
Definition: traywnd.cpp:331
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define ZeroMemory
Definition: winbase.h:1753

◆ ~CTrayWindow()

virtual CTrayWindow::~CTrayWindow ( )
inlinevirtual

Definition at line 397 of file traywnd.cpp.

398 {
399 if (m_ShellServices != NULL)
400 {
403 }
404
405 if (m_Font != NULL)
406 {
408 m_Font = NULL;
409 }
410
411 if (m_Theme)
412 {
414 m_Theme = NULL;
415 }
416
418 }
HRESULT ShutdownShellServices(HDPA hdpa)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:965
pKey DeleteObject()
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Member Function Documentation

◆ _Init()

void CTrayWindow::_Init ( )
inline

Definition at line 3559 of file traywnd.cpp.

3560 {
3561 m_Position = (DWORD) -1;
3562 }
#define DWORD
Definition: nt_native.h:44

◆ AdjustSizerRect()

VOID CTrayWindow::AdjustSizerRect ( RECT rc,
DWORD  pos 
)
inline

Definition at line 1136 of file traywnd.cpp.

1137 {
1139 SIZE size;
1140
1141 if (pos > ABE_BOTTOM)
1142 pos = ABE_BOTTOM;
1143
1144 HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1146 return;
1147
1148 switch (pos)
1149 {
1150 case ABE_TOP:
1151 rc->bottom -= size.cy;
1152 break;
1153 case ABE_BOTTOM:
1154 rc->top += size.cy;
1155 break;
1156 case ABE_LEFT:
1157 rc->right -= size.cx;
1158 break;
1159 case ABE_RIGHT:
1160 rc->left += size.cx;
1161 break;
1162 }
1163 }
@ TS_TRUE
#define FAILED_UNEXPECTEDLY
Definition: utils.cpp:30
HRESULT WINAPI GetThemePartSize(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, THEMESIZE eSize, SIZE *psz)
Definition: draw.c:1821
GLsizeiptr size
Definition: glext.h:5919
#define ABE_BOTTOM
Definition: shellapi.h:20
#define ABE_RIGHT
Definition: shellapi.h:19
#define ABE_TOP
Definition: shellapi.h:18
#define ABE_LEFT
Definition: shellapi.h:17
HRESULT hr
Definition: shlfolder.c:183
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
@ TBP_SIZINGBARRIGHT
Definition: vssym32.h:562
@ TBP_SIZINGBARBOTTOM
Definition: vssym32.h:561
@ TBP_SIZINGBARLEFT
Definition: vssym32.h:564
@ TBP_SIZINGBARTOP
Definition: vssym32.h:563

Referenced by Lock(), and OnNcCalcSize().

◆ AlignControls()

VOID CTrayWindow::AlignControls ( IN PRECT prcClient  OPTIONAL)
inline

Definition at line 1675 of file traywnd.cpp.

1676 {
1677 RECT rcClient;
1678 SIZE TraySize, StartSize;
1679 POINT ptTrayNotify = { 0, 0 };
1680 BOOL Horizontal;
1681 HDWP dwp;
1682
1684 if (prcClient != NULL)
1685 {
1686 rcClient = *prcClient;
1687 }
1688 else
1689 {
1690 if (!GetClientRect(&rcClient))
1691 {
1692 ERR("Could not get client rect lastErr=%d\n", GetLastError());
1693 return;
1694 }
1695 }
1696
1697 Horizontal = IsPosHorizontal();
1698
1699 /* We're about to resize/move the start button, the rebar control and
1700 the tray notification control */
1701 dwp = BeginDeferWindowPos(4);
1702 if (dwp == NULL)
1703 {
1704 ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1705 return;
1706 }
1707
1708 /* Limit the Start button width to the client width, if necessary */
1709 StartSize = m_StartButton.GetSize();
1710 if (StartSize.cx > rcClient.right)
1711 StartSize.cx = rcClient.right;
1712
1713 HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1714 if (hwndTaskToolbar)
1715 {
1716 DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1717
1718 /* Themed button covers Edge area as well */
1719 StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0);
1720 }
1721
1722 if (m_StartButton.m_hWnd != NULL)
1723 {
1724 /* Resize and reposition the button */
1725 dwp = m_StartButton.DeferWindowPos(dwp,
1726 NULL,
1727 0,
1728 0,
1729 StartSize.cx,
1730 StartSize.cy,
1732 if (dwp == NULL)
1733 {
1734 ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1735 return;
1736 }
1737 }
1738
1739 /* Determine the size that the tray notification window needs */
1740 if (Horizontal)
1741 {
1742 TraySize.cx = 0;
1743 TraySize.cy = rcClient.bottom;
1744 }
1745 else
1746 {
1747 TraySize.cx = rcClient.right;
1748 TraySize.cy = 0;
1749 }
1750
1751 if (m_TrayNotify != NULL &&
1754 (WPARAM)Horizontal,
1755 (LPARAM)&TraySize))
1756 {
1757 /* Move the tray notification window to the desired location */
1758 if (Horizontal)
1759 ptTrayNotify.x = rcClient.right - TraySize.cx;
1760 else
1761 ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1762
1763 dwp = ::DeferWindowPos(dwp,
1765 NULL,
1766 ptTrayNotify.x,
1767 ptTrayNotify.y,
1768 TraySize.cx,
1769 TraySize.cy,
1771 if (dwp == NULL)
1772 {
1773 ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1774 return;
1775 }
1776 }
1777
1778 /* Resize/Move the rebar control */
1779 if (m_Rebar != NULL)
1780 {
1781 POINT ptRebar = { 0, 0 };
1782 SIZE szRebar;
1783
1784 SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1785
1786 if (Horizontal)
1787 {
1788 ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1789 szRebar.cx = ptTrayNotify.x - ptRebar.x;
1790 szRebar.cy = rcClient.bottom;
1791 }
1792 else
1793 {
1794 ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1795 szRebar.cx = rcClient.right;
1796 szRebar.cy = ptTrayNotify.y - ptRebar.y;
1797 }
1798
1799 dwp = ::DeferWindowPos(dwp,
1800 m_Rebar,
1801 NULL,
1802 ptRebar.x,
1803 ptRebar.y,
1804 szRebar.cx,
1805 szRebar.cy,
1807 }
1808
1809 if (dwp != NULL)
1810 EndDeferWindowPos(dwp);
1811
1812 if (m_TaskSwitch != NULL)
1813 {
1814 /* Update the task switch window configuration */
1816 }
1817 }
#define ERR(fmt,...)
Definition: precomp.h:57
#define TSWM_UPDATETASKBARPOS
Definition: precomp.h:396
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:379
HDWP DeferWindowPos(HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
Definition: atlwin.h:456
HWND m_hWnd
Definition: atlwin.h:273
SIZE GetSize()
Definition: traywnd.cpp:203
VOID UpdateSize()
Definition: traywnd.cpp:208
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1211
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: traywnd.cpp:3545
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define SetWindowStyle(hwnd, val)
Definition: utility.h:153
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1160
#define CCS_VERT
Definition: commctrl.h:2254
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define HIWORD(l)
Definition: typedefs.h:247
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SM_CYEDGE
Definition: winuser.h:1020
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SendMessage
Definition: winuser.h:5928
#define SM_CXSIZEFRAME
Definition: winuser.h:1004
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define GW_CHILD
Definition: winuser.h:774
#define SWP_NOZORDER
Definition: winuser.h:1258
#define SM_CYSIZEFRAME
Definition: winuser.h:1006
int WINAPI GetSystemMetrics(_In_ int)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HDWP WINAPI BeginDeferWindowPos(_In_ int)

Referenced by OnSettingChanged(), OnSize(), and Open().

◆ ApplyClipping()

VOID CTrayWindow::ApplyClipping ( IN BOOL  Clip)
inline

Definition at line 1486 of file traywnd.cpp.

1487 {
1488 RECT rcClip, rcWindow;
1489 HRGN hClipRgn;
1490
1491 if (GetWindowRect(&rcWindow))
1492 {
1493 /* Disable clipping on systems with only one monitor */
1495 Clip = FALSE;
1496
1497 if (Clip)
1498 {
1499 rcClip = rcWindow;
1500
1501 GetScreenRect(m_Monitor, &rcClip);
1502
1503 if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1504 {
1505 rcClip = rcWindow;
1506 }
1507
1508 OffsetRect(&rcClip,
1509 -rcWindow.left,
1510 -rcWindow.top);
1511
1512 hClipRgn = CreateRectRgnIndirect(&rcClip);
1513 }
1514 else
1515 hClipRgn = NULL;
1516
1517 /* Set the clipping region or make sure the window isn't clipped
1518 by disabling it explicitly. */
1519 SetWindowRgn(hClipRgn, TRUE);
1520 }
1521 }
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1098
#define FALSE
Definition: types.h:117
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
int WINAPI SetWindowRgn(_In_ HWND, _In_opt_ HRGN, _In_ BOOL)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define SM_CMONITORS
Definition: winuser.h:1051

Referenced by CheckTrayWndPosition(), Lock(), OnEnterSizeMove(), and OnSize().

◆ CalculateValidSize()

HMONITOR CTrayWindow::CalculateValidSize ( IN DWORD  Position,
IN OUT RECT pRect 
)
inline

Definition at line 1216 of file traywnd.cpp.

1219 {
1220 RECT rcScreen;
1221 //BOOL Horizontal;
1222 HMONITOR hMon;
1223 SIZE szMax, szWnd;
1224
1225 //Horizontal = IsPosHorizontal();
1226
1227 szWnd.cx = pRect->right - pRect->left;
1228 szWnd.cy = pRect->bottom - pRect->top;
1229
1230 rcScreen = *pRect;
1231 hMon = GetScreenRectFromRect(
1232 &rcScreen,
1233 MONITOR_DEFAULTTONEAREST);
1234
1235 /* Calculate the maximum size of the tray window and limit the window
1236 size to half of the screen's size. */
1237 szMax.cx = (rcScreen.right - rcScreen.left) / 2;
1238 szMax.cy = (rcScreen.bottom - rcScreen.top) / 2;
1239 if (szWnd.cx > szMax.cx)
1240 szWnd.cx = szMax.cx;
1241 if (szWnd.cy > szMax.cy)
1242 szWnd.cy = szMax.cy;
1243
1244 /* FIXME - calculate */
1245
1247 &rcScreen,
1248 &szWnd,
1249 pRect);
1250
1251 return hMon;
1252 }
HMONITOR GetScreenRectFromRect(IN OUT RECT *pRect, IN DWORD dwFlags)
Definition: traywnd.cpp:1046
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1190
static COORD Position
Definition: mouse.c:34

Referenced by FitToRebar().

◆ ChangingWinPos()

VOID CTrayWindow::ChangingWinPos ( IN OUT LPWINDOWPOS  pwp)
inline

Definition at line 1393 of file traywnd.cpp.

1394 {
1395 RECT rcTray;
1396
1397 if (IsDragging)
1398 {
1399 rcTray.left = pwp->x;
1400 rcTray.top = pwp->y;
1401 rcTray.right = rcTray.left + pwp->cx;
1402 rcTray.bottom = rcTray.top + pwp->cy;
1403
1404 if (!EqualRect(&rcTray,
1406 {
1407 /* Recalculate the rectangle, the user dragged the tray
1408 window to another monitor or the window was somehow else
1409 moved or resized */
1411 &rcTray,
1413 //m_TrayRects[DraggingPosition] = rcTray;
1414 }
1415
1416 //Monitor = CalculateValidSize(DraggingPosition,
1417 // &rcTray);
1418
1423 IsDragging = FALSE;
1424
1425 m_TrayRects[m_Position] = rcTray;
1426 goto ChangePos;
1427 }
1428 else if (GetWindowRect(&rcTray))
1429 {
1430 if (InSizeMove)
1431 {
1432 if (!(pwp->flags & SWP_NOMOVE))
1433 {
1434 rcTray.left = pwp->x;
1435 rcTray.top = pwp->y;
1436 }
1437
1438 if (!(pwp->flags & SWP_NOSIZE))
1439 {
1440 rcTray.right = rcTray.left + pwp->cx;
1441 rcTray.bottom = rcTray.top + pwp->cy;
1442 }
1443
1445
1446 if (!(pwp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
1447 {
1448 SIZE szWnd;
1449
1450 szWnd.cx = pwp->cx;
1451 szWnd.cy = pwp->cy;
1452
1453 MakeTrayRectWithSize(m_Position, &szWnd, &rcTray);
1454 }
1455
1456 m_TrayRects[m_Position] = rcTray;
1457 }
1458 else if (m_Position != (DWORD)-1)
1459 {
1460 /* If the user isn't resizing the tray window we need to make sure the
1461 new size or position is valid. this is to prevent changes to the window
1462 without user interaction. */
1463 rcTray = m_TrayRects[m_Position];
1464
1465 if (IsAutoHideState())
1466 {
1467 rcTray.left += m_AutoHideOffset.cx;
1468 rcTray.right += m_AutoHideOffset.cx;
1469 rcTray.top += m_AutoHideOffset.cy;
1470 rcTray.bottom += m_AutoHideOffset.cy;
1471 }
1472 }
1473
1474ChangePos:
1475 m_TraySize.cx = rcTray.right - rcTray.left;
1476 m_TraySize.cy = rcTray.bottom - rcTray.top;
1477
1478 pwp->flags &= ~(SWP_NOMOVE | SWP_NOSIZE);
1479 pwp->x = rcTray.left;
1480 pwp->y = rcTray.top;
1481 pwp->cx = m_TraySize.cx;
1482 pwp->cy = m_TraySize.cy;
1483 }
1484 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
DWORD InSizeMove
Definition: traywnd.cpp:362
BOOL IsAutoHideState() const override
Definition: traywnd.cpp:3583
DWORD IsDragging
Definition: traywnd.cpp:363
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1165
DWORD GetDraggingRectFromRect(IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1375
TW_STRUCKRECTS2 sr
Definition: precomp.h:227
DWORD Position
Definition: precomp.h:212
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SWP_NOSIZE
Definition: winuser.h:1256
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)

Referenced by OnWindowPosChanging().

◆ CheckTrayWndPosition()

VOID CTrayWindow::CheckTrayWndPosition ( )
inline

Definition at line 1575 of file traywnd.cpp.

1576 {
1577 /* Force the rebar bands to resize */
1579 IID_IDeskBand,
1581 0,
1582 NULL,
1583 NULL);
1584
1585 /* Calculate the size of the taskbar based on the rebar */
1587
1588 /* Move the tray window */
1589 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1590 * and position we use here with m_TrayRects */
1595 }
VOID ResizeWorkArea()
Definition: traywnd.cpp:1523
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1819
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:354
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1486
HRESULT WINAPI IUnknown_Exec(IUnknown *lpUnknown, REFGUID pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: ordinal.c:1087
@ DBID_BANDINFOCHANGED
Definition: shobjidl.idl:2532
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define RDW_ERASE
Definition: winuser.h:1222
#define RDW_ALLCHILDREN
Definition: winuser.h:1232
#define RDW_FRAME
Definition: winuser.h:1223
#define RDW_INTERNALPAINT
Definition: winuser.h:1224
#define RDW_INVALIDATE
Definition: winuser.h:1225

Referenced by OnDisplayChange(), OnSettingChanged(), OnTaskbarSettingsChanged(), and Open().

◆ Close()

HRESULT STDMETHODCALLTYPE CTrayWindow::Close ( )
inline

Definition at line 2161 of file traywnd.cpp.

2162 {
2163 if (m_hWnd != NULL)
2164 {
2167 0,
2168 0);
2169 }
2170
2171 return S_OK;
2172 }
#define S_OK
Definition: intsafe.h:52
#define WM_APP_TRAYDESTROY
Definition: traywnd.cpp:15

◆ ContextSensitiveHelp()

STDMETHODIMP CTrayWindow::ContextSensitiveHelp ( BOOL  fEnterMode)
inlineoverride

Implements IOleWindow.

Definition at line 3554 of file traywnd.cpp.

3555 {
3556 return E_NOTIMPL;
3557 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DisplayProperties()

HWND STDMETHODCALLTYPE CTrayWindow::DisplayProperties ( )
inline

Definition at line 578 of file traywnd.cpp.

579 {
580 HWND hTrayProp;
581
583 {
585 if (hTrayProp != NULL &&
586 hTrayProp != m_TrayPropertiesOwner)
587 {
588 SetForegroundWindow(hTrayProp);
589 return NULL;
590 }
591 }
592
594 return NULL;
595 }
HWND GetLastActivePopup() const
Definition: atlwin.h:676
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:571
#define CloseHandle
Definition: compat.h:739
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
BOOL WINAPI SetForegroundWindow(_In_ HWND)

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ DisplayRunFileDlg()

void CTrayWindow::DisplayRunFileDlg ( )
inline

Definition at line 525 of file traywnd.cpp.

526 {
527 HWND hRunDlg;
529 {
531 if (hRunDlg != NULL &&
532 hRunDlg != m_RunFileDlgOwner)
533 {
534 SetForegroundWindow(hRunDlg);
535 return;
536 }
537 }
538
540 }
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:519

Referenced by HandleCommand(), and HandleHotKey().

◆ DoExitWindows()

LRESULT CTrayWindow::DoExitWindows ( )
inline

Definition at line 463 of file traywnd.cpp.

464 {
465 SaveState();
466
467 /* Display the ReactOS Shutdown Dialog */
469
470 /*
471 * If the user presses CTRL+ALT+SHIFT while exiting
472 * the shutdown dialog, exit the shell cleanly.
473 */
474 if ((GetKeyState(VK_CONTROL) & 0x8000) &&
475 (GetKeyState(VK_SHIFT) & 0x8000) &&
476 (GetKeyState(VK_MENU) & 0x8000))
477 {
478 PostMessage(WM_QUIT, 0, 0);
479 }
480 return 0;
481 }
void SaveState()
Definition: traywnd.cpp:452
void WINAPI ExitWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1597
#define WM_QUIT
Definition: winuser.h:1642
#define VK_CONTROL
Definition: winuser.h:2222
#define PostMessage
Definition: winuser.h:5917
#define VK_SHIFT
Definition: winuser.h:2221
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2223

Referenced by HandleCommand(), OnDoExitWindows(), and OnSysCommand().

◆ DrawShowDesktopButton()

void CTrayWindow::DrawShowDesktopButton ( )
inline

Definition at line 2511 of file traywnd.cpp.

2512 {
2513 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2514 return;
2516 }
#define RDW_UPDATENOW
Definition: winuser.h:1231
#define RDW_ERASENOW
Definition: winuser.h:1230

Referenced by OnNcActivate(), and OnNcPaint().

◆ DrawSizerWithTheme()

int CTrayWindow::DrawSizerWithTheme ( IN HRGN  hRgn)
inline

Definition at line 2080 of file traywnd.cpp.

2081 {
2082 HDC hdc;
2083 RECT rect;
2085 SIZE size;
2086
2088
2091 return 0;
2092
2094 OffsetRect(&rect, -rect.left, -rect.top);
2095
2096 hdc = GetWindowDC();
2097
2098 switch (m_Position)
2099 {
2100 case ABE_LEFT:
2101 rect.left = rect.right - size.cx;
2102 break;
2103 case ABE_TOP:
2104 rect.top = rect.bottom - size.cy;
2105 break;
2106 case ABE_RIGHT:
2107 rect.right = rect.left + size.cx;
2108 break;
2109 case ABE_BOTTOM:
2110 default:
2111 rect.bottom = rect.top + size.cy;
2112 break;
2113 }
2114
2115 DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2116
2117 ReleaseDC(hdc);
2118 return 0;
2119 }
HDC GetWindowDC()
Definition: atlwin.h:784
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
#define ASSERT(a)
Definition: mode.c:44
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
& rect
Definition: startmenu.cpp:1413
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)

Referenced by OnNcPaint().

◆ EraseBackgroundWithTheme()

LRESULT CTrayWindow::EraseBackgroundWithTheme ( HDC  hdc)
inline

Definition at line 2064 of file traywnd.cpp.

2065 {
2066 RECT rect;
2068
2070
2071 if (m_Theme)
2072 {
2074 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2075 }
2076
2077 return 0;
2078 }
@ TBP_BACKGROUNDLEFT
Definition: vssym32.h:560
@ TBP_BACKGROUNDRIGHT
Definition: vssym32.h:558
@ TBP_BACKGROUNDTOP
Definition: vssym32.h:559
@ TBP_BACKGROUNDBOTTOM
Definition: vssym32.h:557

Referenced by OnEraseBackground().

◆ ExecContextMenuCmd()

BOOL STDMETHODCALLTYPE CTrayWindow::ExecContextMenuCmd ( IN UINT  uiCmd)
inline

Definition at line 637 of file traywnd.cpp.

638 {
639 switch (uiCmd)
640 {
643 break;
644
647 TEXT("open"));
648 break;
649
652 TEXT("explore"));
653 break;
654
655 case ID_LOCKTASKBAR:
657 break;
658
661 break;
662
665 break;
666
668 ShowDesktop();
669 break;
670
673 if (g_Arrangement == NONE)
674 {
676 }
680 break;
681
684 if (g_Arrangement == NONE)
685 {
687 }
691 break;
692
695 if (g_Arrangement == NONE)
696 {
698 }
702 break;
703
706 break;
707
709 //FIXME: Use SHRunControlPanel
710 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
711 break;
712
714 RestoreAll();
715 break;
716
717 default:
718 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
719 return FALSE;
720 }
721
722 return TRUE;
723 }
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define ID_SHELL_CMD_OPEN_TASKMGR
Definition: resource.h:215
#define ID_SHELL_CMD_CUST_NOTIF
Definition: resource.h:221
#define ID_SHELL_CMD_UNDO_ACTION
Definition: resource.h:216
#define ID_SHELL_CMD_PROPERTIES
Definition: resource.h:211
#define ID_SHELL_CMD_TILE_WND_H
Definition: resource.h:219
#define ID_SHELL_CMD_CASCADE_WND
Definition: resource.h:220
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:223
#define ID_SHELL_CMD_TILE_WND_V
Definition: resource.h:218
#define ID_LOCKTASKBAR
Definition: resource.h:214
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:217
#define ID_SHELL_CMD_EXPLORE_ALL_USERS
Definition: resource.h:213
#define ID_SHELL_CMD_ADJUST_DAT
Definition: resource.h:222
#define ID_SHELL_CMD_OPEN_ALL_USERS
Definition: resource.h:212
void OnAppBarNotifyAll(_In_opt_ HMONITOR hMon, _In_opt_ HWND hwndIgnore, _In_ DWORD dwNotify, _In_opt_ LPARAM lParam)
Definition: appbar.cpp:207
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:615
VOID ShowDesktop()
Definition: traywnd.cpp:3145
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:776
VOID RestoreAll()
Definition: traywnd.cpp:3150
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:578
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:597
#define TEXT(s)
Definition: k32.h:28
VOID ShowCustomizeNotifyIcons(HINSTANCE hInst, HWND hExplorer)
#define L(x)
Definition: ntvdm.h:50
#define ABN_WINDOWARRANGE
Definition: shellapi.h:75
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2516
#define TRACE(s)
Definition: solgame.cpp:4
enum @122 g_Arrangement
VOID RestoreWindowPos()
Definition: traywnd.cpp:74
VOID BackupWindowPos()
Definition: traywnd.cpp:69
@ TILED
Definition: traywnd.cpp:45
@ NONE
Definition: traywnd.cpp:45
@ CASCADED
Definition: traywnd.cpp:45
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:942
WORD WINAPI CascadeWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
WORD WINAPI TileWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
#define MDITILE_SKIPDISABLED
Definition: winuser.h:2206
#define MDITILE_HORIZONTAL
Definition: winuser.h:2207
#define MDITILE_VERTICAL
Definition: winuser.h:2208
#define SW_NORMAL
Definition: winuser.h:780

◆ ExecResourceCmd()

HRESULT CTrayWindow::ExecResourceCmd ( int  id)
inline

Definition at line 428 of file traywnd.cpp.

429 {
430 WCHAR szCommand[256];
431 WCHAR *pszParameters;
432
434 id,
435 szCommand,
436 _countof(szCommand)))
437 {
438 return E_FAIL;
439 }
440
441 pszParameters = wcschr(szCommand, L'>');
442 if (pszParameters)
443 {
444 *pszParameters = 0;
445 pszParameters++;
446 }
447
448 ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
449 return S_OK;
450 }
#define E_FAIL
Definition: ddrawi.h:102
#define wcschr
Definition: compat.h:17
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
Definition: string.c:1220
#define _countof(array)
Definition: sndvol32.h:70
#define SW_SHOWNORMAL
Definition: winuser.h:781
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by HandleCommand(), and HandleHotKey().

◆ FitToRebar()

void CTrayWindow::FitToRebar ( PRECT  pRect)
inline

Definition at line 1819 of file traywnd.cpp.

1820 {
1821 /* Get the rect of the rebar */
1822 RECT rebarRect, taskbarRect, clientRect;
1823 ::GetWindowRect(m_Rebar, &rebarRect);
1824 ::GetWindowRect(m_hWnd, &taskbarRect);
1825 ::GetClientRect(m_hWnd, &clientRect);
1826 OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1827
1828 /* Calculate the difference of size of the taskbar and the rebar */
1829 SIZE margins;
1830 margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1831 margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1832
1833 /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1834 switch (m_Position)
1835 {
1836 case ABE_TOP:
1837 rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1839 pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1840 break;
1841 case ABE_BOTTOM:
1842 rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1844 pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1845 break;
1846 case ABE_LEFT:
1847 rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1849 pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1850 break;
1851 case ABE_RIGHT:
1852 rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1854 pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1855 break;
1856 }
1857
1859 }
static RECT margins
Definition: print.c:55
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1216
#define RBSTR_CHANGERECT
Definition: commctrl.h:1596
#define RB_SIZETORECT
Definition: commctrl.h:1598

Referenced by CheckTrayWndPosition(), OnExitSizeMove(), and OnSizing().

◆ GetCommandString()

HRESULT STDMETHODCALLTYPE CTrayWindow::GetCommandString ( UINT_PTR  idCmd,
UINT  uType,
UINT pwReserved,
LPSTR  pszName,
UINT  cchMax 
)
inline

Implements IContextMenu.

Definition at line 2284 of file traywnd.cpp.

2289 {
2290 if (!m_ContextMenu)
2291 return E_INVALIDARG;
2292
2293 return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2294 }
UINT cchMax
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:323
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ GetDesktopWnd()

HWND CTrayWindow::GetDesktopWnd ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3591 of file traywnd.cpp.

3591{ return m_DesktopWnd; }

◆ GetDraggingRectFromPt()

DWORD CTrayWindow::GetDraggingRectFromPt ( IN POINT  pt,
OUT RECT pRect,
OUT HMONITOR phMonitor 
)
inline

Definition at line 1273 of file traywnd.cpp.

1277 {
1278 HMONITOR hMon, hMonNew;
1279 DWORD PosH, PosV, Pos;
1280 SIZE DeltaPt, ScreenOffset;
1281 RECT rcScreen;
1282
1283 rcScreen.left = 0;
1284 rcScreen.top = 0;
1285
1286 /* Determine the screen rectangle */
1287 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONULL);
1288 if (hMon != NULL)
1289 {
1291
1292 mi.cbSize = sizeof(mi);
1293 if (!GetMonitorInfo(hMon, &mi))
1294 {
1295 hMon = NULL;
1296 goto GetPrimaryScreenRect;
1297 }
1298
1299 /* make left top corner of the screen zero based to
1300 make calculations easier */
1301 pt.x -= mi.rcMonitor.left;
1302 pt.y -= mi.rcMonitor.top;
1303
1304 ScreenOffset.cx = mi.rcMonitor.left;
1305 ScreenOffset.cy = mi.rcMonitor.top;
1306 rcScreen.right = mi.rcMonitor.right - mi.rcMonitor.left;
1307 rcScreen.bottom = mi.rcMonitor.bottom - mi.rcMonitor.top;
1308 }
1309 else
1310 {
1311GetPrimaryScreenRect:
1312 ScreenOffset.cx = 0;
1313 ScreenOffset.cy = 0;
1316 }
1317
1318 /* Calculate the nearest screen border */
1319 if (pt.x < rcScreen.right / 2)
1320 {
1321 DeltaPt.cx = pt.x;
1322 PosH = ABE_LEFT;
1323 }
1324 else
1325 {
1326 DeltaPt.cx = rcScreen.right - pt.x;
1327 PosH = ABE_RIGHT;
1328 }
1329
1330 if (pt.y < rcScreen.bottom / 2)
1331 {
1332 DeltaPt.cy = pt.y;
1333 PosV = ABE_TOP;
1334 }
1335 else
1336 {
1337 DeltaPt.cy = rcScreen.bottom - pt.y;
1338 PosV = ABE_BOTTOM;
1339 }
1340
1341 Pos = (DeltaPt.cx * rcScreen.bottom < DeltaPt.cy * rcScreen.right) ? PosH : PosV;
1342
1343 /* Fix the screen origin to be relative to the primary monitor again */
1344 OffsetRect(&rcScreen,
1345 ScreenOffset.cx,
1346 ScreenOffset.cy);
1347
1348 RECT rcPos = m_TrayRects[Pos];
1349
1350 hMonNew = GetMonitorFromRect(&rcPos);
1351 if (hMon != hMonNew)
1352 {
1353 SIZE szTray;
1354
1355 /* Recalculate the rectangle, we're dragging to another monitor.
1356 We don't need to recalculate the rect on single monitor systems. */
1357 szTray.cx = rcPos.right - rcPos.left;
1358 szTray.cy = rcPos.bottom - rcPos.top;
1359
1360 GetTrayRectFromScreenRect(Pos, &rcScreen, &szTray, pRect);
1361 hMon = hMonNew;
1362 }
1363 else
1364 {
1365 /* The user is dragging the tray window on the same monitor. We don't need
1366 to recalculate the rectangle */
1367 *pRect = rcPos;
1368 }
1369
1370 *phMonitor = hMon;
1371
1372 return Pos;
1373 }
HMONITOR GetMonitorFromRect(IN const RECT *pRect)
Definition: traywnd.cpp:1073
ush Pos
Definition: deflate.h:92
#define pt(x, y)
Definition: drawing.c:79
static MONITORINFO mi
Definition: win.c:7338
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
RECT rcMonitor
Definition: winuser.h:3861
DWORD cbSize
Definition: winuser.h:3860
#define GetMonitorInfo
Definition: winuser.h:5876
#define SM_CYSCREEN
Definition: winuser.h:971
#define SM_CXSCREEN
Definition: winuser.h:970

Referenced by GetDraggingRectFromRect(), and OnMoving().

◆ GetDraggingRectFromRect()

DWORD CTrayWindow::GetDraggingRectFromRect ( IN OUT RECT pRect,
OUT HMONITOR phMonitor 
)
inline

Definition at line 1375 of file traywnd.cpp.

1378 {
1379 POINT pt;
1380
1381 /* Calculate the center of the rectangle. We call
1382 GetDraggingRectFromPt to calculate a valid
1383 dragging rectangle */
1384 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1385 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1386
1387 return GetDraggingRectFromPt(
1388 pt,
1389 pRect,
1390 phMonitor);
1391 }
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1273

Referenced by ChangingWinPos().

◆ GetHWND()

HWND STDMETHODCALLTYPE CTrayWindow::GetHWND ( )
inline

Definition at line 2174 of file traywnd.cpp.

2175 {
2176 return m_hWnd;
2177 }

◆ GetMonitor()

HMONITOR & CTrayWindow::GetMonitor ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3586 of file traywnd.cpp.

3586{ return m_Monitor; }

◆ GetMonitorFromRect()

HMONITOR CTrayWindow::GetMonitorFromRect ( IN const RECT pRect)
inline

Definition at line 1073 of file traywnd.cpp.

1075 {
1076 HMONITOR hMon;
1077
1078 /* In case the monitor sizes or saved sizes differ a bit (probably
1079 not a lot, only so the tray window overlaps into another monitor
1080 now), minimize the risk that we determine a wrong monitor by
1081 using the center point of the tray window if we can't determine
1082 it using the rectangle. */
1083 hMon = MonitorFromRect(pRect, MONITOR_DEFAULTTONULL);
1084 if (hMon == NULL)
1085 {
1086 POINT pt;
1087
1088 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1089 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1090
1091 /* be less error-prone, find the nearest monitor */
1092 hMon = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST);
1093 }
1094
1095 return hMon;
1096 }
HMONITOR WINAPI MonitorFromRect(LPCRECT, DWORD)

Referenced by GetDraggingRectFromPt(), GetScreenRect(), and RegLoadSettings().

◆ GetPosition()

INT CTrayWindow::GetPosition ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3588 of file traywnd.cpp.

3588{ return m_Position; }

◆ GetPreviousMonitor()

HMONITOR & CTrayWindow::GetPreviousMonitor ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3587 of file traywnd.cpp.

3587{ return m_PreviousMonitor; }

◆ GetScreenRect()

HMONITOR CTrayWindow::GetScreenRect ( IN HMONITOR  hMonitor,
IN OUT RECT pRect 
)
inline

Definition at line 1098 of file traywnd.cpp.

1101 {
1102 HMONITOR hMon = NULL;
1103
1104 if (hMonitor != NULL)
1105 {
1107
1108 mi.cbSize = sizeof(mi);
1109 if (!GetMonitorInfo(hMonitor, &mi))
1110 {
1111 /* Hm, the monitor is gone? Try to find a monitor where it
1112 could be located now */
1113 hMon = GetMonitorFromRect(pRect);
1114 if (hMon == NULL ||
1115 !GetMonitorInfo(hMon, &mi))
1116 {
1117 hMon = NULL;
1118 goto GetPrimaryRect;
1119 }
1120 }
1121
1122 *pRect = mi.rcMonitor;
1123 }
1124 else
1125 {
1126GetPrimaryRect:
1127 pRect->left = 0;
1128 pRect->top = 0;
1129 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1130 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1131 }
1132
1133 return hMon;
1134 }

Referenced by ApplyClipping(), and ResizeWorkArea().

◆ GetScreenRectFromRect()

HMONITOR CTrayWindow::GetScreenRectFromRect ( IN OUT RECT pRect,
IN DWORD  dwFlags 
)
inline

Definition at line 1046 of file traywnd.cpp.

1049 {
1051 HMONITOR hMon;
1052
1053 mi.cbSize = sizeof(mi);
1054 hMon = MonitorFromRect(pRect, dwFlags);
1055 if (hMon != NULL &&
1056 GetMonitorInfo(hMon, &mi))
1057 {
1058 *pRect = mi.rcMonitor;
1059 }
1060 else
1061 {
1062 pRect->left = 0;
1063 pRect->top = 0;
1064 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1065 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1066
1067 hMon = NULL;
1068 }
1069
1070 return hMon;
1071 }
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by CalculateValidSize(), and RegLoadSettings().

◆ GetState()

CTrayWindow::GetState ( )
inlineoverride

Definition at line 3505 of file traywnd.cpp.

3506 {
3507 /* FIXME: Return ABS_ flags? */
3508 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3509 return 0;
3510 }

◆ GetTrayRect()

const RECT * CTrayWindow::GetTrayRect ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3589 of file traywnd.cpp.

3589{ return &m_TrayRects[m_Position]; }

◆ GetTrayRectFromScreenRect()

VOID CTrayWindow::GetTrayRectFromScreenRect ( IN DWORD  Position,
IN const RECT pScreen,
IN const SIZE *pTraySize  OPTIONAL,
OUT RECT pRect 
)
inline

Definition at line 1190 of file traywnd.cpp.

1194 {
1195 if (pTraySize == NULL)
1196 pTraySize = &m_TraySize;
1197
1198 *pRect = *pScreen;
1199
1200 if(!m_Theme)
1201 {
1202 /* Move the border outside of the screen */
1203 InflateRect(pRect,
1206 }
1207
1208 MakeTrayRectWithSize(Position, pTraySize, pRect);
1209 }
#define SM_CXEDGE
Definition: winuser.h:1019
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)

Referenced by CalculateValidSize(), GetDraggingRectFromPt(), and RegLoadSettings().

◆ GetTrayWindow()

STDMETHODIMP CTrayWindow::GetTrayWindow ( OUT HWND phWndTray)
inlineoverride

Definition at line 3513 of file traywnd.cpp.

3514 {
3515 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3516 *phWndTray = m_hWnd;
3517 return S_OK;
3518 }

◆ GetTrayWnd()

HWND CTrayWindow::GetTrayWnd ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3590 of file traywnd.cpp.

3590{ return m_hWnd; }

◆ GetWindow()

STDMETHODIMP CTrayWindow::GetWindow ( HWND phwnd)
inlineoverride

Implements IOleWindow.

Definition at line 3545 of file traywnd.cpp.

3546 {
3547 if (!phwnd)
3548 return E_INVALIDARG;
3549 *phwnd = m_hWnd;
3550 return S_OK;
3551 }

Referenced by AlignControls(), IsTaskWnd(), and MinimizeWindowsProc().

◆ HandleCommand()

LRESULT CTrayWindow::HandleCommand ( UINT  uCommand)
inline

Definition at line 776 of file traywnd.cpp.

777 {
778 switch (uCommand)
779 {
781 // TODO:
782 break;
786 break;
788 SaveState();
789 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
790 break;
791 case TRAYCMD_CASCADE:
793 break;
794 case TRAYCMD_TILE_H:
796 break;
797 case TRAYCMD_TILE_V:
799 break;
802 break;
804 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
805 break;
808 break;
810 MinimizeAll();
811 break;
813 RestoreAll();
814 break;
816 ShowDesktop();
817 break;
820 break;
822 break;
825 {
828 }
829 break;
832 break;
834 // TODO:
835 break;
838 break;
840 // TODO:
841 break;
843 // TODO:
844 break;
846 // TODO:
847 break;
848 case IDM_SEARCH:
851 break;
854 break;
855
856 default:
857 break;
858 }
859
860 return FALSE;
861 }
#define IDM_SEARCH
Definition: resource.h:77
#define IDS_HELP_COMMAND
Definition: resource.h:109
VOID ToggleDesktop()
Definition: traywnd.cpp:625
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:428
VOID HideStartMenu()
Definition: traywnd.cpp:725
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3127
LRESULT DoExitWindows()
Definition: traywnd.cpp:463
void DisplayRunFileDlg()
Definition: traywnd.cpp:525
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1534
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
Definition: utils.cpp:1148
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2468
@ REST_CLASSICSHELL
Definition: shlobj.h:1688
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:166
#define TRAYCMD_CONTROL_PANEL
Definition: undocshell.h:944
#define TRAYCMD_STARTMENU
Definition: undocshell.h:928
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:947
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:935
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:950
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:936
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:939
#define TRAYCMD_TILE_V
Definition: undocshell.h:933
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:949
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:941
#define TRAYCMD_TILE_H
Definition: undocshell.h:932
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:934
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:929
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:930
#define TRAYCMD_CASCADE
Definition: undocshell.h:931
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:940
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:938
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:945
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:946
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:937
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:948
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:943

Referenced by ExecContextMenuCmd(), and OnCommand().

◆ HandleHotKey()

LRESULT CTrayWindow::HandleHotKey ( DWORD  id)
inline

Definition at line 730 of file traywnd.cpp.

731 {
732 switch (id)
733 {
734 case IDHK_RUN:
737 break;
738 case IDHK_HELP:
740 break;
741 case IDHK_EXPLORE:
742 //FIXME: We don't support this yet:
743 //ShellExecuteW(0, L"explore", NULL, NULL, NULL, 1);
744 ShellExecuteW(0, NULL, L"explorer.exe", L"/e ,", NULL, 1);
745 break;
746 case IDHK_FIND:
748 break;
751 break;
753 //FIXME: Use SHRunControlPanel
754 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
755 break;
756 case IDHK_NEXT_TASK:
757 break;
758 case IDHK_PREV_TASK:
759 break;
761 MinimizeAll();
762 break;
763 case IDHK_RESTORE_ALL:
764 RestoreAll();
765 break;
766 case IDHK_DESKTOP:
768 break;
769 case IDHK_PAGER:
770 break;
771 }
772
773 return 0;
774 }
#define IDHK_NEXT_TASK
Definition: traywnd.cpp:39
#define IDHK_RUN
Definition: traywnd.cpp:32
#define IDHK_DESKTOP
Definition: traywnd.cpp:42
#define IDHK_EXPLORE
Definition: traywnd.cpp:36
#define IDHK_MINIMIZE_ALL
Definition: traywnd.cpp:33
#define IDHK_RESTORE_ALL
Definition: traywnd.cpp:34
#define IDHK_SYS_PROPERTIES
Definition: traywnd.cpp:41
#define IDHK_PREV_TASK
Definition: traywnd.cpp:40
#define IDHK_FIND
Definition: traywnd.cpp:37
#define IDHK_HELP
Definition: traywnd.cpp:35
#define IDHK_FIND_COMPUTER
Definition: traywnd.cpp:38
#define IDHK_PAGER
Definition: traywnd.cpp:43

Referenced by OnHotkey().

◆ HideStartMenu()

VOID CTrayWindow::HideStartMenu ( )
inline

Definition at line 725 of file traywnd.cpp.

726 {
727 m_StartMenuPopup->OnSelect(MPOS_CANCELLEVEL);
728 }
CComPtr< IMenuPopup > m_StartMenuPopup
Definition: traywnd.cpp:320

Referenced by HandleCommand(), HandleHotKey(), OnOpenStartMenu(), and OnSettingChanged().

◆ if()

CTrayWindow::if ( m_StartMenuBand = NULL)
inline

Definition at line 3382 of file traywnd.cpp.

3383 {
3384 MSG Msg;
3385 LRESULT lRet;
3386
3387 Msg.hwnd = m_hWnd;
3388 Msg.message = uMsg;
3389 Msg.wParam = wParam;
3390 Msg.lParam = lParam;
3391
3392 if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3393 {
3394 return lRet;
3395 }
3396
3397 wParam = Msg.wParam;
3398 lParam = Msg.lParam;
3399 }
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:319
WPARAM wParam
Definition: combotst.c:138
struct @1708 Msg[]
LPARAM lParam
Definition: combotst.c:139
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
LONG_PTR LRESULT
Definition: windef.h:209

◆ InvokeCommand()

HRESULT STDMETHODCALLTYPE CTrayWindow::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpici)
inline

Implements IContextMenu.

Definition at line 2276 of file traywnd.cpp.

2277 {
2278 if (!m_ContextMenu)
2279 return E_INVALIDARG;
2280
2281 return m_ContextMenu->InvokeCommand(lpici);
2282 }

◆ IsAlwaysOnTop()

BOOL CTrayWindow::IsAlwaysOnTop ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3585 of file traywnd.cpp.

DWORD AlwaysOnTop
Definition: precomp.h:207

◆ IsAutoHideState()

BOOL CTrayWindow::IsAutoHideState ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3583 of file traywnd.cpp.

3583{ return g_TaskbarSettings.sr.AutoHide; }
DWORD AutoHide
Definition: precomp.h:206

Referenced by ChangingWinPos(), OnCreate(), OnMouseMove(), and ResizeWorkArea().

◆ IsDialog()

static BOOL CTrayWindow::IsDialog ( HWND  hwnd)
inlinestatic

Definition at line 3092 of file traywnd.cpp.

3093 {
3094 WCHAR szClass[32];
3095 GetClassNameW(hwnd, szClass, _countof(szClass));
3096 return wcscmp(szClass, L"#32770") == 0;
3097 }
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)

Referenced by MinimizeWindowsProc().

◆ IsHidingState()

BOOL CTrayWindow::IsHidingState ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3584 of file traywnd.cpp.

3584{ return m_AutoHideState == AUTOHIDE_HIDING; }
#define AUTOHIDE_HIDING
Definition: traywnd.cpp:30

◆ IsHorizontal()

BOOL STDMETHODCALLTYPE CTrayWindow::IsHorizontal ( )
inline

Definition at line 2185 of file traywnd.cpp.

2186 {
2187 return IsPosHorizontal();
2188 }

◆ IsPointWithinShowDesktopButton()

BOOL CTrayWindow::IsPointWithinShowDesktopButton ( LPPOINT  ppt,
LPRECT  prcShowDesktopBtn,
PWINDOWINFO  pwi 
)
inline

Definition at line 2801 of file traywnd.cpp.

2802 {
2803 if (!ppt || !prcShowDesktopBtn)
2804 return FALSE;
2806
2807 switch (m_Position)
2808 {
2809 case ABE_LEFT:
2810 return !(ppt->x > prcShowDesktopBtn->right || ppt->y < prcShowDesktopBtn->top);
2811 case ABE_TOP:
2812 return !(ppt->x < prcShowDesktopBtn->left || ppt->y > prcShowDesktopBtn->bottom);
2813 case ABE_RIGHT:
2814 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2815 case ABE_BOTTOM:
2816 return !(ppt->x < prcShowDesktopBtn->left || ppt->y < prcShowDesktopBtn->top);
2817 }
2818 return FALSE;
2819 }
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:329

◆ IsPointWithinStartButton()

BOOL CTrayWindow::IsPointWithinStartButton ( LPPOINT  ppt,
LPRECT  prcStartBtn,
PWINDOWINFO  pwi 
)
inline

Definition at line 2758 of file traywnd.cpp.

2759 {
2760 if (!ppt || !prcStartBtn || !pwi)
2761 return FALSE;
2762
2763 switch (m_Position)
2764 {
2765 case ABE_TOP:
2766 case ABE_LEFT:
2767 {
2768 if (ppt->x > prcStartBtn->right || ppt->y > prcStartBtn->bottom)
2769 return FALSE;
2770 break;
2771 }
2772 case ABE_RIGHT:
2773 {
2774 if (ppt->x < prcStartBtn->left || ppt->y > prcStartBtn->bottom)
2775 return FALSE;
2776
2777 if (prcStartBtn->right + (int)pwi->cxWindowBorders * 2 + 1 < pwi->rcWindow.right &&
2778 ppt->x > prcStartBtn->right)
2779 {
2780 return FALSE;
2781 }
2782 break;
2783 }
2784 case ABE_BOTTOM:
2785 {
2786 if (ppt->x > prcStartBtn->right || ppt->y < prcStartBtn->top)
2787 return FALSE;
2788
2789 if (prcStartBtn->bottom + (int)pwi->cyWindowBorders * 2 + 1 < pwi->rcWindow.bottom &&
2790 ppt->y > prcStartBtn->bottom)
2791 {
2792 return FALSE;
2793 }
2794
2795 break;
2796 }
2797 }
2798 return TRUE;
2799 }
UINT cxWindowBorders
Definition: winuser.h:3848
UINT cyWindowBorders
Definition: winuser.h:3849
RECT rcWindow
Definition: winuser.h:3843

Referenced by OnNcLButtonDown().

◆ IsPosHorizontal()

BOOL CTrayWindow::IsPosHorizontal ( )
inline

Definition at line 1211 of file traywnd.cpp.

1212 {
1213 return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1214 }

Referenced by AlignControls(), and IsHorizontal().

◆ IsSpecialHWND()

BOOL STDMETHODCALLTYPE CTrayWindow::IsSpecialHWND ( IN HWND  hWnd)
inline

Definition at line 2179 of file traywnd.cpp.

2180 {
2181 return (m_hWnd == hWnd ||
2183 }
HWND hWnd
Definition: settings.c:17

Referenced by IsTaskWnd().

◆ IsTaskWnd()

BOOL STDMETHODCALLTYPE CTrayWindow::IsTaskWnd ( HWND  hWnd)
inline

Definition at line 2243 of file traywnd.cpp.

2244 {
2246 {
2248 if (((exStyle & WS_EX_APPWINDOW) || ::GetWindow(hWnd, GW_OWNER) == NULL) &&
2249 !(exStyle & WS_EX_TOOLWINDOW))
2250 {
2251 return TRUE;
2252 }
2253 }
2254 return FALSE;
2255 }
BOOL IsWindowVisible() const
Definition: atlwin.h:958
BOOL IsWindow() const
Definition: atlwin.h:947
BOOL STDMETHODCALLTYPE IsSpecialHWND(IN HWND hWnd)
Definition: traywnd.cpp:2179
#define GetWindowLongPtr
Definition: treelist.c:73
#define GW_OWNER
Definition: winuser.h:777
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define GWL_EXSTYLE
Definition: winuser.h:862

Referenced by RestoreMinimizedNonTaskWnds().

◆ Lock()

BOOL STDMETHODCALLTYPE CTrayWindow::Lock ( IN BOOL  bLock)
inline

Definition at line 2190 of file traywnd.cpp.

2191 {
2192 BOOL bPrevLock = g_TaskbarSettings.bLock;
2193
2194 if (g_TaskbarSettings.bLock != bLock)
2195 {
2196 g_TaskbarSettings.bLock = bLock;
2197
2198 if (m_TrayBandSite != NULL)
2199 {
2200 if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2201 {
2202 /* Reset?? */
2203 g_TaskbarSettings.bLock = bPrevLock;
2204 return bPrevLock;
2205 }
2206 }
2207
2208 if (m_Theme)
2209 {
2210 /* Update cached tray sizes */
2211 for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2212 {
2213 RECT rcGripper = {0};
2214 AdjustSizerRect(&rcGripper, Pos);
2215
2217 {
2218 m_TrayRects[Pos].top += rcGripper.top;
2219 m_TrayRects[Pos].left += rcGripper.left;
2220 m_TrayRects[Pos].bottom += rcGripper.bottom;
2221 m_TrayRects[Pos].right += rcGripper.right;
2222 }
2223 else
2224 {
2225 m_TrayRects[Pos].top -= rcGripper.top;
2226 m_TrayRects[Pos].left -= rcGripper.left;
2227 m_TrayRects[Pos].bottom -= rcGripper.bottom;
2228 m_TrayRects[Pos].right -= rcGripper.right;
2229 }
2230 }
2231 }
2235 }
2236
2237 return bPrevLock;
2238 }
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1136
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define SWP_NOOWNERZORDER
Definition: winuser.h:1260

◆ MakeTrayRectWithSize()

VOID CTrayWindow::MakeTrayRectWithSize ( IN DWORD  Position,
IN const SIZE pTraySize,
IN OUT RECT pRect 
)
inline

Definition at line 1165 of file traywnd.cpp.

1168 {
1169 switch (Position)
1170 {
1171 case ABE_LEFT:
1172 pRect->right = pRect->left + pTraySize->cx;
1173 break;
1174
1175 case ABE_TOP:
1176 pRect->bottom = pRect->top + pTraySize->cy;
1177 break;
1178
1179 case ABE_RIGHT:
1180 pRect->left = pRect->right - pTraySize->cx;
1181 break;
1182
1183 case ABE_BOTTOM:
1184 default:
1185 pRect->top = pRect->bottom - pTraySize->cy;
1186 break;
1187 }
1188 }

Referenced by ChangingWinPos(), and GetTrayRectFromScreenRect().

◆ MinimizeAll()

VOID CTrayWindow::MinimizeAll ( BOOL  bShowDesktop = FALSE)
inline

Definition at line 3127 of file traywnd.cpp.

3128 {
3129 IgnorePulse = TRUE;
3131
3132 MINIMIZE_INFO info;
3133 info.hwndDesktop = GetDesktopWindow();;
3134 info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
3135 info.hwndProgman = FindWindowW(L"Progman", NULL);
3136 info.pMinimizedAll = &g_MinimizedAll;
3137 info.bShowDesktop = bShowDesktop;
3139
3143 }
HWND SetFocus()
Definition: atlwin.h:1198
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:3099
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:170
#define TIMER_IGNOREPULSERESET_TIMEOUT
Definition: traywnd.cpp:2396
#define TIMER_ID_IGNOREPULSERESET
Definition: traywnd.cpp:2395
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
BOOL WINAPI EnumWindows(_In_ WNDENUMPROC lpEnumFunc, _In_ LPARAM lParam)
HWND WINAPI FindWindowW(_In_opt_ LPCWSTR, _In_opt_ LPCWSTR)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by HandleCommand(), HandleHotKey(), and ShowDesktop().

◆ MinimizeWindowsProc()

static BOOL CALLBACK CTrayWindow::MinimizeWindowsProc ( HWND  hwnd,
LPARAM  lParam 
)
inlinestatic

Definition at line 3099 of file traywnd.cpp.

3100 {
3101 MINIMIZE_INFO *info = (MINIMIZE_INFO *)lParam;
3102 if (hwnd == info->hwndDesktop || hwnd == info->hTrayWnd || hwnd == info->hwndProgman)
3103 return TRUE; // Ignore special windows
3104
3105 if (!info->bShowDesktop)
3106 {
3108 return TRUE;
3109 HWND hwndOwner = ::GetWindow(hwnd, GW_OWNER);
3110 if (hwndOwner && !::IsWindowEnabled(hwndOwner))
3111 return TRUE;
3112 }
3113
3114 if (CanBeMinimized(hwnd))
3115 {
3116 MINWNDPOS mwp = { hwnd, { sizeof(mwp.wndpl) } };
3117 if (::GetWindowPlacement(hwnd, &mwp.wndpl) && // Save the position and status
3119 {
3120 info->pMinimizedAll->Add(mwp);
3121 }
3122 }
3123
3124 return TRUE;
3125 }
BOOL IsWindowEnabled() const
Definition: atlwin.h:952
static BOOL IsDialog(HWND hwnd)
Definition: traywnd.cpp:3092
WINDOWPLACEMENT wndpl
Definition: traywnd.cpp:168
BOOL CanBeMinimized(HWND hwnd)
Definition: traywnd.cpp:86
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI ShowWindowAsync(_In_ HWND, _In_ int)
#define SW_SHOWMINNOACTIVE
Definition: winuser.h:788

Referenced by MinimizeAll().

◆ OnActivate()

LRESULT CTrayWindow::OnActivate ( INT  code,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3286 of file traywnd.cpp.

3287 {
3289 if (!wParam) // !(Activate || Minimized)
3290 {
3291 SendMessage(WM_CHANGEUISTATE, MAKELONG(UIS_SET, UISF_HIDEACCEL | UISF_HIDEFOCUS), 0);
3293 }
3294 return 0;
3295 }
void OnAppBarActivationChange2(_In_ HWND hwndNewAutoHide, _In_ UINT uSide)
Definition: appbar.cpp:475
HRESULT WINAPI IUnknown_UIActivateIO(IUnknown *unknown, BOOL activate, LPMSG msg)
Definition: ordinal.c:1633
#define MAKELONG(a, b)
Definition: typedefs.h:249

◆ OnAppTrayDestroy()

LRESULT CTrayWindow::OnAppTrayDestroy ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2990 of file traywnd.cpp.

2991 {
2992 DestroyWindow();
2993 return TRUE;
2994 }
BOOL DestroyWindow()
Definition: atlwin.h:462

◆ OnCommand()

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

Definition at line 3166 of file traywnd.cpp.

3167 {
3168 LRESULT Ret = FALSE;
3169
3171 {
3172 return FALSE;
3173 }
3174
3175 if (m_TrayBandSite == NULL || FAILED_UNEXPECTEDLY(m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret)))
3176 {
3177 return HandleCommand(LOWORD(wParam));
3178 }
3179 return Ret;
3180 }
#define LOWORD(l)
Definition: pedump.c:82

◆ OnContextMenu()

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

Definition at line 2859 of file traywnd.cpp.

2860 {
2861 LRESULT Ret = FALSE;
2862 POINT pt, *ppt = NULL;
2863 HWND hWndExclude = NULL;
2864
2865 /* Check if the administrator has forbidden access to context menus */
2867 return FALSE;
2868
2869 pt.x = (SHORT) LOWORD(lParam);
2870 pt.y = (SHORT) HIWORD(lParam);
2871
2872 if (pt.x != -1 || pt.y != -1)
2873 ppt = &pt;
2874 else
2875 hWndExclude = m_StartButton.m_hWnd;
2876
2878 {
2879 /* Make sure we can't track the context menu if the start
2880 menu is currently being shown */
2882 {
2883 CComPtr<IContextMenu> ctxMenu;
2885 TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
2886 }
2887 }
2888 else
2889 {
2890 /* See if the context menu should be handled by the task band site */
2891 if (ppt != NULL && m_TrayBandSite != NULL)
2892 {
2893 HWND hWndAtPt;
2894 POINT ptClient = *ppt;
2895
2896 /* Convert the coordinates to client-coordinates */
2897 ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
2898
2899 hWndAtPt = ChildWindowFromPoint(ptClient);
2900 if (hWndAtPt != NULL &&
2901 (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
2902 {
2903 /* Check if the user clicked on the task switch window */
2904 ptClient = *ppt;
2905 ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
2906
2908 if (hWndAtPt == m_TaskSwitch)
2909 goto HandleTrayContextMenu;
2910
2911 /* Forward the message to the task band site */
2912 m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2913 }
2914 else
2915 goto HandleTrayContextMenu;
2916 }
2917 else
2918 {
2919HandleTrayContextMenu:
2920 /* Tray the default tray window context menu */
2921 TrackCtxMenu(this, ppt, NULL, FALSE, this);
2922 }
2923 }
2924 return Ret;
2925 }
HRESULT CStartMenuBtnCtxMenu_CreateInstance(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
HRESULT TrackCtxMenu(IN IContextMenu *contextMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN PVOID Context OPTIONAL)
Definition: traywnd.cpp:935
short SHORT
Definition: pedump.c:59
@ REST_NOTRAYCONTEXTMENU
Definition: shlobj.h:1676
HWND WINAPI ChildWindowFromPoint(_In_ HWND, _In_ POINT)
#define BM_GETSTATE
Definition: winuser.h:1939
HWND WINAPI ChildWindowFromPointEx(_In_ HWND, _In_ POINT, _In_ UINT)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define CWP_SKIPDISABLED
Definition: winuser.h:209
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define BST_PUSHED
Definition: winuser.h:201
#define CWP_SKIPINVISIBLE
Definition: winuser.h:208

Referenced by OnNcRButtonUp().

◆ OnCopyData()

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

Definition at line 2493 of file traywnd.cpp.

2494 {
2496 if (!pCopyData)
2497 return FALSE;
2498
2499 switch (pCopyData->dwData)
2500 {
2501 case TABDMC_APPBAR:
2502 return OnAppBarMessage(pCopyData);
2503 case TABDMC_NOTIFY:
2504 case TABDMC_LOADINPROC:
2505 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2506 }
2507 return FALSE;
2508 }
LRESULT OnAppBarMessage(_Inout_ PCOPYDATASTRUCT pCopyData)
Definition: appbar.cpp:571
ULONG_PTR dwData
Definition: winuser.h:3077
#define TABDMC_APPBAR
Definition: undocshell.h:953
#define TABDMC_LOADINPROC
Definition: undocshell.h:955
#define TABDMC_NOTIFY
Definition: undocshell.h:954
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT

◆ OnCreate()

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

Definition at line 2300 of file traywnd.cpp.

2301 {
2302 HRESULT hRet;
2303
2304 ((ITrayWindow*)this)->AddRef();
2305
2306 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2307
2308 /* Create the Start button */
2310
2311 /* Load the saved tray window settings */
2313
2314 /* Create and initialize the start menu */
2318
2319 /* Create the task band */
2321 if (FAILED_UNEXPECTEDLY(hRet))
2322 return FALSE;
2323
2324 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2326 if (FAILED_UNEXPECTEDLY(hRet))
2327 return FALSE;
2328
2329 /* Create the tray notification window */
2331 if (FAILED_UNEXPECTEDLY(hRet))
2332 return FALSE;
2333
2334 /* Get the hwnd of the rebar */
2336 if (FAILED_UNEXPECTEDLY(hRet))
2337 return FALSE;
2338
2339 /* Get the hwnd of the tasks toolbar */
2341 if (FAILED_UNEXPECTEDLY(hRet))
2342 return FALSE;
2343
2344 /* Get the hwnd of the tray notification window */
2346 if (FAILED_UNEXPECTEDLY(hRet))
2347 return FALSE;
2348
2351 return FALSE;
2352
2353 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2354
2355 UpdateFonts();
2356
2358
2359 if (IsAutoHideState())
2360 {
2363 }
2364
2365 /* Set the initial lock state in the band site */
2367
2368 static const UINT winkeys[] =
2369 {
2382 };
2384 {
2385 for (UINT i = 0; i < _countof(winkeys); ++i)
2386 {
2387 UINT mod = HIBYTE(HIWORD(winkeys[i])), key = LOBYTE(HIWORD(winkeys[i]));
2388 RegisterHotKey(m_hWnd, LOWORD(winkeys[i]), mod, key);
2389 }
2390 }
2391
2392 return TRUE;
2393 }
std::map< E_MODULE, HMODULE > mod
Definition: LocaleTests.cpp:66
IMenuPopup * CreateStartMenu(IN ITrayWindow *Tray, OUT IMenuBand **ppMenuBand, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons)
Definition: startmnu.cpp:50
HRESULT CTrayNotifyWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayntfy.cpp:555
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand *pTaskBand, OUT ITrayBandSite **pBandSite)
Definition: tbsite.cpp:728
#define TNWM_GETSHOWDESKTOPBUTTON
Definition: precomp.h:381
HRESULT InitShellServices(HDPA *phdpa)
HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv)
Definition: taskband.cpp:348
#define IDB_STARTMENU
Definition: resource.h:44
HWND Create(HWND hwndParent)
Definition: traywnd.cpp:260
CComPtr< IDeskBand > m_TaskBand
Definition: traywnd.cpp:322
VOID RegLoadSettings()
Definition: traywnd.cpp:1597
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:333
void UpdateFonts()
Definition: traywnd.cpp:1015
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336
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 MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
ULONG AddRef()
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
static HBITMAP
Definition: button.c:44
unsigned int UINT
Definition: ndis.h:50
@ REST_NOWINKEYS
Definition: shlobj.h:1749
DWORD SmSmallIcons
Definition: precomp.h:208
Definition: copy.c:22
#define AUTOHIDE_DELAY_HIDE
Definition: traywnd.cpp:20
#define TIMER_ID_AUTOHIDE
Definition: traywnd.cpp:17
#define MAKEWORD(a, b)
Definition: typedefs.h:248
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
#define VK_TAB
Definition: winuser.h:2218
#define MOD_WIN
Definition: winuser.h:2663
#define VK_F1
Definition: winuser.h:2274
#define VK_PAUSE
Definition: winuser.h:2224
BOOL WINAPI RegisterHotKey(_In_opt_ HWND, _In_ int, _In_ UINT, _In_ UINT)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2500
#define IID_PPV_ARG(Itype, ppType)

◆ OnCtlColorBtn()

LRESULT CTrayWindow::OnCtlColorBtn ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2534 of file traywnd.cpp.

2535 {
2538 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TRANSPARENT
Definition: wingdi.h:950
#define HOLLOW_BRUSH
Definition: wingdi.h:899
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056

◆ OnDestroy()

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

Definition at line 2398 of file traywnd.cpp.

2399 {
2401 return 0;
2402 }

◆ OnDisplayChange()

LRESULT CTrayWindow::OnDisplayChange ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2479 of file traywnd.cpp.

2480 {
2481 /* Refresh workareas */
2483
2484 /* Load the saved tray window settings */
2486
2487 /* Move the tray window to the right position and resize it if necessary */
2489
2490 return TRUE;
2491 }
void RecomputeAllWorkareas()
Definition: appbar.cpp:449
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1575

◆ OnDoExitWindows()

LRESULT CTrayWindow::OnDoExitWindows ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3011 of file traywnd.cpp.

3012 {
3013 /*
3014 * TWM_DOEXITWINDOWS is send by the CDesktopBrowser to us
3015 * to show the shutdown dialog. Also a WM_CLOSE message sent
3016 * by apps should show the dialog.
3017 */
3018 return DoExitWindows();
3019 }

◆ OnEndSession()

LRESULT CTrayWindow::OnEndSession ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2404 of file traywnd.cpp.

2405 {
2406 if (wParam)
2407 SaveState();
2408 return 0;
2409 }

◆ OnEnterSizeMove()

LRESULT CTrayWindow::OnEnterSizeMove ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2669 of file traywnd.cpp.

2670 {
2671 InSizeMove = TRUE;
2672 IsDragging = FALSE;
2674 {
2675 /* Remove the clipping on multi monitor systems while dragging around */
2677 }
2679 return TRUE;
2680 }

◆ OnEraseBackground()

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

Definition at line 2466 of file traywnd.cpp.

2467 {
2468 HDC hdc = (HDC) wParam;
2469
2470 if (!m_Theme)
2471 {
2472 bHandled = FALSE;
2473 return 0;
2474 }
2475
2477 }
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2064

◆ OnExitSizeMove()

LRESULT CTrayWindow::OnExitSizeMove ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2682 of file traywnd.cpp.

2683 {
2684 InSizeMove = FALSE;
2686 {
2688
2689 /* Apply clipping */
2691 }
2692 return TRUE;
2693 }
#define WM_SIZE
Definition: winuser.h:1630
#define SIZE_RESTORED
Definition: winuser.h:2524

◆ OnGetTaskSwitch()

LRESULT CTrayWindow::OnGetTaskSwitch ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3032 of file traywnd.cpp.

3033 {
3034 bHandled = TRUE;
3035 return (LRESULT)m_TaskSwitch;
3036 }

◆ OnHotkey()

LRESULT CTrayWindow::OnHotkey ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3078 of file traywnd.cpp.

3079 {
3080 return HandleHotKey(wParam);
3081 }
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:730

◆ OnInitMenuPopup()

LRESULT CTrayWindow::OnInitMenuPopup ( INT  code,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3249 of file traywnd.cpp.

3250 {
3251 HMENU hMenu = (HMENU)wParam;
3253 {
3257 if (g_Arrangement != NONE)
3258 {
3261 MENUITEMINFOW mii = { sizeof(mii) };
3263 mii.fMask = MIIM_TYPE;
3264 mii.fType = MFT_STRING;
3265 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3267 }
3268 else
3269 {
3271 }
3272 }
3273 else
3274 {
3280 g_WindowPosBackup.RemoveAll();
3281 }
3282 return 0;
3283 }
#define IDS_TRAYWND_UNDO_TILE
Definition: resource.h:113
#define IDS_TRAYWND_UNDO_CASCADE
Definition: resource.h:112
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
LPWSTR dwTypeData
Definition: winuser.h:3345
CSimpleArray< WINDOWPOSBACKUPDATA > g_WindowPosBackup
Definition: traywnd.cpp:52
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:151
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define MFT_STRING
Definition: winuser.h:757
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MIIM_TYPE
Definition: winuser.h:736
#define MF_GRAYED
Definition: winuser.h:129
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ OnLButtonUp()

LRESULT CTrayWindow::OnLButtonUp ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2983 of file traywnd.cpp.

2984 {
2986 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
2987 return FALSE;
2988 }
LRESULT OnLButtonUp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)

◆ OnMouseMove()

LRESULT CTrayWindow::OnMouseMove ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3182 of file traywnd.cpp.

3183 {
3185
3186 if (IsAutoHideState())
3187 {
3189 }
3190
3191 return TRUE;
3192 }
#define TIMER_ID_MOUSETRACK
Definition: traywnd.cpp:18
#define MOUSETRACK_INTERVAL
Definition: traywnd.cpp:19

◆ OnMoving()

LRESULT CTrayWindow::OnMoving ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2600 of file traywnd.cpp.

2601 {
2602 POINT ptCursor;
2603 PRECT pRect = (PRECT) lParam;
2604
2605 /* We need to ensure that an application can not accidently
2606 move the tray window (using SetWindowPos). However, we still
2607 need to be able to move the window in case the user wants to
2608 drag the tray window to another position or in case the user
2609 wants to resize the tray window. */
2610 if (!g_TaskbarSettings.bLock && GetCursorPos(&ptCursor))
2611 {
2612 IsDragging = TRUE;
2614 }
2615 else
2616 {
2617 *pRect = m_TrayRects[m_Position];
2618 }
2619 return TRUE;
2620 }
#define PRECT
Definition: precomp.h:27
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3032

◆ OnNcActivate()

LRESULT CTrayWindow::OnNcActivate ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3212 of file traywnd.cpp.

3213 {
3215 DrawShowDesktopButton(); // We have to draw non-client area
3216 bHandled = TRUE;
3217 return ret;
3218 }
void DrawShowDesktopButton()
Definition: traywnd.cpp:2511
#define DefWindowProc
Definition: ros2win.h:31
int ret

◆ OnNcCalcSize()

LRESULT CTrayWindow::OnNcCalcSize ( INT  code,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3220 of file traywnd.cpp.

3221 {
3222 RECT *rc = NULL;
3223 /* Ignore WM_NCCALCSIZE if we are not themed or locked */
3225 {
3226 bHandled = FALSE;
3227 return 0;
3228 }
3229 if(!wParam)
3230 {
3231 rc = (RECT*)wParam;
3232 }
3233 else
3234 {
3236 if(prms->lppos->flags & SWP_NOSENDCHANGING)
3237 {
3238 bHandled = FALSE;
3239 return 0;
3240 }
3241 rc = &prms->rgrc[0];
3242 }
3243
3245
3246 return 0;
3247 }
UINT flags
Definition: winuser.h:3670
PWINDOWPOS lppos
Definition: winuser.h:3675
#define SWP_NOSENDCHANGING
Definition: winuser.h:1262

◆ OnNcHitTest()

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

Definition at line 2545 of file traywnd.cpp.

2546 {
2547 RECT rcClient;
2548 POINT pt;
2549
2551 {
2552 /* The user may not be able to resize the tray window.
2553 Pretend like the window is not sizeable when the user
2554 clicks on the border. */
2555 return HTBORDER;
2556 }
2557
2559 if (GetClientRect(&rcClient) &&
2560 (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
2561 {
2562 pt.x = GET_X_LPARAM(lParam);
2563 pt.y = GET_Y_LPARAM(lParam);
2564
2566 return HTBORDER;
2567
2568 if (PtInRect(&rcClient, pt))
2569 {
2570 /* The user is trying to drag the tray window */
2571 return HTCAPTION;
2572 }
2573
2574 /* Depending on the position of the tray window, allow only
2575 changing the border next to the monitor working area */
2576 switch (m_Position)
2577 {
2578 case ABE_TOP:
2579 if (pt.y > rcClient.bottom)
2580 return HTBOTTOM;
2581 break;
2582 case ABE_LEFT:
2583 if (pt.x > rcClient.right)
2584 return HTRIGHT;
2585 break;
2586 case ABE_RIGHT:
2587 if (pt.x < rcClient.left)
2588 return HTLEFT;
2589 break;
2590 case ABE_BOTTOM:
2591 default:
2592 if (pt.y < rcClient.top)
2593 return HTTOP;
2594 break;
2595 }
2596 }
2597 return HTBORDER;
2598 }
BOOL PtInButton(LPPOINT pt) const
#define ERROR_SUCCESS
Definition: deptool.c:10
#define SetLastError(x)
Definition: compat.h:752
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define HTCAPTION
Definition: winuser.h:2495
#define HTBOTTOM
Definition: winuser.h:2512
#define HTBORDER
Definition: winuser.h:2516
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define HTRIGHT
Definition: winuser.h:2508
#define HTTOP
Definition: winuser.h:2509
#define HTLEFT
Definition: winuser.h:2506

◆ OnNcLButtonDblClick()

LRESULT CTrayWindow::OnNcLButtonDblClick ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2961 of file traywnd.cpp.

2962 {
2963 /* Let the clock handle the double-click */
2965
2966 /* We "handle" this message so users can't cause a weird maximize/restore
2967 window animation when double-clicking the tray window! */
2968 return TRUE;
2969 }

◆ OnNcLButtonDown()

LRESULT CTrayWindow::OnNcLButtonDown ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

This handler implements the trick that makes the start button to get pressed when the user clicked left or below the button.

Definition at line 2825 of file traywnd.cpp.

2826 {
2828 WINDOWINFO wi = {sizeof(WINDOWINFO)};
2829
2830 bHandled = FALSE;
2831
2832 RECT rcStartBtn;
2833 m_StartButton.GetWindowRect(&rcStartBtn);
2834 GetWindowInfo(m_hWnd, &wi);
2835
2836 if (IsPointWithinStartButton(&pt, &rcStartBtn, &wi))
2837 {
2838 bHandled = TRUE;
2840 return 0;
2841 }
2842
2845
2846 return 0;
2847 }
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
LRESULT OnLButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
void PopupStartMenu()
Definition: traywnd.cpp:1861
BOOL IsPointWithinStartButton(LPPOINT ppt, LPRECT prcStartBtn, PWINDOWINFO pwi)
Definition: traywnd.cpp:2758
BOOL WINAPI GetWindowInfo(_In_ HWND, _Inout_ PWINDOWINFO)
struct tagWINDOWINFO WINDOWINFO
#define WM_LBUTTONDOWN
Definition: winuser.h:1795

◆ OnNcLButtonUp()

LRESULT CTrayWindow::OnNcLButtonUp ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2971 of file traywnd.cpp.

2972 {
2973 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
2974 {
2977 bHandled = TRUE;
2978 }
2979
2980 return FALSE;
2981 }
#define WM_LBUTTONUP
Definition: winuser.h:1796

◆ OnNcPaint()

LRESULT CTrayWindow::OnNcPaint ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2518 of file traywnd.cpp.

2519 {
2520 DefWindowProc(uMsg, wParam, lParam);
2521 bHandled = TRUE;
2522
2524 {
2525 DrawShowDesktopButton(); // We have to draw non-client area
2526 return 0;
2527 }
2528
2529 DrawSizerWithTheme((HRGN) wParam);
2530 DrawShowDesktopButton(); // We have to draw non-client area
2531 return 0;
2532 }
int DrawSizerWithTheme(IN HRGN hRgn)
Definition: traywnd.cpp:2080

◆ OnNcRButtonUp()

LRESULT CTrayWindow::OnNcRButtonUp ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2849 of file traywnd.cpp.

2850 {
2851 /* We want the user to be able to get a context menu even on the nonclient
2852 area (including the sizing border)! */
2853 uMsg = WM_CONTEXTMENU;
2854 wParam = (WPARAM) m_hWnd;
2855
2856 return OnContextMenu(uMsg, wParam, lParam, bHandled);
2857 }
LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: traywnd.cpp:2859
#define WM_CONTEXTMENU
Definition: richedit.h:64

◆ OnNotify()

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

Definition at line 2927 of file traywnd.cpp.

2928 {
2929 LRESULT Ret = FALSE;
2930 /* FIXME: We can't check with IsChild whether the hwnd is somewhere inside
2931 the rebar control! But we shouldn't forward messages that the band
2932 site doesn't handle, such as other controls (start button, tray window) */
2933
2934 HRESULT hr = E_FAIL;
2935
2936 if (m_TrayBandSite)
2937 {
2938 hr = m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2939 if (SUCCEEDED(hr))
2940 return Ret;
2941 }
2942
2943 if (m_TrayBandSite == NULL || FAILED(hr))
2944 {
2945 const NMHDR *nmh = (const NMHDR *) lParam;
2946
2947 if (nmh->hwndFrom == m_TrayNotify)
2948 {
2949 switch (nmh->code)
2950 {
2951 case NTNWM_REALIGN:
2952 /* Cause all controls to be aligned */
2954 break;
2955 }
2956 }
2957 }
2958 return Ret;
2959 }
#define NTNWM_REALIGN
Definition: precomp.h:383
#define FAILED(hr)
Definition: intsafe.h:51
UINT code
Definition: winuser.h:3235
HWND hwndFrom
Definition: winuser.h:3233

◆ OnOpenStartMenu()

LRESULT CTrayWindow::OnOpenStartMenu ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2996 of file traywnd.cpp.

2997 {
2998 HWND hwndStartMenu;
2999 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
3001 return FALSE;
3002
3003 if (::IsWindowVisible(hwndStartMenu))
3004 HideStartMenu();
3005 else
3007
3008 return TRUE;
3009 }

◆ OnPulse()

LRESULT CTrayWindow::OnPulse ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3059 of file traywnd.cpp.

3060 {
3061 if (IgnorePulse)
3062 return 0;
3063
3065 IgnorePulse = TRUE;
3068 return 0;
3069 }
void RestoreMinimizedNonTaskWnds(BOOL bDestroyed, HWND hwndActive)
Definition: traywnd.cpp:3038

◆ OnRebarAutoSize()

LRESULT CTrayWindow::OnRebarAutoSize ( INT  code,
LPNMHDR  nmhdr,
BOOL bHandled 
)
inline

Definition at line 3304 of file traywnd.cpp.

3305 {
3306#if 0
3307 LPNMRBAUTOSIZE as = (LPNMRBAUTOSIZE) nmhdr;
3308
3309 if (!as->fChanged)
3310 return 0;
3311
3312 RECT rc;
3313 ::GetWindowRect(m_hWnd, &rc);
3314
3315 SIZE szWindow = {
3316 rc.right - rc.left,
3317 rc.bottom - rc.top };
3318 SIZE szTarget = {
3319 as->rcTarget.right - as->rcTarget.left,
3320 as->rcTarget.bottom - as->rcTarget.top };
3321 SIZE szActual = {
3322 as->rcActual.right - as->rcActual.left,
3323 as->rcActual.bottom - as->rcActual.top };
3324
3325 SIZE borders = {
3326 szWindow.cx - szTarget.cx,
3327 szWindow.cy - szTarget.cx,
3328 };
3329
3330 switch (m_Position)
3331 {
3332 case ABE_LEFT:
3333 szWindow.cx = szActual.cx + borders.cx;
3334 break;
3335 case ABE_TOP:
3336 szWindow.cy = szActual.cy + borders.cy;
3337 break;
3338 case ABE_RIGHT:
3339 szWindow.cx = szActual.cx + borders.cx;
3340 rc.left = rc.right - szWindow.cy;
3341 break;
3342 case ABE_BOTTOM:
3343 szWindow.cy = szActual.cy + borders.cy;
3344 rc.top = rc.bottom - szWindow.cy;
3345 break;
3346 }
3347
3348 SetWindowPos(NULL, rc.left, rc.top, szWindow.cx, szWindow.cy, SWP_NOACTIVATE | SWP_NOZORDER);
3349#else
3350 bHandled = FALSE;
3351#endif
3352 return 0;
3353 }
struct tagNMRBAUTOSIZE * LPNMRBAUTOSIZE

◆ OnSetFocus()

LRESULT CTrayWindow::OnSetFocus ( INT  code,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3298 of file traywnd.cpp.

3299 {
3301 return 0;
3302 }

◆ OnSettingChanged()

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

Definition at line 2431 of file traywnd.cpp.

2432 {
2433 if (wParam == SPI_SETNONCLIENTMETRICS)
2434 {
2437 UpdateFonts();
2440 }
2441
2442 // Note: We rely on CDesktopBrowser to get this message and call SHSettingsChanged
2443 if (m_DesktopWnd)
2445
2446 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2447 {
2448 HideStartMenu();
2449
2451#if 1 // FIXME: Please re-use the start menu
2452 /* Re-create the start menu */
2456 FIXME("Use UpdateStartMenu\n");
2457#else
2458 // Update the start menu
2460#endif
2461 }
2462
2463 return 0;
2464 }
#define FIXME(fmt,...)
Definition: precomp.h:53
HRESULT UpdateStartMenu(IN OUT IMenuPopup *pMenuPopup, IN HBITMAP hbmBanner OPTIONAL, IN BOOL bSmallIcons, IN BOOL bRefresh)
Definition: startmnu.cpp:24
void Release()
Definition: atlcomcli.h:170
VOID AlignControls(IN PRECT prcClient OPTIONAL)
Definition: traywnd.cpp:1675
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ OnSetZOrder()

LRESULT CTrayWindow::OnSetZOrder ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3072 of file traywnd.cpp.

3073 {
3074 return ::SetWindowPos(m_hWnd, (HWND)wParam, 0, 0, 0, 0,
3076 }

◆ OnSize()

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

Definition at line 2643 of file traywnd.cpp.

2644 {
2645 RECT rcClient;
2646 if (wParam == SIZE_RESTORED && lParam == 0)
2647 {
2649 /* Clip the tray window on multi monitor systems so the edges can't
2650 overlap into another monitor */
2652
2653 if (!GetClientRect(&rcClient))
2654 {
2655 return FALSE;
2656 }
2657 }
2658 else
2659 {
2660 rcClient.left = rcClient.top = 0;
2661 rcClient.right = LOWORD(lParam);
2662 rcClient.bottom = HIWORD(lParam);
2663 }
2664
2665 AlignControls(&rcClient);
2666 return TRUE;
2667 }

◆ OnSizing()

LRESULT CTrayWindow::OnSizing ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2622 of file traywnd.cpp.

2623 {
2624 PRECT pRect = (PRECT) lParam;
2625
2627 {
2628 FitToRebar(pRect);
2629 }
2630 else
2631 {
2632 *pRect = m_TrayRects[m_Position];
2633 }
2634 return TRUE;
2635 }

◆ OnSysChar()

LRESULT CTrayWindow::OnSysChar ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2695 of file traywnd.cpp.

2696 {
2697 switch (wParam)
2698 {
2699 case TEXT(' '):
2700 {
2701 /* The user pressed Alt+Space, this usually brings up the system menu of a window.
2702 The tray window needs to handle this specially, since it normally doesn't have
2703 a system menu. */
2704
2705 static const UINT uidDisableItem [] = {
2706 SC_RESTORE,
2707 SC_MOVE,
2708 SC_SIZE,
2711 };
2712 HMENU hSysMenu;
2713 UINT i, uId;
2714
2715 /* temporarily enable the system menu */
2717
2718 hSysMenu = GetSystemMenu(FALSE);
2719 if (hSysMenu != NULL)
2720 {
2721 /* Disable all items that are not relevant */
2722 for (i = 0; i < _countof(uidDisableItem); i++)
2723 {
2724 EnableMenuItem(hSysMenu,
2725 uidDisableItem[i],
2727 }
2728
2729 EnableMenuItem(hSysMenu,
2730 SC_CLOSE,
2731 MF_BYCOMMAND |
2733
2734 /* Display the system menu */
2735 uId = TrackMenu(
2736 hSysMenu,
2737 NULL,
2740 FALSE);
2741 if (uId != 0)
2742 {
2744 }
2745 }
2746
2747 /* revert the system menu window style */
2749 break;
2750 }
2751
2752 default:
2753 bHandled = FALSE;
2754 }
2755 return TRUE;
2756 }
UINT TrackMenu(IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
Definition: traywnd.cpp:864
#define WS_SYSMENU
Definition: pedump.c:629
@ REST_NOCLOSE
Definition: shlobj.h:1652
#define WM_SYSCOMMAND
Definition: winuser.h:1760
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define SC_SIZE
Definition: winuser.h:2603
#define SC_MINIMIZE
Definition: winuser.h:2605
#define SC_CLOSE
Definition: winuser.h:2611
#define SC_MOVE
Definition: winuser.h:2604
#define SC_RESTORE
Definition: winuser.h:2617
#define SC_MAXIMIZE
Definition: winuser.h:2607

◆ OnSysColorChange()

LRESULT CTrayWindow::OnSysColorChange ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2540 of file traywnd.cpp.

2541 {
2542 return SendMessageW(m_Rebar, uMsg, wParam, lParam);
2543 }

◆ OnSysCommand()

LRESULT CTrayWindow::OnSysCommand ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 3021 of file traywnd.cpp.

3022 {
3023 if (wParam == SC_CLOSE)
3024 {
3025 return DoExitWindows();
3026 }
3027
3028 bHandled = FALSE;
3029 return TRUE;
3030 }

◆ OnTaskbarSettingsChanged()

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

Definition at line 3355 of file traywnd.cpp.

3356 {
3357 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
3358
3359 /* Propagate the new settings to the children */
3362
3363 /* Toggle autohide */
3364 SetAutoHideState(newSettings->sr.AutoHide);
3365
3366 /* Toggle lock state */
3367 Lock(newSettings->bLock);
3368
3369 /* Toggle OnTop state */
3370 UpdateAlwaysOnTop(newSettings->sr.AlwaysOnTop);
3371
3372 /* Adjust taskbar size */
3374
3376 return 0;
3377 }
void SetAutoHideState(_In_ BOOL bAutoHide) override
Definition: traywnd.cpp:3593
void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
Definition: traywnd.cpp:3605

◆ OnThemeChanged()

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

Definition at line 2411 of file traywnd.cpp.

2412 {
2413 if (m_Theme)
2415
2416 m_Theme = OpenThemeData(m_hWnd, L"TaskBar");
2417
2418 if (m_Theme)
2419 {
2421 }
2422 else
2423 {
2425 }
2427
2428 return TRUE;
2429 }
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:850
#define WS_BORDER
Definition: pedump.c:625
#define WS_THICKFRAME
Definition: pedump.c:630

◆ OnTimer()

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

Definition at line 3194 of file traywnd.cpp.

3195 {
3197 {
3199 }
3200 else if (wParam == TIMER_ID_AUTOHIDE)
3201 {
3203 }
3205 {
3208 }
3209 return 0;
3210 }
void ProcessMouseTracking()
Definition: traywnd.cpp:1902
void ProcessAutoHide()
Definition: traywnd.cpp:1949

◆ OnWindowPosChanging()

LRESULT CTrayWindow::OnWindowPosChanging ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 2637 of file traywnd.cpp.

2638 {
2640 return TRUE;
2641 }
VOID ChangingWinPos(IN OUT LPWINDOWPOS pwp)
Definition: traywnd.cpp:1393

◆ Open()

HRESULT STDMETHODCALLTYPE CTrayWindow::Open ( )
inline

Definition at line 2124 of file traywnd.cpp.

2125 {
2126 RECT rcWnd;
2127
2128 /* Check if there's already a window created and try to show it.
2129 If it was somehow destroyed just create a new tray window. */
2130 if (m_hWnd != NULL && IsWindow())
2131 {
2132 return S_OK;
2133 }
2134
2137 dwExStyle |= WS_EX_TOPMOST;
2138
2140 if(!m_Theme)
2141 {
2142 dwStyle |= WS_THICKFRAME | WS_BORDER;
2143 }
2144
2145 ZeroMemory(&rcWnd, sizeof(rcWnd));
2146 if (m_Position != (DWORD) -1)
2147 rcWnd = m_TrayRects[m_Position];
2148
2149 if (!Create(NULL, rcWnd, NULL, dwStyle, dwExStyle))
2150 return E_FAIL;
2151
2152 /* Align all controls on the tray window */
2154
2155 /* Move the tray window to the right position and resize it if necessary */
2157
2158 return S_OK;
2159 }
@ Create
Definition: registry.c:563
#define WS_POPUP
Definition: pedump.c:616
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407

◆ OpenCommonStartMenuDirectory()

VOID CTrayWindow::OpenCommonStartMenuDirectory ( IN HWND  hWndOwner,
IN LPCTSTR  lpOperation 
)
inline

Definition at line 597 of file traywnd.cpp.

598 {
599 WCHAR szDir[MAX_PATH];
600
601 if (SHGetSpecialFolderPath(hWndOwner,
602 szDir,
604 FALSE))
605 {
606 ShellExecute(hWndOwner,
607 lpOperation,
608 szDir,
609 NULL,
610 NULL,
612 }
613 }
#define MAX_PATH
Definition: compat.h:34
#define ShellExecute
Definition: shellapi.h:732
#define SHGetSpecialFolderPath
Definition: shlobj.h:1539
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2202

Referenced by ExecContextMenuCmd().

◆ OpenTaskManager()

VOID CTrayWindow::OpenTaskManager ( IN HWND  hWndOwner)
inline

Definition at line 615 of file traywnd.cpp.

616 {
617 ShellExecute(hWndOwner,
618 TEXT("open"),
619 TEXT("taskmgr.exe"),
620 NULL,
621 NULL,
623 }

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ PopupStartMenu()

void CTrayWindow::PopupStartMenu ( )
inline

Definition at line 1861 of file traywnd.cpp.

1862 {
1863 if (m_StartMenuPopup != NULL)
1864 {
1865 POINTL pt;
1866 RECTL rcExclude;
1867 DWORD dwFlags = 0;
1868
1869 if (m_StartButton.GetWindowRect((RECT*) &rcExclude))
1870 {
1871 switch (m_Position)
1872 {
1873 case ABE_BOTTOM:
1874 pt.x = rcExclude.left;
1875 pt.y = rcExclude.top;
1876 dwFlags |= MPPF_TOP;
1877 break;
1878 case ABE_TOP:
1879 pt.x = rcExclude.left;
1880 pt.y = rcExclude.bottom;
1881 dwFlags |= MPPF_BOTTOM;
1882 break;
1883 case ABE_LEFT:
1884 pt.x = rcExclude.right;
1885 pt.y = rcExclude.top;
1886 dwFlags |= MPPF_RIGHT;
1887 break;
1888 case ABE_RIGHT:
1889 pt.x = rcExclude.left;
1890 pt.y = rcExclude.top;
1891 dwFlags |= MPPF_LEFT;
1892 break;
1893 }
1894
1895 m_StartMenuPopup->Popup(&pt, &rcExclude, dwFlags);
1896
1897 m_StartButton.SendMessageW(BM_SETSTATE, TRUE, 0);
1898 }
1899 }
1900 }
#define BM_SETSTATE
Definition: winuser.h:1942

Referenced by OnNcLButtonDown(), and OnOpenStartMenu().

◆ ProcessAutoHide()

void CTrayWindow::ProcessAutoHide ( )
inline

Definition at line 1949 of file traywnd.cpp.

1950 {
1953
1954 switch (m_AutoHideState)
1955 {
1956 case AUTOHIDE_HIDING:
1957 switch (m_Position)
1958 {
1959 case ABE_LEFT:
1960 m_AutoHideOffset.cy = 0;
1962 if (m_AutoHideOffset.cx < -w)
1964 break;
1965 case ABE_TOP:
1966 m_AutoHideOffset.cx = 0;
1968 if (m_AutoHideOffset.cy < -h)
1970 break;
1971 case ABE_RIGHT:
1972 m_AutoHideOffset.cy = 0;
1974 if (m_AutoHideOffset.cx > w)
1976 break;
1977 case ABE_BOTTOM:
1978 m_AutoHideOffset.cx = 0;
1980 if (m_AutoHideOffset.cy > h)
1982 break;
1983 }
1984
1986 {
1988 break;
1989 }
1990
1991 /* fallthrough */
1992 case AUTOHIDE_HIDDEN:
1993 switch (m_Position)
1994 {
1995 case ABE_LEFT:
1997 m_AutoHideOffset.cy = 0;
1998 break;
1999 case ABE_TOP:
2000 m_AutoHideOffset.cx = 0;
2002 break;
2003 case ABE_RIGHT:
2005 m_AutoHideOffset.cy = 0;
2006 break;
2007 case ABE_BOTTOM:
2008 m_AutoHideOffset.cx = 0;
2010 break;
2011 }
2012
2015 break;
2016
2017 case AUTOHIDE_SHOWING:
2019 {
2021 }
2023 {
2025 }
2026 else
2027 {
2028 m_AutoHideOffset.cx = 0;
2029 }
2030
2032 {
2034 }
2036 {
2038 }
2039 else
2040 {
2041 m_AutoHideOffset.cy = 0;
2042 }
2043
2044 if (m_AutoHideOffset.cx != 0 || m_AutoHideOffset.cy != 0)
2045 {
2047 break;
2048 }
2049
2050 /* fallthrough */
2051 case AUTOHIDE_SHOWN:
2054 break;
2055 }
2056
2058 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define AUTOHIDE_SHOWN
Definition: traywnd.cpp:29
#define AUTOHIDE_SPEED_HIDE
Definition: traywnd.cpp:25
#define AUTOHIDE_SPEED_SHOW
Definition: traywnd.cpp:24
#define AUTOHIDE_SHOWING
Definition: traywnd.cpp:28
#define AUTOHIDE_HIDDEN
Definition: traywnd.cpp:27
#define AUTOHIDE_INTERVAL_ANIMATING
Definition: traywnd.cpp:22
int32_t INT
Definition: typedefs.h:58

Referenced by OnTimer().

◆ ProcessMouseTracking()

void CTrayWindow::ProcessMouseTracking ( )
inline

Definition at line 1902 of file traywnd.cpp.

1903 {
1904 POINT pt;
1905 GetCursorPos(&pt);
1906
1907 RECT rcCurrent;
1908 GetWindowRect(&rcCurrent);
1909
1910 BOOL over = PtInRect(&rcCurrent, pt);
1912 over = TRUE;
1913
1915 if (over)
1916 {
1917 if (state == AUTOHIDE_HIDING)
1918 {
1919 TRACE("AutoHide cancelling hide.\n");
1922 }
1923 else if (state == AUTOHIDE_HIDDEN)
1924 {
1925 TRACE("AutoHide starting show.\n");
1928 }
1929 }
1930 else
1931 {
1932 if (state == AUTOHIDE_SHOWING)
1933 {
1934 TRACE("AutoHide cancelling show.\n");
1937 }
1938 else if (state == AUTOHIDE_SHOWN)
1939 {
1940 TRACE("AutoHide starting hide.\n");
1943 }
1944
1946 }
1947 }
static int state
Definition: maze.c:121
#define AUTOHIDE_DELAY_SHOW
Definition: traywnd.cpp:21
#define BST_UNCHECKED
Definition: winuser.h:199

Referenced by OnTimer().

◆ QueryContextMenu()

HRESULT STDMETHODCALLTYPE CTrayWindow::QueryContextMenu ( HMENU  hPopup,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
inline

Implements IContextMenu.

Definition at line 2260 of file traywnd.cpp.

2265 {
2266 if (!m_ContextMenu)
2267 {
2270 return hr;
2271 }
2272
2273 return m_ContextMenu->QueryContextMenu(hPopup, indexMenu, idCmdFirst, idCmdLast, uFlags);
2274 }
UINT uFlags
Definition: api.c:59
HRESULT TrayWindowCtxMenuCreator(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
Definition: traywnd.cpp:3746

◆ RaiseStartButton()

virtual HRESULT CTrayWindow::RaiseStartButton ( )
inlinevirtual

Definition at line 3536 of file traywnd.cpp.

3537 {
3538 m_StartButton.SendMessageW(BM_SETSTATE, FALSE, 0);
3539 return S_OK;
3540 }

Referenced by Tray_OnStartMenuDismissed().

◆ RegisterDesktopWindow()

STDMETHODIMP CTrayWindow::RegisterDesktopWindow ( IN HWND  hWndDesktop)
inlineoverride

Definition at line 3521 of file traywnd.cpp.

3522 {
3523 TRACE("IShellDesktopTray::RegisterDesktopWindow(0x%p)\n", hWndDesktop);
3524
3525 m_DesktopWnd = hWndDesktop;
3526 return S_OK;
3527 }

◆ RegLoadSettings()

VOID CTrayWindow::RegLoadSettings ( )
inline

Definition at line 1597 of file traywnd.cpp.

1598 {
1599 DWORD Pos;
1600 RECT rcScreen;
1601 SIZE WndSize, EdgeSize, DlgFrameSize;
1602 SIZE StartBtnSize = m_StartButton.GetSize();
1603
1604 EdgeSize.cx = GetSystemMetrics(SM_CXEDGE);
1605 EdgeSize.cy = GetSystemMetrics(SM_CYEDGE);
1606 DlgFrameSize.cx = GetSystemMetrics(SM_CXDLGFRAME);
1607 DlgFrameSize.cy = GetSystemMetrics(SM_CYDLGFRAME);
1608
1610 rcScreen = g_TaskbarSettings.sr.Rect;
1611 GetScreenRectFromRect(&rcScreen, MONITOR_DEFAULTTONEAREST);
1612
1614 {
1615 /* Use the minimum size of the taskbar, we'll use the start
1616 button as a minimum for now. Make sure we calculate the
1617 entire window size, not just the client size. However, we
1618 use a thinner border than a standard thick border, so that
1619 the start button and bands are not stuck to the screen border. */
1620 if(!m_Theme)
1621 {
1622 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx + (2 * (EdgeSize.cx + DlgFrameSize.cx));
1623 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1624 }
1625 else
1626 {
1627 g_TaskbarSettings.sr.Size.cx = StartBtnSize.cx - EdgeSize.cx;
1628 g_TaskbarSettings.sr.Size.cy = StartBtnSize.cy - EdgeSize.cy;
1631 }
1632 }
1633 /* Determine a minimum tray window rectangle. The "client" height is
1634 zero here since we cannot determine an optimal minimum width when
1635 loaded as a vertical tray window. We just need to make sure the values
1636 loaded from the registry are at least. The windows explorer behaves
1637 the same way, it allows the user to save a zero width vertical tray
1638 window, but not a zero height horizontal tray window. */
1639 if(!m_Theme)
1640 {
1641 WndSize.cx = 2 * (EdgeSize.cx + DlgFrameSize.cx);
1642 WndSize.cy = StartBtnSize.cy + (2 * (EdgeSize.cy + DlgFrameSize.cy));
1643 }
1644 else
1645 {
1646 WndSize.cx = StartBtnSize.cx;
1647 WndSize.cy = StartBtnSize.cy - EdgeSize.cy;
1648 }
1649
1650 if (WndSize.cx < g_TaskbarSettings.sr.Size.cx)
1651 WndSize.cx = g_TaskbarSettings.sr.Size.cx;
1652 if (WndSize.cy < g_TaskbarSettings.sr.Size.cy)
1653 WndSize.cy = g_TaskbarSettings.sr.Size.cy;
1654
1655 /* Save the calculated size */
1656 m_TraySize = WndSize;
1657
1658 /* Calculate all docking rectangles. We need to do this here so they're
1659 initialized and dragging the tray window to another position gives
1660 usable results */
1661 for (Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
1662 {
1664 &rcScreen,
1665 &m_TraySize,
1666 &m_TrayRects[Pos]);
1667 // TRACE("m_TrayRects[%d(%d)]: %d,%d,%d,%d\n", Pos, Position, m_TrayRects[Pos].left, m_TrayRects[Pos].top, m_TrayRects[Pos].right, m_TrayRects[Pos].bottom);
1668 }
1669
1670 /* Determine which monitor we are on. It shouldn't matter which docked
1671 position rectangle we use */
1673 }
#define SM_CXDLGFRAME
Definition: winuser.h:977
#define SM_CYDLGFRAME
Definition: winuser.h:979

Referenced by OnCreate(), and OnDisplayChange().

◆ ResizeWorkArea()

VOID CTrayWindow::ResizeWorkArea ( )
inline

Definition at line 1523 of file traywnd.cpp.

1524 {
1525#if !WIN7_DEBUG_MODE
1526 RECT rcTray, rcWorkArea;
1527
1528 /* If monitor has changed then fix the previous monitors work area */
1530 {
1531 GetScreenRect(m_PreviousMonitor, &rcWorkArea);
1532 SystemParametersInfoW(SPI_SETWORKAREA,
1533 1,
1534 &rcWorkArea,
1536 }
1537
1538 rcTray = m_TrayRects[m_Position];
1539
1540 GetScreenRect(m_Monitor, &rcWorkArea);
1542
1543 /* If AutoHide is false then change the workarea to exclude
1544 the area that the taskbar covers. */
1545 if (!IsAutoHideState())
1546 {
1547 switch (m_Position)
1548 {
1549 case ABE_TOP:
1550 rcWorkArea.top = rcTray.bottom;
1551 break;
1552 case ABE_LEFT:
1553 rcWorkArea.left = rcTray.right;
1554 break;
1555 case ABE_RIGHT:
1556 rcWorkArea.right = rcTray.left;
1557 break;
1558 case ABE_BOTTOM:
1559 rcWorkArea.bottom = rcTray.top;
1560 break;
1561 }
1562 }
1563
1564 /*
1565 * Resize the current monitor work area. Win32k will also send
1566 * a WM_SIZE message to automatically resize the desktop.
1567 */
1568 SystemParametersInfoW(SPI_SETWORKAREA,
1569 1,
1570 &rcWorkArea,
1572#endif
1573 }
#define SPIF_SENDCHANGE
Definition: winuser.h:1591
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)

Referenced by CheckTrayWndPosition(), Lock(), and OnSize().

◆ RestoreAll()

VOID CTrayWindow::RestoreAll ( )
inline

Definition at line 3150 of file traywnd.cpp.

3151 {
3152 IgnorePulse = TRUE;
3154
3155 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3156 {
3157 HWND hwnd = g_MinimizedAll[i].hwnd;
3160 }
3161
3164 }
int GetSize() const
Definition: atlsimpcoll.h:104
BOOL IsIconic() const
Definition: atlwin.h:932
BOOL WINAPI SetWindowPlacement(_In_ HWND hWnd, _In_ const WINDOWPLACEMENT *)

Referenced by ExecContextMenuCmd(), HandleCommand(), HandleHotKey(), and ToggleDesktop().

◆ RestoreMinimizedNonTaskWnds()

void CTrayWindow::RestoreMinimizedNonTaskWnds ( BOOL  bDestroyed,
HWND  hwndActive 
)
inline

Definition at line 3038 of file traywnd.cpp.

3039 {
3040 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3041 {
3042 HWND hwnd = g_MinimizedAll[i].hwnd;
3043 if (!hwnd || hwndActive == hwnd)
3044 continue;
3045
3048 {
3049 ::SetWindowPlacement(hwnd, &g_MinimizedAll[i].wndpl); // Restore
3050 }
3051 }
3052
3053 if (bDestroyed)
3055 else
3056 ::SetForegroundWindow(hwndActive);
3057 }
BOOL STDMETHODCALLTYPE IsTaskWnd(HWND hWnd)
Definition: traywnd.cpp:2243

Referenced by OnPulse().

◆ RunFileDlgThread()

DWORD WINAPI CTrayWindow::RunFileDlgThread ( )
inline

Definition at line 483 of file traywnd.cpp.

484 {
485 HWND hwnd;
486 RECT posRect;
487
489
491 WC_STATIC,
492 NULL,
494 posRect.left,
495 posRect.top,
496 posRect.right - posRect.left,
497 posRect.bottom - posRect.top,
498 NULL,
499 NULL,
500 NULL,
501 NULL);
502
504
505 // build the default directory from two environment variables
506 CStringW strDefaultDir, strHomePath;
507 strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE");
508 strHomePath.GetEnvironmentVariable(L"HOMEPATH");
509 strDefaultDir += strHomePath;
510
512
515
516 return 0;
517 }
BOOL GetEnvironmentVariable(_In_z_ PCXSTR pszVar)
Definition: cstringt.h:658
void WINAPI RunFileDlg(HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
Definition: dialogs.cpp:399
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_DISABLED
Definition: pedump.c:621
#define SS_LEFT
Definition: pedump.c:692
#define WC_STATIC
Definition: commctrl.h:4687
#define RFF_CALCDIRECTORY
Definition: run.h:35
#define CreateWindowEx
Definition: winuser.h:5840

◆ s_RunFileDlgThread()

static DWORD WINAPI CTrayWindow::s_RunFileDlgThread ( IN OUT PVOID  pParam)
inlinestatic

Definition at line 519 of file traywnd.cpp.

520 {
521 CTrayWindow * This = (CTrayWindow*) pParam;
522 return This->RunFileDlgThread();
523 }

Referenced by DisplayRunFileDlg().

◆ s_TrayPropertiesThread()

static DWORD WINAPI CTrayWindow::s_TrayPropertiesThread ( IN OUT PVOID  pParam)
inlinestatic

Definition at line 571 of file traywnd.cpp.

572 {
573 CTrayWindow *This = (CTrayWindow*) pParam;
574
575 return This->TrayPropertiesThread();
576 }

Referenced by DisplayProperties().

◆ SaveState()

void CTrayWindow::SaveState ( )
inline

Definition at line 452 of file traywnd.cpp.

453 {
455 return;
456
458
461 }
VOID ClearRecentAndMru()
@ REST_NOSAVESET
Definition: shlobj.h:1653
@ REST_CLEARRECENTDOCSONEXIT
Definition: shlobj.h:1687
#define WM_PROGMAN_SAVESTATE
Definition: undocshell.h:64

Referenced by DoExitWindows(), HandleCommand(), and OnEndSession().

◆ SetAutoHideState()

void CTrayWindow::SetAutoHideState ( _In_ BOOL  bAutoHide)
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3593 of file traywnd.cpp.

3594 {
3595 g_TaskbarSettings.sr.AutoHide = bAutoHide;
3597
3599 if (bAutoHide)
3601 else
3603 }

Referenced by OnTaskbarSettingsChanged().

◆ ShowDesktop()

VOID CTrayWindow::ShowDesktop ( )
inline

Definition at line 3145 of file traywnd.cpp.

3146 {
3148 }

Referenced by ExecContextMenuCmd(), HandleCommand(), and ToggleDesktop().

◆ ToggleDesktop()

VOID CTrayWindow::ToggleDesktop ( )
inline

Definition at line 625 of file traywnd.cpp.

626 {
628 {
629 ShowDesktop();
630 }
631 else
632 {
633 RestoreAll();
634 }
635 }

Referenced by HandleCommand(), and HandleHotKey().

◆ TrackCtxMenu()

HRESULT CTrayWindow::TrackCtxMenu ( IN IContextMenu contextMenu,
IN POINT *ppt  OPTIONAL,
IN HWND hwndExclude  OPTIONAL,
IN BOOL  TrackUp,
IN PVOID Context  OPTIONAL 
)
inline

Definition at line 935 of file traywnd.cpp.

941 {
942 POINT pt;
944 RECT rc;
945 HRESULT hr;
946 UINT uCommand;
947 HMENU popup = CreatePopupMenu();
948
949 if (popup == NULL)
950 return E_FAIL;
951
952 if (ppt)
953 {
954 pt = *ppt;
955 }
956 else
957 {
959 pt.x = rc.left;
960 pt.y = rc.top;
961 }
962
963 TRACE("Before Query\n");
964 hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
966 {
967 TRACE("Query failed\n");
968 DestroyMenu(popup);
969 return hr;
970 }
971
972 TRACE("Before Tracking\n");
974 if (hwndExclude)
975 {
976 ::GetWindowRect(hwndExclude, &rc);
977 ZeroMemory(&params, sizeof(params));
978 params.cbSize = sizeof(params);
979 params.rcExclude = rc;
980 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, &params);
981 }
982 else
983 {
984 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, NULL);
985 }
987
988 if (uCommand != 0)
989 {
990 TRACE("Before InvokeCommand\n");
991 CMINVOKECOMMANDINFO cmi = { 0 };
992 cmi.cbSize = sizeof(cmi);
993 cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
994 cmi.hwnd = m_hWnd;
995 hr = contextMenu->InvokeCommand(&cmi);
996 }
997 else
998 {
999 TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError());
1000 hr = S_FALSE;
1001 }
1002
1003 DestroyMenu(popup);
1004 return hr;
1005 }
GLenum const GLfloat * params
Definition: glext.h:5645
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
#define UINT_MAX
Definition: intsafe.h:152
#define S_FALSE
Definition: winerror.h:2357
HMENU WINAPI CreatePopupMenu(void)
Definition: menu.c:838
BOOL WINAPI TrackPopupMenuEx(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _In_ HWND, _In_opt_ LPTPMPARAMS)
#define WM_NULL
Definition: winuser.h:1626
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define TPM_RETURNCMD
Definition: winuser.h:2406

Referenced by OnContextMenu().

◆ TrackMenu()

UINT CTrayWindow::TrackMenu ( IN HMENU  hMenu,
IN POINT *ppt  OPTIONAL,
IN HWND hwndExclude  OPTIONAL,
IN BOOL  TrackUp,
IN BOOL  IsContextMenu 
)
inline

Definition at line 864 of file traywnd.cpp.

870 {
871 TPMPARAMS tmp, *ptmp = NULL;
872 POINT pt;
873 UINT cmdId;
874 UINT fuFlags;
875
876 if (hwndExclude != NULL)
877 {
878 /* Get the client rectangle and map it to screen coordinates */
879 if (::GetClientRect(hwndExclude,
880 &tmp.rcExclude) &&
881 ::MapWindowPoints(hwndExclude,
882 NULL,
883 (LPPOINT) &tmp.rcExclude,
884 2) != 0)
885 {
886 ptmp = &tmp;
887 }
888 }
889
890 if (ppt == NULL)
891 {
892 if (ptmp == NULL &&
893 GetClientRect(&tmp.rcExclude) &&
895 NULL,
896 (LPPOINT) &tmp.rcExclude,
897 2) != 0)
898 {
899 ptmp = &tmp;
900 }
901
902 if (ptmp != NULL)
903 {
904 /* NOTE: TrackPopupMenuEx will eventually align the track position
905 for us, no need to take care of it here as long as the
906 coordinates are somewhere within the exclusion rectangle */
907 pt.x = ptmp->rcExclude.left;
908 pt.y = ptmp->rcExclude.top;
909 }
910 else
911 pt.x = pt.y = 0;
912 }
913 else
914 pt = *ppt;
915
916 tmp.cbSize = sizeof(tmp);
917
918 fuFlags = TPM_RETURNCMD | TPM_VERTICAL;
919 fuFlags |= (TrackUp ? TPM_BOTTOMALIGN : TPM_TOPALIGN);
920 if (IsContextMenu)
921 fuFlags |= TPM_RIGHTBUTTON;
922 else
923 fuFlags |= (TrackUp ? TPM_VERNEGANIMATION : TPM_VERPOSANIMATION);
924
925 cmdId = TrackPopupMenuEx(hMenu,
926 fuFlags,
927 pt.x,
928 pt.y,
929 m_hWnd,
930 ptmp);
931
932 return cmdId;
933 }
RECT rcExclude
Definition: winuser.h:3652
UINT cbSize
Definition: winuser.h:3651
#define TPM_RIGHTBUTTON
Definition: winuser.h:2399
#define TPM_BOTTOMALIGN
Definition: winuser.h:2404
#define TPM_TOPALIGN
Definition: winuser.h:2402
#define TPM_VERTICAL
Definition: winuser.h:2401

Referenced by OnSysChar().

◆ TrayMessageLoop()

VOID CTrayWindow::TrayMessageLoop ( )
inline

Definition at line 3471 of file traywnd.cpp.

3472 {
3473 MSG Msg;
3474 BOOL Ret;
3475
3476 /* FIXME: We should keep a reference here... */
3477
3478 while (true)
3479 {
3480 Ret = GetMessage(&Msg, NULL, 0, 0);
3481
3482 if (!Ret || Ret == -1)
3483 break;
3484
3485 if (m_StartMenuBand == NULL ||
3486 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3487 {
3490 }
3491 }
3492 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define GetMessage
Definition: winuser.h:5875
#define DispatchMessage
Definition: winuser.h:5850

Referenced by TrayMessageLoop().

◆ TrayProcessMessages()

VOID CTrayWindow::TrayProcessMessages ( )
inline

Definition at line 3451 of file traywnd.cpp.

3452 {
3453 MSG Msg;
3454
3455 /* FIXME: We should keep a reference here... */
3456
3457 while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
3458 {
3459 if (Msg.message == WM_QUIT)
3460 break;
3461
3462 if (m_StartMenuBand == NULL ||
3463 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3464 {
3467 }
3468 }
3469 }
#define PM_REMOVE
Definition: winuser.h:1207
#define PeekMessage
Definition: winuser.h:5915

Referenced by TrayProcessMessages().

◆ TrayPropertiesThread()

DWORD WINAPI CTrayWindow::TrayPropertiesThread ( )
inline

Definition at line 542 of file traywnd.cpp.

543 {
544 HWND hwnd;
545 RECT posRect;
546
549 WC_STATIC,
550 NULL,
552 posRect.left,
553 posRect.top,
554 posRect.right - posRect.left,
555 posRect.bottom - posRect.top,
556 NULL,
557 NULL,
558 NULL,
559 NULL);
560
562
564
567
568 return 0;
569 }
VOID DisplayTrayProperties(IN HWND hwndOwner, IN HWND hwndTaskbar)
Definition: trayprop.cpp:363

◆ Unknown()

STDMETHODIMP CTrayWindow::Unknown ( IN DWORD  dwUnknown1,
IN DWORD  dwUnknown2 
)
inlineoverride

Definition at line 3530 of file traywnd.cpp.

3531 {
3532 TRACE("IShellDesktopTray::Unknown(%u,%u) unimplemented!\n", dwUnknown1, dwUnknown2);
3533 return S_OK;
3534 }

◆ UpdateAlwaysOnTop()

void CTrayWindow::UpdateAlwaysOnTop ( _In_ BOOL  bAlwaysOnTop)
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3605 of file traywnd.cpp.

3606 {
3607 g_TaskbarSettings.sr.AlwaysOnTop = bAlwaysOnTop;
3608 HWND hwndInsertAfter = (bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST);
3609 SetWindowPos(hwndInsertAfter, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
3610 }
#define HWND_TOPMOST
Definition: winuser.h:1219
#define HWND_NOTOPMOST
Definition: winuser.h:1217

Referenced by OnTaskbarSettingsChanged().

◆ UpdateFonts()

void CTrayWindow::UpdateFonts ( )
inline

Definition at line 1015 of file traywnd.cpp.

1016 {
1017 /* There is nothing to do if themes are enabled */
1018 if (m_Theme)
1019 return;
1020
1022
1023 NONCLIENTMETRICS ncm = {sizeof(ncm)};
1024 if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
1025 {
1026 ERR("SPI_GETNONCLIENTMETRICS failed\n");
1027 return;
1028 }
1029
1030 if (m_Font != NULL)
1032
1033 ncm.lfCaptionFont.lfWeight = FW_NORMAL;
1034 m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
1035 if (!m_Font)
1036 {
1037 ERR("CreateFontIndirect failed\n");
1038 return;
1039 }
1040
1044 }
VOID UpdateFont()
Definition: traywnd.cpp:224
#define FW_NORMAL
Definition: wingdi.h:373
#define CreateFontIndirect
Definition: wingdi.h:4444
#define WM_SETFONT
Definition: winuser.h:1669

Referenced by OnCreate(), and OnSettingChanged().

Member Data Documentation

◆ 

union { ... } CTrayWindow::@124

◆ Flags

DWORD CTrayWindow::Flags

Definition at line 358 of file traywnd.cpp.

◆ IgnorePulse

DWORD CTrayWindow::IgnorePulse

Definition at line 365 of file traywnd.cpp.

Referenced by CTrayWindow(), MinimizeAll(), OnPulse(), OnTimer(), and RestoreAll().

◆ InSizeMove

DWORD CTrayWindow::InSizeMove

Definition at line 362 of file traywnd.cpp.

Referenced by ChangingWinPos(), OnEnterSizeMove(), and OnExitSizeMove().

◆ IsDragging

DWORD CTrayWindow::IsDragging

Definition at line 363 of file traywnd.cpp.

Referenced by ChangingWinPos(), OnEnterSizeMove(), and OnMoving().

◆ m_AutoHideOffset

SIZE CTrayWindow::m_AutoHideOffset
private

Definition at line 348 of file traywnd.cpp.

Referenced by ChangingWinPos(), CTrayWindow(), ProcessAutoHide(), and SetAutoHideState().

◆ m_AutoHideState

UINT CTrayWindow::m_AutoHideState
private

◆ m_ContextMenu

CComPtr<IContextMenu> CTrayWindow::m_ContextMenu
private

Definition at line 323 of file traywnd.cpp.

Referenced by GetCommandString(), InvokeCommand(), and QueryContextMenu().

◆ m_DesktopWnd

HWND CTrayWindow::m_DesktopWnd
private

◆ m_DraggingMonitor

HMONITOR CTrayWindow::m_DraggingMonitor
private

Definition at line 339 of file traywnd.cpp.

Referenced by ChangingWinPos(), and OnMoving().

◆ m_DraggingPosition

DWORD CTrayWindow::m_DraggingPosition
private

Definition at line 338 of file traywnd.cpp.

Referenced by ChangingWinPos(), and OnMoving().

◆ m_Font

HFONT CTrayWindow::m_Font
private

Definition at line 326 of file traywnd.cpp.

Referenced by UpdateFonts(), and ~CTrayWindow().

◆ m_Monitor

HMONITOR CTrayWindow::m_Monitor
private

◆ m_MouseTrackingInfo

TRACKMOUSEEVENT CTrayWindow::m_MouseTrackingInfo
private

Definition at line 349 of file traywnd.cpp.

Referenced by CTrayWindow().

◆ m_Position

◆ m_PreviousMonitor

HMONITOR CTrayWindow::m_PreviousMonitor
private

Definition at line 337 of file traywnd.cpp.

Referenced by GetPreviousMonitor(), OnEnterSizeMove(), and ResizeWorkArea().

◆ m_pShowDesktopButton

CTrayShowDesktopButton* CTrayWindow::m_pShowDesktopButton
private

◆ m_Rebar

HWND CTrayWindow::m_Rebar
private

◆ m_RunFileDlgOwner

HWND CTrayWindow::m_RunFileDlgOwner
private

Definition at line 345 of file traywnd.cpp.

Referenced by DisplayRunFileDlg(), and RunFileDlgThread().

◆ m_ShellServices

HDPA CTrayWindow::m_ShellServices
private

Definition at line 351 of file traywnd.cpp.

Referenced by OnCreate(), and ~CTrayWindow().

◆ m_StartButton

◆ m_StartMenuBand

CComPtr<IMenuBand> CTrayWindow::m_StartMenuBand
private

Definition at line 319 of file traywnd.cpp.

Referenced by if(), OnCreate(), OnSettingChanged(), TrayMessageLoop(), and TrayProcessMessages().

◆ m_StartMenuPopup

CComPtr<IMenuPopup> CTrayWindow::m_StartMenuPopup
private

◆ m_TaskBand

CComPtr<IDeskBand> CTrayWindow::m_TaskBand
private

Definition at line 322 of file traywnd.cpp.

Referenced by OnCreate().

◆ m_TaskSwitch

HWND CTrayWindow::m_TaskSwitch
private

◆ m_Theme

◆ m_TrayBandSite

CComPtr<ITrayBandSite> CTrayWindow::m_TrayBandSite

◆ m_TrayNotify

◆ m_TrayNotifyInstance

CComPtr<IUnknown> CTrayWindow::m_TrayNotifyInstance
private

Definition at line 333 of file traywnd.cpp.

Referenced by OnCreate().

◆ m_TrayPropertiesOwner

HWND CTrayWindow::m_TrayPropertiesOwner
private

Definition at line 344 of file traywnd.cpp.

Referenced by DisplayProperties(), and TrayPropertiesThread().

◆ m_TrayRects

◆ m_TraySize

SIZE CTrayWindow::m_TraySize
private

◆ NewPosSize

DWORD CTrayWindow::NewPosSize

Definition at line 364 of file traywnd.cpp.


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