ReactOS 0.4.16-dev-2104-gb84fa49
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)
 
LRESULT OnSetZOrder (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
STDMETHODIMP NotifyFullScreenToAppBars (HMONITOR hMonitor, BOOL bFullOpening) override
 
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 OnGetMinMaxInfo (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
 
   } 
 
}; 
 
- 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 305 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindow()

CTrayWindow::CTrayWindow ( )
inline

Definition at line 368 of file traywnd.cpp.

368 :
371 m_Theme(NULL),
372 m_Font(NULL),
374 m_Rebar(NULL),
377 m_Position(0),
386 Flags(0)
387 {
392 }
DWORD m_DraggingPosition
Definition: traywnd.cpp:337
HWND m_TaskSwitch
Definition: traywnd.cpp:329
DWORD Flags
Definition: traywnd.cpp:357
HWND m_Rebar
Definition: traywnd.cpp:328
HMONITOR m_Monitor
Definition: traywnd.cpp:335
CStartButton m_StartButton
Definition: traywnd.cpp:315
DWORD m_Position
Definition: traywnd.cpp:334
HTHEME m_Theme
Definition: traywnd.cpp:323
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:348
HMONITOR m_PreviousMonitor
Definition: traywnd.cpp:336
HDPA m_ShellServices
Definition: traywnd.cpp:350
SIZE m_TraySize
Definition: traywnd.cpp:341
RECT m_TrayRects[4]
Definition: traywnd.cpp:340
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:338
UINT m_AutoHideState
Definition: traywnd.cpp:346
CTrayShowDesktopButton * m_pShowDesktopButton
Definition: traywnd.cpp:316
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:343
SIZE m_AutoHideOffset
Definition: traywnd.cpp:347
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:344
HFONT m_Font
Definition: traywnd.cpp:325
HWND m_DesktopWnd
Definition: traywnd.cpp:327
HWND m_TrayNotify
Definition: traywnd.cpp:330
#define NULL
Definition: types.h:112
#define ZeroMemory
Definition: minwinbase.h:31

◆ ~CTrayWindow()

virtual CTrayWindow::~CTrayWindow ( )
inlinevirtual

Definition at line 394 of file traywnd.cpp.

395 {
396 if (m_ShellServices != NULL)
397 {
400 }
401
402 if (m_Font != NULL)
403 {
405 m_Font = NULL;
406 }
407
408 if (m_Theme)
409 {
411 m_Theme = NULL;
412 }
413
415 }
HRESULT ShutdownShellServices(HDPA hdpa)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:1036
pKey DeleteObject()
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Member Function Documentation

◆ _Init()

void CTrayWindow::_Init ( )
inline

Definition at line 3531 of file traywnd.cpp.

3532 {
3533 m_Position = (DWORD) -1;
3534 }
#define DWORD
Definition: nt_native.h:44

◆ AdjustSizerRect()

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

Definition at line 1137 of file traywnd.cpp.

1138 {
1140 SIZE size;
1141
1142 if (pos > ABE_BOTTOM)
1143 pos = ABE_BOTTOM;
1144
1145 HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1147 return;
1148
1149 switch (pos)
1150 {
1151 case ABE_TOP:
1152 rc->bottom -= size.cy;
1153 break;
1154 case ABE_BOTTOM:
1155 rc->top += size.cy;
1156 break;
1157 case ABE_LEFT:
1158 rc->right -= size.cx;
1159 break;
1160 case ABE_RIGHT:
1161 rc->left += size.cx;
1162 break;
1163 }
1164 }
@ 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:102
LONG bottom
Definition: windef.h:103
LONG top
Definition: windef.h:101
LONG left
Definition: windef.h:100
@ 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 1676 of file traywnd.cpp.

1677 {
1678 RECT rcClient;
1679 SIZE TraySize, StartSize;
1680 POINT ptTrayNotify = { 0, 0 };
1681 BOOL Horizontal;
1682 HDWP dwp;
1683
1685 if (prcClient != NULL)
1686 {
1687 rcClient = *prcClient;
1688 }
1689 else
1690 {
1691 if (!GetClientRect(&rcClient))
1692 {
1693 ERR("Could not get client rect lastErr=%d\n", GetLastError());
1694 return;
1695 }
1696 }
1697
1698 Horizontal = IsPosHorizontal();
1699
1700 /* We're about to resize/move the start button, the rebar control and
1701 the tray notification control */
1702 dwp = BeginDeferWindowPos(4);
1703 if (dwp == NULL)
1704 {
1705 ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1706 return;
1707 }
1708
1709 /* Limit the Start button width to the client width, if necessary */
1710 StartSize = m_StartButton.GetSize();
1711 if (StartSize.cx > rcClient.right)
1712 StartSize.cx = rcClient.right;
1713
1714 HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1715 if (hwndTaskToolbar)
1716 {
1717 DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1718
1719 /* Themed button covers Edge area as well */
1720 StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0);
1721 }
1722
1723 if (m_StartButton.m_hWnd != NULL)
1724 {
1725 /* Resize and reposition the button */
1726 dwp = m_StartButton.DeferWindowPos(dwp,
1727 NULL,
1728 0,
1729 0,
1730 StartSize.cx,
1731 StartSize.cy,
1733 if (dwp == NULL)
1734 {
1735 ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1736 return;
1737 }
1738 }
1739
1740 /* Determine the size that the tray notification window needs */
1741 if (Horizontal)
1742 {
1743 TraySize.cx = 0;
1744 TraySize.cy = rcClient.bottom;
1745 }
1746 else
1747 {
1748 TraySize.cx = rcClient.right;
1749 TraySize.cy = 0;
1750 }
1751
1752 if (m_TrayNotify != NULL &&
1755 (WPARAM)Horizontal,
1756 (LPARAM)&TraySize))
1757 {
1758 /* Move the tray notification window to the desired location */
1759 if (Horizontal)
1760 ptTrayNotify.x = rcClient.right - TraySize.cx;
1761 else
1762 ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1763
1764 dwp = ::DeferWindowPos(dwp,
1766 NULL,
1767 ptTrayNotify.x,
1768 ptTrayNotify.y,
1769 TraySize.cx,
1770 TraySize.cy,
1772 if (dwp == NULL)
1773 {
1774 ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1775 return;
1776 }
1777 }
1778
1779 /* Resize/Move the rebar control */
1780 if (m_Rebar != NULL)
1781 {
1782 POINT ptRebar = { 0, 0 };
1783 SIZE szRebar;
1784
1785 SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1786
1787 if (Horizontal)
1788 {
1789 ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1790 szRebar.cx = ptTrayNotify.x - ptRebar.x;
1791 szRebar.cy = rcClient.bottom;
1792 }
1793 else
1794 {
1795 ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1796 szRebar.cx = rcClient.right;
1797 szRebar.cy = ptTrayNotify.y - ptRebar.y;
1798 }
1799
1800 dwp = ::DeferWindowPos(dwp,
1801 m_Rebar,
1802 NULL,
1803 ptRebar.x,
1804 ptRebar.y,
1805 szRebar.cx,
1806 szRebar.cy,
1808 }
1809
1810 if (dwp != NULL)
1811 EndDeferWindowPos(dwp);
1812
1813 if (m_TaskSwitch != NULL)
1814 {
1815 /* Update the task switch window configuration */
1817 }
1818 }
#define ERR(fmt,...)
Definition: precomp.h:57
#define TSWM_UPDATETASKBARPOS
Definition: precomp.h:397
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:380
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:1212
STDMETHODIMP GetWindow(HWND *phwnd) override
Definition: traywnd.cpp:3517
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG_PTR LPARAM
Definition: minwindef.h:175
UINT_PTR WPARAM
Definition: minwindef.h:174
#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
Definition: windef.h:99
#define HIWORD(l)
Definition: typedefs.h:247
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#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:5954
#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 1487 of file traywnd.cpp.

1488 {
1489 RECT rcClip, rcWindow;
1490 HRGN hClipRgn;
1491
1492 if (GetWindowRect(&rcWindow))
1493 {
1494 /* Disable clipping on systems with only one monitor */
1496 Clip = FALSE;
1497
1498 if (Clip)
1499 {
1500 rcClip = rcWindow;
1501
1502 GetScreenRect(m_Monitor, &rcClip);
1503
1504 if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1505 {
1506 rcClip = rcWindow;
1507 }
1508
1509 OffsetRect(&rcClip,
1510 -rcWindow.left,
1511 -rcWindow.top);
1512
1513 hClipRgn = CreateRectRgnIndirect(&rcClip);
1514 }
1515 else
1516 hClipRgn = NULL;
1517
1518 /* Set the clipping region or make sure the window isn't clipped
1519 by disabling it explicitly. */
1520 SetWindowRgn(hClipRgn, TRUE);
1521 }
1522 }
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1099
#define TRUE
Definition: types.h:120
#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 1217 of file traywnd.cpp.

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

Referenced by FitToRebar().

◆ ChangingWinPos()

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

Definition at line 1394 of file traywnd.cpp.

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

1577 {
1578 /* Force the rebar bands to resize */
1580 IID_IDeskBand,
1582 0,
1583 NULL,
1584 NULL);
1585
1586 /* Calculate the size of the taskbar based on the rebar */
1588
1589 /* Move the tray window */
1590 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1591 * and position we use here with m_TrayRects */
1596 }
VOID ResizeWorkArea()
Definition: traywnd.cpp:1524
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1820
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:353
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1487
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:2548
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 2162 of file traywnd.cpp.

2163 {
2164 if (m_hWnd != NULL)
2165 {
2168 0,
2169 0);
2170 }
2171
2172 return S_OK;
2173 }
#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 3526 of file traywnd.cpp.

3527 {
3528 return E_NOTIMPL;
3529 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DisplayProperties()

HWND STDMETHODCALLTYPE CTrayWindow::DisplayProperties ( )
inline

Definition at line 577 of file traywnd.cpp.

578 {
579 HWND hTrayProp;
580
582 {
584 if (hTrayProp != NULL &&
585 hTrayProp != m_TrayPropertiesOwner)
586 {
587 SetForegroundWindow(hTrayProp);
588 return NULL;
589 }
590 }
591
593 if (hThread)
595 return NULL;
596 }
HWND GetLastActivePopup() const
Definition: atlwin.h:676
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:570
#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
HANDLE hThread
Definition: wizard.c:28
BOOL WINAPI SetForegroundWindow(_In_ HWND)

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ DisplayRunFileDlg()

void CTrayWindow::DisplayRunFileDlg ( )
inline

Definition at line 522 of file traywnd.cpp.

523 {
524 HWND hRunDlg;
526 {
528 if (hRunDlg != NULL &&
529 hRunDlg != m_RunFileDlgOwner)
530 {
531 SetForegroundWindow(hRunDlg);
532 return;
533 }
534 }
535
537 if (hThread)
539 }
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:516

Referenced by HandleCommand(), and HandleHotKey().

◆ DoExitWindows()

LRESULT CTrayWindow::DoExitWindows ( )
inline

Definition at line 460 of file traywnd.cpp.

461 {
462 SaveState();
463
464 /* Display the ReactOS Shutdown Dialog */
466
467 /*
468 * If the user presses CTRL+ALT+SHIFT while exiting
469 * the shutdown dialog, exit the shell cleanly.
470 */
471 if ((GetKeyState(VK_CONTROL) & 0x8000) &&
472 (GetKeyState(VK_SHIFT) & 0x8000) &&
473 (GetKeyState(VK_MENU) & 0x8000))
474 {
475 PostMessage(WM_QUIT, 0, 0);
476 }
477 return 0;
478 }
void SaveState()
Definition: traywnd.cpp:449
void WINAPI ExitWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1604
#define WM_QUIT
Definition: winuser.h:1651
#define VK_CONTROL
Definition: winuser.h:2239
#define PostMessage
Definition: winuser.h:5943
#define VK_SHIFT
Definition: winuser.h:2238
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2240

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

◆ DrawShowDesktopButton()

void CTrayWindow::DrawShowDesktopButton ( )
inline

Definition at line 2508 of file traywnd.cpp.

2509 {
2510 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2511 return;
2513 }
#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 2081 of file traywnd.cpp.

2082 {
2083 HDC hdc;
2084 RECT rect;
2086 SIZE size;
2087
2089
2092 return 0;
2093
2095 OffsetRect(&rect, -rect.left, -rect.top);
2096
2097 hdc = GetWindowDC();
2098
2099 switch (m_Position)
2100 {
2101 case ABE_LEFT:
2102 rect.left = rect.right - size.cx;
2103 break;
2104 case ABE_TOP:
2105 rect.top = rect.bottom - size.cy;
2106 break;
2107 case ABE_RIGHT:
2108 rect.right = rect.left + size.cx;
2109 break;
2110 case ABE_BOTTOM:
2111 default:
2112 rect.bottom = rect.top + size.cy;
2113 break;
2114 }
2115
2116 DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2117
2118 ReleaseDC(hdc);
2119 return 0;
2120 }
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 2065 of file traywnd.cpp.

2066 {
2067 RECT rect;
2069
2071
2072 if (m_Theme)
2073 {
2075 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2076 }
2077
2078 return 0;
2079 }
@ 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 638 of file traywnd.cpp.

639 {
640 switch (uiCmd)
641 {
644 break;
645
648 TEXT("open"));
649 break;
650
653 TEXT("explore"));
654 break;
655
656 case ID_LOCKTASKBAR:
658 break;
659
662 break;
663
666 break;
667
669 ShowDesktop();
670 break;
671
674 if (g_Arrangement == NONE)
675 {
677 }
681 break;
682
685 if (g_Arrangement == NONE)
686 {
688 }
692 break;
693
696 if (g_Arrangement == NONE)
697 {
699 }
703 break;
704
707 break;
708
710 //FIXME: Use SHRunControlPanel
711 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
712 break;
713
715 RestoreAll();
716 break;
717
718 default:
719 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
720 return FALSE;
721 }
722
723 return TRUE;
724 }
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:616
VOID ShowDesktop()
Definition: traywnd.cpp:3111
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:777
VOID RestoreAll()
Definition: traywnd.cpp:3116
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:577
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:598
#define L(x)
Definition: resources.c:13
#define TEXT(s)
Definition: k32.h:28
VOID ShowCustomizeNotifyIcons(HINSTANCE hInst, HWND hExplorer)
#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:2778
#define TRACE(s)
Definition: solgame.cpp:4
@ TILED
Definition: traywnd.cpp:45
@ NONE
Definition: traywnd.cpp:45
@ CASCADED
Definition: traywnd.cpp:45
enum @115 g_Arrangement
VOID RestoreWindowPos()
Definition: traywnd.cpp:74
VOID BackupWindowPos()
Definition: traywnd.cpp:69
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:961
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:2223
#define MDITILE_HORIZONTAL
Definition: winuser.h:2224
#define MDITILE_VERTICAL
Definition: winuser.h:2225
#define SW_NORMAL
Definition: winuser.h:780

◆ ExecResourceCmd()

HRESULT CTrayWindow::ExecResourceCmd ( int  id)
inline

Definition at line 425 of file traywnd.cpp.

426 {
427 WCHAR szCommand[256];
428 WCHAR *pszParameters;
429
431 id,
432 szCommand,
433 _countof(szCommand)))
434 {
435 return E_FAIL;
436 }
437
438 pszParameters = wcschr(szCommand, L'>');
439 if (pszParameters)
440 {
441 *pszParameters = 0;
442 pszParameters++;
443 }
444
445 ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
446 return S_OK;
447 }
#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 1820 of file traywnd.cpp.

1821 {
1822 /* Get the rect of the rebar */
1823 RECT rebarRect, taskbarRect, clientRect;
1824 ::GetWindowRect(m_Rebar, &rebarRect);
1825 ::GetWindowRect(m_hWnd, &taskbarRect);
1826 ::GetClientRect(m_hWnd, &clientRect);
1827 OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1828
1829 /* Calculate the difference of size of the taskbar and the rebar */
1830 SIZE margins;
1831 margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1832 margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1833
1834 /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1835 switch (m_Position)
1836 {
1837 case ABE_TOP:
1838 rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1840 pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1841 break;
1842 case ABE_BOTTOM:
1843 rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1845 pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1846 break;
1847 case ABE_LEFT:
1848 rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1850 pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1851 break;
1852 case ABE_RIGHT:
1853 rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1855 pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1856 break;
1857 }
1858
1860 }
static RECT margins
Definition: print.c:55
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1217
#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 2285 of file traywnd.cpp.

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

◆ GetDesktopWnd()

HWND CTrayWindow::GetDesktopWnd ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3563 of file traywnd.cpp.

3563{ return m_DesktopWnd; }

◆ GetDraggingRectFromPt()

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

Definition at line 1274 of file traywnd.cpp.

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

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

Referenced by ChangingWinPos().

◆ GetHWND()

HWND STDMETHODCALLTYPE CTrayWindow::GetHWND ( )
inline

Definition at line 2175 of file traywnd.cpp.

2176 {
2177 return m_hWnd;
2178 }

◆ GetMonitor()

HMONITOR & CTrayWindow::GetMonitor ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3558 of file traywnd.cpp.

3558{ return m_Monitor; }

◆ GetMonitorFromRect()

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

Definition at line 1074 of file traywnd.cpp.

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

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

◆ GetPosition()

INT CTrayWindow::GetPosition ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3560 of file traywnd.cpp.

3560{ return m_Position; }

◆ GetPreviousMonitor()

HMONITOR & CTrayWindow::GetPreviousMonitor ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3559 of file traywnd.cpp.

3559{ return m_PreviousMonitor; }

◆ GetScreenRect()

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

Definition at line 1099 of file traywnd.cpp.

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

Referenced by ApplyClipping(), and ResizeWorkArea().

◆ GetScreenRectFromRect()

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

Definition at line 1047 of file traywnd.cpp.

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

Referenced by CalculateValidSize(), and RegLoadSettings().

◆ GetState()

CTrayWindow::GetState ( )
inlineoverride

Definition at line 3477 of file traywnd.cpp.

3478 {
3479 /* FIXME: Return ABS_ flags? */
3480 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3481 return 0;
3482 }

◆ GetTrayRect()

const RECT * CTrayWindow::GetTrayRect ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3561 of file traywnd.cpp.

3561{ 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 1191 of file traywnd.cpp.

1195 {
1196 if (pTraySize == NULL)
1197 pTraySize = &m_TraySize;
1198
1199 *pRect = *pScreen;
1200
1201 if(!m_Theme)
1202 {
1203 /* Move the border outside of the screen */
1204 InflateRect(pRect,
1207 }
1208
1209 MakeTrayRectWithSize(Position, pTraySize, pRect);
1210 }
#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 3485 of file traywnd.cpp.

3486 {
3487 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3488 *phWndTray = m_hWnd;
3489 return S_OK;
3490 }

◆ GetTrayWnd()

HWND CTrayWindow::GetTrayWnd ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3562 of file traywnd.cpp.

3562{ return m_hWnd; }

◆ GetWindow()

STDMETHODIMP CTrayWindow::GetWindow ( HWND phwnd)
inlineoverride

Implements IOleWindow.

Definition at line 3517 of file traywnd.cpp.

3518 {
3519 if (!phwnd)
3520 return E_INVALIDARG;
3521 *phwnd = m_hWnd;
3522 return S_OK;
3523 }

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

◆ HandleCommand()

LRESULT CTrayWindow::HandleCommand ( UINT  uCommand)
inline

Definition at line 777 of file traywnd.cpp.

778 {
779 switch (uCommand)
780 {
782 // TODO:
783 break;
787 break;
789 SaveState();
790 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
791 break;
792 case TRAYCMD_CASCADE:
794 break;
795 case TRAYCMD_TILE_H:
797 break;
798 case TRAYCMD_TILE_V:
800 break;
803 break;
805 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
806 break;
809 break;
811 MinimizeAll();
812 break;
814 RestoreAll();
815 break;
817 ShowDesktop();
818 break;
821 break;
823 break;
826 {
829 }
830 break;
833 break;
835 // TODO:
836 break;
839 break;
841 // TODO:
842 break;
844 // TODO:
845 break;
847 // TODO:
848 break;
849 case IDM_SEARCH:
852 break;
855 break;
856
857 default:
858 break;
859 }
860
861 return FALSE;
862 }
#define IDM_SEARCH
Definition: resource.h:77
#define IDS_HELP_COMMAND
Definition: resource.h:109
VOID ToggleDesktop()
Definition: traywnd.cpp:626
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:425
VOID HideStartMenu()
Definition: traywnd.cpp:726
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3097
LRESULT DoExitWindows()
Definition: traywnd.cpp:460
void DisplayRunFileDlg()
Definition: traywnd.cpp:522
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1541
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
Definition: utils.cpp:1171
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2468
@ REST_CLASSICSHELL
Definition: shlobj.h:1685
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:166
#define TRAYCMD_CONTROL_PANEL
Definition: undocshell.h:963
#define TRAYCMD_STARTMENU
Definition: undocshell.h:947
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:966
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:954
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:969
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:955
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:958
#define TRAYCMD_TILE_V
Definition: undocshell.h:952
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:968
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:960
#define TRAYCMD_TILE_H
Definition: undocshell.h:951
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:953
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:948
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:949
#define TRAYCMD_CASCADE
Definition: undocshell.h:950
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:959
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:957
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:964
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:965
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:956
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:967
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:962

Referenced by ExecContextMenuCmd(), and OnCommand().

◆ HandleHotKey()

LRESULT CTrayWindow::HandleHotKey ( DWORD  id)
inline

Definition at line 731 of file traywnd.cpp.

732 {
733 switch (id)
734 {
735 case IDHK_RUN:
738 break;
739 case IDHK_HELP:
741 break;
742 case IDHK_EXPLORE:
743 //FIXME: We don't support this yet:
744 //ShellExecuteW(0, L"explore", NULL, NULL, NULL, 1);
745 ShellExecuteW(0, NULL, L"explorer.exe", L"/e ,", NULL, 1);
746 break;
747 case IDHK_FIND:
749 break;
752 break;
754 //FIXME: Use SHRunControlPanel
755 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
756 break;
757 case IDHK_NEXT_TASK:
758 break;
759 case IDHK_PREV_TASK:
760 break;
762 MinimizeAll();
763 break;
764 case IDHK_RESTORE_ALL:
765 RestoreAll();
766 break;
767 case IDHK_DESKTOP:
769 break;
770 case IDHK_PAGER:
771 break;
772 }
773
774 return 0;
775 }
#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 726 of file traywnd.cpp.

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

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

◆ if()

CTrayWindow::if ( m_StartMenuBand = NULL)
inline

Definition at line 3354 of file traywnd.cpp.

3355 {
3356 MSG Msg;
3357 LRESULT lRet;
3358
3359 Msg.hwnd = m_hWnd;
3360 Msg.message = uMsg;
3361 Msg.wParam = wParam;
3362 Msg.lParam = lParam;
3363
3364 if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3365 {
3366 return lRet;
3367 }
3368
3369 wParam = Msg.wParam;
3370 lParam = Msg.lParam;
3371 }
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:318
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
struct @1779 Msg[]
LONG_PTR LRESULT
Definition: minwindef.h:176
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829

◆ InvokeCommand()

HRESULT STDMETHODCALLTYPE CTrayWindow::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpici)
inline

Implements IContextMenu.

Definition at line 2277 of file traywnd.cpp.

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

◆ IsAlwaysOnTop()

BOOL CTrayWindow::IsAlwaysOnTop ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3557 of file traywnd.cpp.

DWORD AlwaysOnTop
Definition: precomp.h:208

◆ IsAutoHideState()

BOOL CTrayWindow::IsAutoHideState ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3555 of file traywnd.cpp.

3555{ return g_TaskbarSettings.sr.AutoHide; }
DWORD AutoHide
Definition: precomp.h:207

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

◆ IsDialog()

static BOOL CTrayWindow::IsDialog ( HWND  hwnd)
inlinestatic

Definition at line 3062 of file traywnd.cpp.

3063 {
3064 WCHAR szClass[32];
3065 GetClassNameW(hwnd, szClass, _countof(szClass));
3066 return wcscmp(szClass, L"#32770") == 0;
3067 }
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1972
_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 3556 of file traywnd.cpp.

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

◆ IsHorizontal()

BOOL STDMETHODCALLTYPE CTrayWindow::IsHorizontal ( )
inline

Definition at line 2186 of file traywnd.cpp.

2187 {
2188 return IsPosHorizontal();
2189 }

◆ IsPointWithinShowDesktopButton()

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

Definition at line 2798 of file traywnd.cpp.

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

◆ IsPointWithinStartButton()

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

Definition at line 2755 of file traywnd.cpp.

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

Referenced by OnNcLButtonDown().

◆ IsPosHorizontal()

BOOL CTrayWindow::IsPosHorizontal ( )
inline

Definition at line 1212 of file traywnd.cpp.

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

Referenced by AlignControls(), and IsHorizontal().

◆ IsSpecialHWND()

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

Definition at line 2180 of file traywnd.cpp.

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

Referenced by IsTaskWnd().

◆ IsTaskWnd()

BOOL STDMETHODCALLTYPE CTrayWindow::IsTaskWnd ( HWND  hWnd)
inline

Definition at line 2244 of file traywnd.cpp.

2245 {
2247 {
2249 if (((exStyle & WS_EX_APPWINDOW) || ::GetWindow(hWnd, GW_OWNER) == NULL) &&
2250 !(exStyle & WS_EX_TOOLWINDOW))
2251 {
2252 return TRUE;
2253 }
2254 }
2255 return FALSE;
2256 }
BOOL IsWindowVisible() const
Definition: atlwin.h:958
BOOL IsWindow() const
Definition: atlwin.h:947
BOOL STDMETHODCALLTYPE IsSpecialHWND(IN HWND hWnd)
Definition: traywnd.cpp:2180
#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

◆ Lock()

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

Definition at line 2191 of file traywnd.cpp.

2192 {
2193 BOOL bPrevLock = g_TaskbarSettings.bLock;
2194
2195 if (g_TaskbarSettings.bLock != bLock)
2196 {
2197 g_TaskbarSettings.bLock = bLock;
2198
2199 if (m_TrayBandSite != NULL)
2200 {
2201 if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2202 {
2203 /* Reset?? */
2204 g_TaskbarSettings.bLock = bPrevLock;
2205 return bPrevLock;
2206 }
2207 }
2208
2209 if (m_Theme)
2210 {
2211 /* Update cached tray sizes */
2212 for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2213 {
2214 RECT rcGripper = {0};
2215 AdjustSizerRect(&rcGripper, Pos);
2216
2218 {
2219 m_TrayRects[Pos].top += rcGripper.top;
2220 m_TrayRects[Pos].left += rcGripper.left;
2221 m_TrayRects[Pos].bottom += rcGripper.bottom;
2222 m_TrayRects[Pos].right += rcGripper.right;
2223 }
2224 else
2225 {
2226 m_TrayRects[Pos].top -= rcGripper.top;
2227 m_TrayRects[Pos].left -= rcGripper.left;
2228 m_TrayRects[Pos].bottom -= rcGripper.bottom;
2229 m_TrayRects[Pos].right -= rcGripper.right;
2230 }
2231 }
2232 }
2236 }
2237
2238 return bPrevLock;
2239 }
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1137
#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 1166 of file traywnd.cpp.

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

Referenced by ChangingWinPos(), and GetTrayRectFromScreenRect().

◆ MinimizeAll()

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

Definition at line 3097 of file traywnd.cpp.

3098 {
3099 MINIMIZE_INFO info;
3100 info.hwndDesktop = GetDesktopWindow();;
3101 info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
3102 info.hwndProgman = FindWindowW(L"Progman", NULL);
3103 info.pMinimizedAll = &g_MinimizedAll;
3104 info.bShowDesktop = bShowDesktop;
3106
3109 }
HWND SetFocus()
Definition: atlwin.h:1198
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:3069
CSimpleArray< MINWNDPOS > g_MinimizedAll
Definition: traywnd.cpp:170
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)

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

◆ MinimizeWindowsProc()

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

Definition at line 3069 of file traywnd.cpp.

3070 {
3071 MINIMIZE_INFO *info = (MINIMIZE_INFO *)lParam;
3072 if (hwnd == info->hwndDesktop || hwnd == info->hTrayWnd || hwnd == info->hwndProgman)
3073 return TRUE; // Ignore special windows
3074
3075 if (!info->bShowDesktop)
3076 {
3078 return TRUE;
3079 HWND hwndOwner = ::GetWindow(hwnd, GW_OWNER);
3080 if (hwndOwner && !::IsWindowEnabled(hwndOwner))
3081 return TRUE;
3082 }
3083
3084 if (CanBeMinimized(hwnd))
3085 {
3086 MINWNDPOS mwp = { hwnd, { sizeof(mwp.wndpl) } };
3087 if (::GetWindowPlacement(hwnd, &mwp.wndpl) && // Save the position and status
3089 {
3090 info->pMinimizedAll->Add(mwp);
3091 }
3092 }
3093
3094 return TRUE;
3095 }
BOOL IsWindowEnabled() const
Definition: atlwin.h:952
static BOOL IsDialog(HWND hwnd)
Definition: traywnd.cpp:3062
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().

◆ NotifyFullScreenToAppBars()

STDMETHODIMP CTrayWindow::NotifyFullScreenToAppBars ( HMONITOR  hMonitor,
BOOL  bFullOpening 
)
inlineoverride

Definition at line 3042 of file traywnd.cpp.

3043 {
3044 OnAppBarNotifyAll(hMonitor, NULL, ABN_FULLSCREENAPP, bFullOpening);
3045 return S_OK;
3046 }
#define ABN_FULLSCREENAPP
Definition: shellapi.h:74

◆ OnActivate()

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

Definition at line 3248 of file traywnd.cpp.

3249 {
3251 if (!wParam) // !(Activate || Minimized)
3252 {
3253 SendMessage(WM_CHANGEUISTATE, MAKELONG(UIS_SET, UISF_HIDEACCEL | UISF_HIDEFOCUS), 0);
3255 }
3256 return 0;
3257 }
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 2987 of file traywnd.cpp.

2988 {
2989 DestroyWindow();
2990 return TRUE;
2991 }
BOOL DestroyWindow()
Definition: atlwin.h:462

◆ OnCommand()

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

Definition at line 3128 of file traywnd.cpp.

3129 {
3130 LRESULT Ret = FALSE;
3131
3133 {
3134 return FALSE;
3135 }
3136
3137 if (m_TrayBandSite == NULL || FAILED_UNEXPECTEDLY(m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret)))
3138 {
3139 return HandleCommand(LOWORD(wParam));
3140 }
3141 return Ret;
3142 }
#define LOWORD(l)
Definition: pedump.c:82

◆ OnContextMenu()

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

Definition at line 2856 of file traywnd.cpp.

2857 {
2858 LRESULT Ret = FALSE;
2859 POINT pt, *ppt = NULL;
2860 HWND hWndExclude = NULL;
2861
2862 /* Check if the administrator has forbidden access to context menus */
2864 return FALSE;
2865
2866 pt.x = (SHORT) LOWORD(lParam);
2867 pt.y = (SHORT) HIWORD(lParam);
2868
2869 if (pt.x != -1 || pt.y != -1)
2870 ppt = &pt;
2871 else
2872 hWndExclude = m_StartButton.m_hWnd;
2873
2875 {
2876 /* Make sure we can't track the context menu if the start
2877 menu is currently being shown */
2879 {
2880 CComPtr<IContextMenu> ctxMenu;
2882 TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
2883 }
2884 }
2885 else
2886 {
2887 /* See if the context menu should be handled by the task band site */
2888 if (ppt != NULL && m_TrayBandSite != NULL)
2889 {
2890 HWND hWndAtPt;
2891 POINT ptClient = *ppt;
2892
2893 /* Convert the coordinates to client-coordinates */
2894 ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
2895
2896 hWndAtPt = ChildWindowFromPoint(ptClient);
2897 if (hWndAtPt != NULL &&
2898 (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
2899 {
2900 /* Check if the user clicked on the task switch window */
2901 ptClient = *ppt;
2902 ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
2903
2905 if (hWndAtPt == m_TaskSwitch)
2906 goto HandleTrayContextMenu;
2907
2908 /* Forward the message to the task band site */
2909 m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2910 }
2911 else
2912 goto HandleTrayContextMenu;
2913 }
2914 else
2915 {
2916HandleTrayContextMenu:
2917 /* Tray the default tray window context menu */
2918 TrackCtxMenu(this, ppt, NULL, FALSE, this);
2919 }
2920 }
2921 return Ret;
2922 }
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:936
short SHORT
Definition: pedump.c:59
@ REST_NOTRAYCONTEXTMENU
Definition: shlobj.h:1673
HWND WINAPI ChildWindowFromPoint(_In_ HWND, _In_ POINT)
#define BM_GETSTATE
Definition: winuser.h:1949
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 2490 of file traywnd.cpp.

2491 {
2493 if (!pCopyData)
2494 return FALSE;
2495
2496 switch (pCopyData->dwData)
2497 {
2498 case TABDMC_APPBAR:
2499 return OnAppBarMessage(pCopyData);
2500 case TABDMC_NOTIFY:
2501 case TABDMC_LOADINPROC:
2502 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2503 }
2504 return FALSE;
2505 }
LRESULT OnAppBarMessage(_Inout_ PCOPYDATASTRUCT pCopyData)
Definition: appbar.cpp:571
ULONG_PTR dwData
Definition: winuser.h:3103
#define TABDMC_APPBAR
Definition: undocshell.h:972
#define TABDMC_LOADINPROC
Definition: undocshell.h:974
#define TABDMC_NOTIFY
Definition: undocshell.h:973
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT

◆ OnCreate()

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

Definition at line 2301 of file traywnd.cpp.

2302 {
2303 HRESULT hRet;
2304
2305 ((ITrayWindow*)this)->AddRef();
2306
2307 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2308
2309 /* Create the Start button */
2311
2312 /* Load the saved tray window settings */
2314
2315 /* Create and initialize the start menu */
2319
2320 /* Create the task band */
2322 if (FAILED_UNEXPECTEDLY(hRet))
2323 return FALSE;
2324
2325 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2327 if (FAILED_UNEXPECTEDLY(hRet))
2328 return FALSE;
2329
2330 /* Create the tray notification window */
2332 if (FAILED_UNEXPECTEDLY(hRet))
2333 return FALSE;
2334
2335 /* Get the hwnd of the rebar */
2337 if (FAILED_UNEXPECTEDLY(hRet))
2338 return FALSE;
2339
2340 /* Get the hwnd of the tasks toolbar */
2342 if (FAILED_UNEXPECTEDLY(hRet))
2343 return FALSE;
2344
2345 /* Get the hwnd of the tray notification window */
2347 if (FAILED_UNEXPECTEDLY(hRet))
2348 return FALSE;
2349
2352 return FALSE;
2353
2354 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2355
2356 UpdateFonts();
2357
2359
2360 if (IsAutoHideState())
2361 {
2364 }
2365
2366 /* Set the initial lock state in the band site */
2368
2369 static const UINT winkeys[] =
2370 {
2383 };
2385 {
2386 for (UINT i = 0; i < _countof(winkeys); ++i)
2387 {
2388 UINT mod = HIBYTE(HIWORD(winkeys[i])), key = LOBYTE(HIWORD(winkeys[i]));
2389 RegisterHotKey(m_hWnd, LOWORD(winkeys[i]), mod, key);
2390 }
2391 }
2392
2393 return TRUE;
2394 }
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:382
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:321
VOID RegLoadSettings()
Definition: traywnd.cpp:1598
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:332
void UpdateFonts()
Definition: traywnd.cpp:1016
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:1746
DWORD SmSmallIcons
Definition: precomp.h:209
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:2235
#define MOD_WIN
Definition: winuser.h:2686
#define VK_F1
Definition: winuser.h:2291
#define VK_PAUSE
Definition: winuser.h:2241
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
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:2515
#define IID_PPV_ARG(Itype, ppType)

◆ OnCtlColorBtn()

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

Definition at line 2531 of file traywnd.cpp.

2532 {
2535 }
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 2396 of file traywnd.cpp.

2397 {
2398 return 0;
2399 }

◆ OnDisplayChange()

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

Definition at line 2476 of file traywnd.cpp.

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

◆ OnDoExitWindows()

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

Definition at line 3008 of file traywnd.cpp.

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

◆ OnEndSession()

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

Definition at line 2401 of file traywnd.cpp.

2402 {
2403 if (wParam)
2404 SaveState();
2405 return 0;
2406 }

◆ OnEnterSizeMove()

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

Definition at line 2666 of file traywnd.cpp.

2667 {
2668 InSizeMove = TRUE;
2669 IsDragging = FALSE;
2671 {
2672 /* Remove the clipping on multi monitor systems while dragging around */
2674 }
2676 return TRUE;
2677 }

◆ OnEraseBackground()

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

Definition at line 2463 of file traywnd.cpp.

2464 {
2465 HDC hdc = (HDC) wParam;
2466
2467 if (!m_Theme)
2468 {
2469 bHandled = FALSE;
2470 return 0;
2471 }
2472
2474 }
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2065

◆ OnExitSizeMove()

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

Definition at line 2679 of file traywnd.cpp.

2680 {
2681 InSizeMove = FALSE;
2683 {
2685
2686 /* Apply clipping */
2688 }
2689 return TRUE;
2690 }
#define WM_SIZE
Definition: winuser.h:1639
#define SIZE_RESTORED
Definition: winuser.h:2541

◆ OnGetMinMaxInfo()

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

Definition at line 3267 of file traywnd.cpp.

3268 {
3270 SIZE StartSize = m_StartButton.GetSize();
3271 pInfo->ptMinTrackSize.x = StartSize.cx + 2 * GetSystemMetrics(SM_CXFRAME);
3272 pInfo->ptMinTrackSize.y = StartSize.cy + 2 * GetSystemMetrics(SM_CYFRAME);
3273 return 0;
3274 }
POINT ptMinTrackSize
Definition: winuser.h:3732
#define SM_CXFRAME
Definition: winuser.h:1005
#define SM_CYFRAME
Definition: winuser.h:1007
struct tagMINMAXINFO * PMINMAXINFO

◆ OnGetTaskSwitch()

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

Definition at line 3029 of file traywnd.cpp.

3030 {
3031 bHandled = TRUE;
3032 return (LRESULT)m_TaskSwitch;
3033 }

◆ OnHotkey()

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

Definition at line 3048 of file traywnd.cpp.

3049 {
3050 return HandleHotKey(wParam);
3051 }
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:731

◆ OnInitMenuPopup()

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

Definition at line 3211 of file traywnd.cpp.

3212 {
3213 HMENU hMenu = (HMENU)wParam;
3215 {
3219 if (g_Arrangement != NONE)
3220 {
3223 MENUITEMINFOW mii = { sizeof(mii) };
3225 mii.fMask = MIIM_TYPE;
3226 mii.fType = MFT_STRING;
3227 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3229 }
3230 else
3231 {
3233 }
3234 }
3235 else
3236 {
3242 g_WindowPosBackup.RemoveAll();
3243 }
3244 return 0;
3245 }
#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:60
LPWSTR dwTypeData
Definition: winuser.h:3371
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 2980 of file traywnd.cpp.

2981 {
2983 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
2984 return FALSE;
2985 }
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 3144 of file traywnd.cpp.

3145 {
3147
3148 if (IsAutoHideState())
3149 {
3151 }
3152
3153 return TRUE;
3154 }
#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 2597 of file traywnd.cpp.

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

◆ OnNcActivate()

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

Definition at line 3174 of file traywnd.cpp.

3175 {
3177 DrawShowDesktopButton(); // We have to draw non-client area
3178 bHandled = TRUE;
3179 return ret;
3180 }
void DrawShowDesktopButton()
Definition: traywnd.cpp:2508
return ret
Definition: mutex.c:146
#define DefWindowProc
Definition: ros2win.h:31

◆ OnNcCalcSize()

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

Definition at line 3182 of file traywnd.cpp.

3183 {
3184 RECT *rc = NULL;
3185 /* Ignore WM_NCCALCSIZE if we are not themed or locked */
3187 {
3188 bHandled = FALSE;
3189 return 0;
3190 }
3191 if(!wParam)
3192 {
3193 rc = (RECT*)wParam;
3194 }
3195 else
3196 {
3198 if(prms->lppos->flags & SWP_NOSENDCHANGING)
3199 {
3200 bHandled = FALSE;
3201 return 0;
3202 }
3203 rc = &prms->rgrc[0];
3204 }
3205
3207
3208 return 0;
3209 }
UINT flags
Definition: winuser.h:3696
PWINDOWPOS lppos
Definition: winuser.h:3701
#define SWP_NOSENDCHANGING
Definition: winuser.h:1262

◆ OnNcHitTest()

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

Definition at line 2542 of file traywnd.cpp.

2543 {
2544 RECT rcClient;
2545 POINT pt;
2546
2548 {
2549 /* The user may not be able to resize the tray window.
2550 Pretend like the window is not sizeable when the user
2551 clicks on the border. */
2552 return HTBORDER;
2553 }
2554
2556 if (GetClientRect(&rcClient) &&
2557 (MapWindowPoints(NULL, (LPPOINT) &rcClient, 2) != 0 || GetLastError() == ERROR_SUCCESS))
2558 {
2559 pt.x = GET_X_LPARAM(lParam);
2560 pt.y = GET_Y_LPARAM(lParam);
2561
2563 return HTBORDER;
2564
2565 if (PtInRect(&rcClient, pt))
2566 {
2567 /* The user is trying to drag the tray window */
2568 return HTCAPTION;
2569 }
2570
2571 /* Depending on the position of the tray window, allow only
2572 changing the border next to the monitor working area */
2573 switch (m_Position)
2574 {
2575 case ABE_TOP:
2576 if (pt.y > rcClient.bottom)
2577 return HTBOTTOM;
2578 break;
2579 case ABE_LEFT:
2580 if (pt.x > rcClient.right)
2581 return HTRIGHT;
2582 break;
2583 case ABE_RIGHT:
2584 if (pt.x < rcClient.left)
2585 return HTLEFT;
2586 break;
2587 case ABE_BOTTOM:
2588 default:
2589 if (pt.y < rcClient.top)
2590 return HTTOP;
2591 break;
2592 }
2593 }
2594 return HTBORDER;
2595 }
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:2512
#define HTBOTTOM
Definition: winuser.h:2529
#define HTBORDER
Definition: winuser.h:2533
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define HTRIGHT
Definition: winuser.h:2525
#define HTTOP
Definition: winuser.h:2526
#define HTLEFT
Definition: winuser.h:2523

◆ OnNcLButtonDblClick()

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

Definition at line 2958 of file traywnd.cpp.

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

◆ 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 2822 of file traywnd.cpp.

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

◆ OnNcLButtonUp()

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

Definition at line 2968 of file traywnd.cpp.

2969 {
2970 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
2971 {
2974 bHandled = TRUE;
2975 }
2976
2977 return FALSE;
2978 }
#define WM_LBUTTONUP
Definition: winuser.h:1805

◆ OnNcPaint()

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

Definition at line 2515 of file traywnd.cpp.

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

◆ OnNcRButtonUp()

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

Definition at line 2846 of file traywnd.cpp.

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

◆ OnNotify()

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

Definition at line 2924 of file traywnd.cpp.

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

◆ OnOpenStartMenu()

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

Definition at line 2993 of file traywnd.cpp.

2994 {
2995 HWND hwndStartMenu;
2996 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
2998 return FALSE;
2999
3000 if (::IsWindowVisible(hwndStartMenu))
3001 HideStartMenu();
3002 else
3004
3005 return TRUE;
3006 }

◆ OnRebarAutoSize()

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

Definition at line 3276 of file traywnd.cpp.

3277 {
3278#if 0
3279 LPNMRBAUTOSIZE as = (LPNMRBAUTOSIZE) nmhdr;
3280
3281 if (!as->fChanged)
3282 return 0;
3283
3284 RECT rc;
3285 ::GetWindowRect(m_hWnd, &rc);
3286
3287 SIZE szWindow = {
3288 rc.right - rc.left,
3289 rc.bottom - rc.top };
3290 SIZE szTarget = {
3291 as->rcTarget.right - as->rcTarget.left,
3292 as->rcTarget.bottom - as->rcTarget.top };
3293 SIZE szActual = {
3294 as->rcActual.right - as->rcActual.left,
3295 as->rcActual.bottom - as->rcActual.top };
3296
3297 SIZE borders = {
3298 szWindow.cx - szTarget.cx,
3299 szWindow.cy - szTarget.cx,
3300 };
3301
3302 switch (m_Position)
3303 {
3304 case ABE_LEFT:
3305 szWindow.cx = szActual.cx + borders.cx;
3306 break;
3307 case ABE_TOP:
3308 szWindow.cy = szActual.cy + borders.cy;
3309 break;
3310 case ABE_RIGHT:
3311 szWindow.cx = szActual.cx + borders.cx;
3312 rc.left = rc.right - szWindow.cy;
3313 break;
3314 case ABE_BOTTOM:
3315 szWindow.cy = szActual.cy + borders.cy;
3316 rc.top = rc.bottom - szWindow.cy;
3317 break;
3318 }
3319
3320 SetWindowPos(NULL, rc.left, rc.top, szWindow.cx, szWindow.cy, SWP_NOACTIVATE | SWP_NOZORDER);
3321#else
3322 bHandled = FALSE;
3323#endif
3324 return 0;
3325 }
struct tagNMRBAUTOSIZE * LPNMRBAUTOSIZE

◆ OnSetFocus()

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

Definition at line 3260 of file traywnd.cpp.

3261 {
3263 return 0;
3264 }

◆ OnSettingChanged()

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

Definition at line 2428 of file traywnd.cpp.

2429 {
2430 if (wParam == SPI_SETNONCLIENTMETRICS)
2431 {
2434 UpdateFonts();
2437 }
2438
2439 // Note: We rely on CDesktopBrowser to get this message and call SHSettingsChanged
2440 if (m_DesktopWnd)
2442
2443 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2444 {
2445 HideStartMenu();
2446
2448#if 1 // FIXME: Please re-use the start menu
2449 /* Re-create the start menu */
2453 FIXME("Use UpdateStartMenu\n");
2454#else
2455 // Update the start menu
2457#endif
2458 }
2459
2460 return 0;
2461 }
#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:1676
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4265
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ OnSetZOrder()

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

Definition at line 3036 of file traywnd.cpp.

3037 {
3038 return ::SetWindowPos(m_hWnd, (HWND)wParam, 0, 0, 0, 0,
3040 }

◆ OnSize()

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

Definition at line 2640 of file traywnd.cpp.

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

◆ OnSizing()

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

Definition at line 2619 of file traywnd.cpp.

2620 {
2621 PRECT pRect = (PRECT) lParam;
2622
2624 {
2625 FitToRebar(pRect);
2626 }
2627 else
2628 {
2629 *pRect = m_TrayRects[m_Position];
2630 }
2631 return TRUE;
2632 }

◆ OnSysChar()

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

Definition at line 2692 of file traywnd.cpp.

2693 {
2694 switch (wParam)
2695 {
2696 case TEXT(' '):
2697 {
2698 /* The user pressed Alt+Space, this usually brings up the system menu of a window.
2699 The tray window needs to handle this specially, since it normally doesn't have
2700 a system menu. */
2701
2702 static const UINT uidDisableItem [] = {
2703 SC_RESTORE,
2704 SC_MOVE,
2705 SC_SIZE,
2708 };
2709 HMENU hSysMenu;
2710 UINT i, uId;
2711
2712 /* temporarily enable the system menu */
2714
2715 hSysMenu = GetSystemMenu(FALSE);
2716 if (hSysMenu != NULL)
2717 {
2718 /* Disable all items that are not relevant */
2719 for (i = 0; i < _countof(uidDisableItem); i++)
2720 {
2721 EnableMenuItem(hSysMenu,
2722 uidDisableItem[i],
2724 }
2725
2726 EnableMenuItem(hSysMenu,
2727 SC_CLOSE,
2728 MF_BYCOMMAND |
2730
2731 /* Display the system menu */
2732 uId = TrackMenu(
2733 hSysMenu,
2734 NULL,
2737 FALSE);
2738 if (uId != 0)
2739 {
2741 }
2742 }
2743
2744 /* revert the system menu window style */
2746 break;
2747 }
2748
2749 default:
2750 bHandled = FALSE;
2751 }
2752 return TRUE;
2753 }
UINT TrackMenu(IN HMENU hMenu, IN POINT *ppt OPTIONAL, IN HWND hwndExclude OPTIONAL, IN BOOL TrackUp, IN BOOL IsContextMenu)
Definition: traywnd.cpp:865
#define WS_SYSMENU
Definition: pedump.c:629
@ REST_NOCLOSE
Definition: shlobj.h:1649
#define WM_SYSCOMMAND
Definition: winuser.h:1769
HMENU WINAPI GetSystemMenu(_In_ HWND, _In_ BOOL)
#define SC_SIZE
Definition: winuser.h:2620
#define SC_MINIMIZE
Definition: winuser.h:2622
#define SC_CLOSE
Definition: winuser.h:2628
#define SC_MOVE
Definition: winuser.h:2621
#define SC_RESTORE
Definition: winuser.h:2634
#define SC_MAXIMIZE
Definition: winuser.h:2624

◆ OnSysColorChange()

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

Definition at line 2537 of file traywnd.cpp.

2538 {
2539 return SendMessageW(m_Rebar, uMsg, wParam, lParam);
2540 }

◆ OnSysCommand()

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

Definition at line 3018 of file traywnd.cpp.

3019 {
3020 if (wParam == SC_CLOSE)
3021 {
3022 return DoExitWindows();
3023 }
3024
3025 bHandled = FALSE;
3026 return TRUE;
3027 }

◆ OnTaskbarSettingsChanged()

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

Definition at line 3327 of file traywnd.cpp.

3328 {
3329 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
3330
3331 /* Propagate the new settings to the children */
3334
3335 /* Toggle autohide */
3336 SetAutoHideState(newSettings->sr.AutoHide);
3337
3338 /* Toggle lock state */
3339 Lock(newSettings->bLock);
3340
3341 /* Toggle OnTop state */
3342 UpdateAlwaysOnTop(newSettings->sr.AlwaysOnTop);
3343
3344 /* Adjust taskbar size */
3346
3348 return 0;
3349 }
void SetAutoHideState(_In_ BOOL bAutoHide) override
Definition: traywnd.cpp:3565
void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
Definition: traywnd.cpp:3577

◆ OnThemeChanged()

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

Definition at line 2408 of file traywnd.cpp.

2409 {
2410 if (m_Theme)
2412
2413 m_Theme = OpenThemeData(m_hWnd, L"TaskBar");
2414
2415 if (m_Theme)
2416 {
2418 }
2419 else
2420 {
2422 }
2424
2425 return TRUE;
2426 }
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
Definition: system.c:890
#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 3156 of file traywnd.cpp.

3157 {
3158 switch (wParam)
3159 {
3162 break;
3163 case TIMER_ID_AUTOHIDE:
3165 break;
3166 default:
3167 WARN("Invalid timer ID: %u\n", (UINT)wParam);
3168 bHandled = FALSE;
3169 break;
3170 }
3171 return 0;
3172 }
#define WARN(fmt,...)
Definition: precomp.h:61
void ProcessMouseTracking()
Definition: traywnd.cpp:1903
void ProcessAutoHide()
Definition: traywnd.cpp:1950

◆ OnWindowPosChanging()

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

Definition at line 2634 of file traywnd.cpp.

2635 {
2637 return TRUE;
2638 }
VOID ChangingWinPos(IN OUT LPWINDOWPOS pwp)
Definition: traywnd.cpp:1394

◆ Open()

HRESULT STDMETHODCALLTYPE CTrayWindow::Open ( )
inline

Definition at line 2125 of file traywnd.cpp.

2126 {
2127 RECT rcWnd;
2128
2129 /* Check if there's already a window created and try to show it.
2130 If it was somehow destroyed just create a new tray window. */
2131 if (m_hWnd != NULL && IsWindow())
2132 {
2133 return S_OK;
2134 }
2135
2138 dwExStyle |= WS_EX_TOPMOST;
2139
2141 if(!m_Theme)
2142 {
2143 dwStyle |= WS_THICKFRAME | WS_BORDER;
2144 }
2145
2146 ZeroMemory(&rcWnd, sizeof(rcWnd));
2147 if (m_Position != (DWORD) -1)
2148 rcWnd = m_TrayRects[m_Position];
2149
2150 if (!Create(NULL, rcWnd, NULL, dwStyle, dwExStyle))
2151 return E_FAIL;
2152
2153 /* Align all controls on the tray window */
2155
2156 /* Move the tray window to the right position and resize it if necessary */
2158
2159 return S_OK;
2160 }
@ 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 598 of file traywnd.cpp.

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

Referenced by ExecContextMenuCmd().

◆ OpenTaskManager()

VOID CTrayWindow::OpenTaskManager ( IN HWND  hWndOwner)
inline

Definition at line 616 of file traywnd.cpp.

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

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ PopupStartMenu()

void CTrayWindow::PopupStartMenu ( )
inline

Definition at line 1862 of file traywnd.cpp.

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

Referenced by OnNcLButtonDown(), and OnOpenStartMenu().

◆ ProcessAutoHide()

void CTrayWindow::ProcessAutoHide ( )
inline

Definition at line 1950 of file traywnd.cpp.

1951 {
1954
1955 switch (m_AutoHideState)
1956 {
1957 case AUTOHIDE_HIDING:
1958 switch (m_Position)
1959 {
1960 case ABE_LEFT:
1961 m_AutoHideOffset.cy = 0;
1963 if (m_AutoHideOffset.cx < -w)
1965 break;
1966 case ABE_TOP:
1967 m_AutoHideOffset.cx = 0;
1969 if (m_AutoHideOffset.cy < -h)
1971 break;
1972 case ABE_RIGHT:
1973 m_AutoHideOffset.cy = 0;
1975 if (m_AutoHideOffset.cx > w)
1977 break;
1978 case ABE_BOTTOM:
1979 m_AutoHideOffset.cx = 0;
1981 if (m_AutoHideOffset.cy > h)
1983 break;
1984 }
1985
1987 {
1989 break;
1990 }
1991
1992 /* fallthrough */
1993 case AUTOHIDE_HIDDEN:
1994 switch (m_Position)
1995 {
1996 case ABE_LEFT:
1998 m_AutoHideOffset.cy = 0;
1999 break;
2000 case ABE_TOP:
2001 m_AutoHideOffset.cx = 0;
2003 break;
2004 case ABE_RIGHT:
2006 m_AutoHideOffset.cy = 0;
2007 break;
2008 case ABE_BOTTOM:
2009 m_AutoHideOffset.cx = 0;
2011 break;
2012 }
2013
2016 break;
2017
2018 case AUTOHIDE_SHOWING:
2020 {
2022 }
2024 {
2026 }
2027 else
2028 {
2029 m_AutoHideOffset.cx = 0;
2030 }
2031
2033 {
2035 }
2037 {
2039 }
2040 else
2041 {
2042 m_AutoHideOffset.cy = 0;
2043 }
2044
2045 if (m_AutoHideOffset.cx != 0 || m_AutoHideOffset.cy != 0)
2046 {
2048 break;
2049 }
2050
2051 /* fallthrough */
2052 case AUTOHIDE_SHOWN:
2055 break;
2056 }
2057
2059 }
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
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by OnTimer().

◆ ProcessMouseTracking()

void CTrayWindow::ProcessMouseTracking ( )
inline

Definition at line 1903 of file traywnd.cpp.

1904 {
1905 POINT pt;
1906 GetCursorPos(&pt);
1907
1908 RECT rcCurrent;
1909 GetWindowRect(&rcCurrent);
1910
1911 BOOL over = PtInRect(&rcCurrent, pt);
1913 over = TRUE;
1914
1916 if (over)
1917 {
1918 if (state == AUTOHIDE_HIDING)
1919 {
1920 TRACE("AutoHide cancelling hide.\n");
1923 }
1924 else if (state == AUTOHIDE_HIDDEN)
1925 {
1926 TRACE("AutoHide starting show.\n");
1929 }
1930 }
1931 else
1932 {
1933 if (state == AUTOHIDE_SHOWING)
1934 {
1935 TRACE("AutoHide cancelling show.\n");
1938 }
1939 else if (state == AUTOHIDE_SHOWN)
1940 {
1941 TRACE("AutoHide starting hide.\n");
1944 }
1945
1947 }
1948 }
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 2261 of file traywnd.cpp.

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

◆ RaiseStartButton()

virtual HRESULT CTrayWindow::RaiseStartButton ( )
inlinevirtual

Definition at line 3508 of file traywnd.cpp.

3509 {
3510 m_StartButton.SendMessageW(BM_SETSTATE, FALSE, 0);
3511 return S_OK;
3512 }

Referenced by Tray_OnStartMenuDismissed().

◆ RegisterDesktopWindow()

STDMETHODIMP CTrayWindow::RegisterDesktopWindow ( IN HWND  hWndDesktop)
inlineoverride

Definition at line 3493 of file traywnd.cpp.

3494 {
3495 TRACE("IShellDesktopTray::RegisterDesktopWindow(0x%p)\n", hWndDesktop);
3496
3497 m_DesktopWnd = hWndDesktop;
3498 return S_OK;
3499 }

◆ RegLoadSettings()

VOID CTrayWindow::RegLoadSettings ( )
inline

Definition at line 1598 of file traywnd.cpp.

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

1525 {
1526#if !WIN7_DEBUG_MODE
1527 RECT rcTray, rcWorkArea;
1528
1529 /* If monitor has changed then fix the previous monitors work area */
1531 {
1532 GetScreenRect(m_PreviousMonitor, &rcWorkArea);
1533 SystemParametersInfoW(SPI_SETWORKAREA,
1534 1,
1535 &rcWorkArea,
1537 }
1538
1539 rcTray = m_TrayRects[m_Position];
1540
1541 GetScreenRect(m_Monitor, &rcWorkArea);
1543
1544 /* If AutoHide is false then change the workarea to exclude
1545 the area that the taskbar covers. */
1546 if (!IsAutoHideState())
1547 {
1548 switch (m_Position)
1549 {
1550 case ABE_TOP:
1551 rcWorkArea.top = rcTray.bottom;
1552 break;
1553 case ABE_LEFT:
1554 rcWorkArea.left = rcTray.right;
1555 break;
1556 case ABE_RIGHT:
1557 rcWorkArea.right = rcTray.left;
1558 break;
1559 case ABE_BOTTOM:
1560 rcWorkArea.bottom = rcTray.top;
1561 break;
1562 }
1563 }
1564
1565 /*
1566 * Resize the current monitor work area. Win32k will also send
1567 * a WM_SIZE message to automatically resize the desktop.
1568 */
1569 SystemParametersInfoW(SPI_SETWORKAREA,
1570 1,
1571 &rcWorkArea,
1573#endif
1574 }
#define SPIF_SENDCHANGE
Definition: winuser.h:1600
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 3116 of file traywnd.cpp.

3117 {
3118 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3119 {
3120 HWND hwnd = g_MinimizedAll[i].hwnd;
3123 }
3124
3126 }
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().

◆ RunFileDlgThread()

DWORD WINAPI CTrayWindow::RunFileDlgThread ( )
inline

Definition at line 480 of file traywnd.cpp.

481 {
482 HWND hwnd;
483 RECT posRect;
484
486
488 WC_STATIC,
489 NULL,
491 posRect.left,
492 posRect.top,
493 posRect.right - posRect.left,
494 posRect.bottom - posRect.top,
495 NULL,
496 NULL,
497 NULL,
498 NULL);
499
501
502 // build the default directory from two environment variables
503 CStringW strDefaultDir, strHomePath;
504 strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE");
505 strHomePath.GetEnvironmentVariable(L"HOMEPATH");
506 strDefaultDir += strHomePath;
507
509
512
513 return 0;
514 }
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:400
#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:5866

◆ s_RunFileDlgThread()

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

Definition at line 516 of file traywnd.cpp.

517 {
518 CTrayWindow * This = (CTrayWindow*) pParam;
519 return This->RunFileDlgThread();
520 }

Referenced by DisplayRunFileDlg().

◆ s_TrayPropertiesThread()

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

Definition at line 570 of file traywnd.cpp.

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

Referenced by DisplayProperties().

◆ SaveState()

void CTrayWindow::SaveState ( )
inline

Definition at line 449 of file traywnd.cpp.

450 {
452 return;
453
455
458 }
VOID ClearRecentAndMru()
@ REST_NOSAVESET
Definition: shlobj.h:1650
@ REST_CLEARRECENTDOCSONEXIT
Definition: shlobj.h:1684
#define WM_PROGMAN_SAVESTATE
Definition: undocshell.h:74

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

◆ SetAutoHideState()

void CTrayWindow::SetAutoHideState ( _In_ BOOL  bAutoHide)
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3565 of file traywnd.cpp.

3566 {
3567 g_TaskbarSettings.sr.AutoHide = bAutoHide;
3569
3571 if (bAutoHide)
3573 else
3575 }

Referenced by OnTaskbarSettingsChanged().

◆ ShowDesktop()

VOID CTrayWindow::ShowDesktop ( )
inline

Definition at line 3111 of file traywnd.cpp.

3112 {
3114 }

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

◆ ToggleDesktop()

VOID CTrayWindow::ToggleDesktop ( )
inline

Definition at line 626 of file traywnd.cpp.

627 {
629 {
630 ShowDesktop();
631 }
632 else
633 {
634 RestoreAll();
635 }
636 }

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 936 of file traywnd.cpp.

942 {
943 POINT pt;
945 RECT rc;
946 HRESULT hr;
947 UINT uCommand;
948 HMENU popup = CreatePopupMenu();
949
950 if (popup == NULL)
951 return E_FAIL;
952
953 if (ppt)
954 {
955 pt = *ppt;
956 }
957 else
958 {
960 pt.x = rc.left;
961 pt.y = rc.top;
962 }
963
964 TRACE("Before Query\n");
965 hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
967 {
968 TRACE("Query failed\n");
969 DestroyMenu(popup);
970 return hr;
971 }
972
973 TRACE("Before Tracking\n");
975 if (hwndExclude)
976 {
977 ::GetWindowRect(hwndExclude, &rc);
978 ZeroMemory(&params, sizeof(params));
979 params.cbSize = sizeof(params);
980 params.rcExclude = rc;
981 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, &params);
982 }
983 else
984 {
985 uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, pt.x, pt.y, m_hWnd, NULL);
986 }
988
989 if (uCommand != 0)
990 {
991 TRACE("Before InvokeCommand\n");
992 CMINVOKECOMMANDINFO cmi = { 0 };
993 cmi.cbSize = sizeof(cmi);
994 cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
995 cmi.hwnd = m_hWnd;
996 hr = contextMenu->InvokeCommand(&cmi);
997 }
998 else
999 {
1000 TRACE("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand, GetLastError());
1001 hr = S_FALSE;
1002 }
1003
1004 DestroyMenu(popup);
1005 return hr;
1006 }
#define UINT_MAX
Definition: limits.h:27
GLenum const GLfloat * params
Definition: glext.h:5645
struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
#define S_FALSE
Definition: winerror.h:3451
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:1635
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
BOOL WINAPI DestroyMenu(_In_ HMENU)
#define TPM_RETURNCMD
Definition: winuser.h:2423

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 865 of file traywnd.cpp.

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

Referenced by OnSysChar().

◆ TrayMessageLoop()

VOID CTrayWindow::TrayMessageLoop ( )
inline

Definition at line 3443 of file traywnd.cpp.

3444 {
3445 MSG Msg;
3446 BOOL Ret;
3447
3448 /* FIXME: We should keep a reference here... */
3449
3450 while (true)
3451 {
3452 Ret = GetMessage(&Msg, NULL, 0, 0);
3453
3454 if (!Ret || Ret == -1)
3455 break;
3456
3457 if (m_StartMenuBand == NULL ||
3458 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3459 {
3462 }
3463 }
3464 }
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define GetMessage
Definition: winuser.h:5901
#define DispatchMessage
Definition: winuser.h:5876

Referenced by TrayMessageLoop().

◆ TrayProcessMessages()

VOID CTrayWindow::TrayProcessMessages ( )
inline

Definition at line 3423 of file traywnd.cpp.

3424 {
3425 MSG Msg;
3426
3427 /* FIXME: We should keep a reference here... */
3428
3429 while (PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE))
3430 {
3431 if (Msg.message == WM_QUIT)
3432 break;
3433
3434 if (m_StartMenuBand == NULL ||
3435 m_StartMenuBand->IsMenuMessage(&Msg) != S_OK)
3436 {
3439 }
3440 }
3441 }
#define PM_REMOVE
Definition: winuser.h:1207
#define PeekMessage
Definition: winuser.h:5941

Referenced by TrayProcessMessages().

◆ TrayPropertiesThread()

DWORD WINAPI CTrayWindow::TrayPropertiesThread ( )
inline

Definition at line 541 of file traywnd.cpp.

542 {
543 HWND hwnd;
544 RECT posRect;
545
548 WC_STATIC,
549 NULL,
551 posRect.left,
552 posRect.top,
553 posRect.right - posRect.left,
554 posRect.bottom - posRect.top,
555 NULL,
556 NULL,
557 NULL,
558 NULL);
559
561
563
566
567 return 0;
568 }
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 3502 of file traywnd.cpp.

3503 {
3504 TRACE("IShellDesktopTray::Unknown(%u,%u) unimplemented!\n", dwUnknown1, dwUnknown2);
3505 return S_OK;
3506 }

◆ UpdateAlwaysOnTop()

void CTrayWindow::UpdateAlwaysOnTop ( _In_ BOOL  bAlwaysOnTop)
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3577 of file traywnd.cpp.

3578 {
3579 g_TaskbarSettings.sr.AlwaysOnTop = bAlwaysOnTop;
3580 HWND hwndInsertAfter = (bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST);
3581 SetWindowPos(hwndInsertAfter, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
3582 }
#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 1016 of file traywnd.cpp.

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

Referenced by OnCreate(), and OnSettingChanged().

Member Data Documentation

◆ 

union { ... } CTrayWindow::@117

◆ Flags

DWORD CTrayWindow::Flags

Definition at line 357 of file traywnd.cpp.

◆ InSizeMove

DWORD CTrayWindow::InSizeMove

Definition at line 361 of file traywnd.cpp.

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

◆ IsDragging

DWORD CTrayWindow::IsDragging

Definition at line 362 of file traywnd.cpp.

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

◆ m_AutoHideOffset

SIZE CTrayWindow::m_AutoHideOffset
private

Definition at line 347 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 322 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 338 of file traywnd.cpp.

Referenced by ChangingWinPos(), and OnMoving().

◆ m_DraggingPosition

DWORD CTrayWindow::m_DraggingPosition
private

Definition at line 337 of file traywnd.cpp.

Referenced by ChangingWinPos(), and OnMoving().

◆ m_Font

HFONT CTrayWindow::m_Font
private

Definition at line 325 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 348 of file traywnd.cpp.

Referenced by CTrayWindow().

◆ m_Position

◆ m_PreviousMonitor

HMONITOR CTrayWindow::m_PreviousMonitor
private

Definition at line 336 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 344 of file traywnd.cpp.

Referenced by DisplayRunFileDlg(), and RunFileDlgThread().

◆ m_ShellServices

HDPA CTrayWindow::m_ShellServices
private

Definition at line 350 of file traywnd.cpp.

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

◆ m_StartButton

◆ m_StartMenuBand

CComPtr<IMenuBand> CTrayWindow::m_StartMenuBand
private

Definition at line 318 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 321 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 332 of file traywnd.cpp.

Referenced by OnCreate().

◆ m_TrayPropertiesOwner

HWND CTrayWindow::m_TrayPropertiesOwner
private

Definition at line 343 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 363 of file traywnd.cpp.


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