ReactOS 0.4.16-dev-1369-gd4d04c8
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: winbase.h:1753

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

3528 {
3529 m_Position = (DWORD) -1;
3530 }
#define DWORD
Definition: nt_native.h:44

◆ AdjustSizerRect()

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

Definition at line 1133 of file traywnd.cpp.

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

Referenced by Lock(), and OnNcCalcSize().

◆ AlignControls()

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

Definition at line 1672 of file traywnd.cpp.

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

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

◆ ApplyClipping()

VOID CTrayWindow::ApplyClipping ( IN BOOL  Clip)
inline

Definition at line 1483 of file traywnd.cpp.

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

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

Referenced by FitToRebar().

◆ ChangingWinPos()

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

Definition at line 1390 of file traywnd.cpp.

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

1573 {
1574 /* Force the rebar bands to resize */
1576 IID_IDeskBand,
1578 0,
1579 NULL,
1580 NULL);
1581
1582 /* Calculate the size of the taskbar based on the rebar */
1584
1585 /* Move the tray window */
1586 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1587 * and position we use here with m_TrayRects */
1592 }
VOID ResizeWorkArea()
Definition: traywnd.cpp:1520
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1816
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:353
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1483
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:2545
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 2158 of file traywnd.cpp.

2159 {
2160 if (m_hWnd != NULL)
2161 {
2164 0,
2165 0);
2166 }
2167
2168 return S_OK;
2169 }
#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 3522 of file traywnd.cpp.

3523 {
3524 return E_NOTIMPL;
3525 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DisplayProperties()

HWND STDMETHODCALLTYPE CTrayWindow::DisplayProperties ( )
inline

Definition at line 575 of file traywnd.cpp.

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

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ DisplayRunFileDlg()

void CTrayWindow::DisplayRunFileDlg ( )
inline

Definition at line 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 }
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:1597
#define WM_QUIT
Definition: winuser.h:1642
#define VK_CONTROL
Definition: winuser.h:2222
#define PostMessage
Definition: winuser.h:5917
#define VK_SHIFT
Definition: winuser.h:2221
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2223

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

◆ DrawShowDesktopButton()

void CTrayWindow::DrawShowDesktopButton ( )
inline

Definition at line 2504 of file traywnd.cpp.

2505 {
2506 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2507 return;
2509 }
#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 2077 of file traywnd.cpp.

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

2062 {
2063 RECT rect;
2065
2067
2068 if (m_Theme)
2069 {
2071 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2072 }
2073
2074 return 0;
2075 }
@ 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 634 of file traywnd.cpp.

635 {
636 switch (uiCmd)
637 {
640 break;
641
644 TEXT("open"));
645 break;
646
649 TEXT("explore"));
650 break;
651
652 case ID_LOCKTASKBAR:
654 break;
655
658 break;
659
662 break;
663
665 ShowDesktop();
666 break;
667
670 if (g_Arrangement == NONE)
671 {
673 }
677 break;
678
681 if (g_Arrangement == NONE)
682 {
684 }
688 break;
689
692 if (g_Arrangement == NONE)
693 {
695 }
699 break;
700
703 break;
704
706 //FIXME: Use SHRunControlPanel
707 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
708 break;
709
711 RestoreAll();
712 break;
713
714 default:
715 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
716 return FALSE;
717 }
718
719 return TRUE;
720 }
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:612
VOID ShowDesktop()
Definition: traywnd.cpp:3107
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:773
VOID RestoreAll()
Definition: traywnd.cpp:3112
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:575
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:594
#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:2607
#define TRACE(s)
Definition: solgame.cpp:4
enum @122 g_Arrangement
VOID RestoreWindowPos()
Definition: traywnd.cpp:74
VOID BackupWindowPos()
Definition: traywnd.cpp:69
@ TILED
Definition: traywnd.cpp:45
@ NONE
Definition: traywnd.cpp:45
@ CASCADED
Definition: traywnd.cpp:45
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:951
WORD WINAPI CascadeWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
WORD WINAPI TileWindows(_In_opt_ HWND hwndParent, _In_ UINT wHow, _In_opt_ CONST RECT *lpRect, _In_ UINT cKids, _In_reads_opt_(cKids) const HWND FAR *lpKids)
#define MDITILE_SKIPDISABLED
Definition: winuser.h:2206
#define MDITILE_HORIZONTAL
Definition: winuser.h:2207
#define MDITILE_VERTICAL
Definition: winuser.h:2208
#define SW_NORMAL
Definition: winuser.h:780

◆ ExecResourceCmd()

HRESULT CTrayWindow::ExecResourceCmd ( int  id)
inline

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

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

2286 {
2287 if (!m_ContextMenu)
2288 return E_INVALIDARG;
2289
2290 return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2291 }
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 3559 of file traywnd.cpp.

3559{ return m_DesktopWnd; }

◆ GetDraggingRectFromPt()

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

Definition at line 1270 of file traywnd.cpp.

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

Referenced by GetDraggingRectFromRect(), and OnMoving().

◆ GetDraggingRectFromRect()

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

Definition at line 1372 of file traywnd.cpp.

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

Referenced by ChangingWinPos().

◆ GetHWND()

HWND STDMETHODCALLTYPE CTrayWindow::GetHWND ( )
inline

Definition at line 2171 of file traywnd.cpp.

2172 {
2173 return m_hWnd;
2174 }

◆ GetMonitor()

HMONITOR & CTrayWindow::GetMonitor ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3554 of file traywnd.cpp.

3554{ return m_Monitor; }

◆ GetMonitorFromRect()

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

Definition at line 1070 of file traywnd.cpp.

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

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

◆ GetPosition()

INT CTrayWindow::GetPosition ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3556 of file traywnd.cpp.

3556{ return m_Position; }

◆ GetPreviousMonitor()

HMONITOR & CTrayWindow::GetPreviousMonitor ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3555 of file traywnd.cpp.

3555{ return m_PreviousMonitor; }

◆ GetScreenRect()

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

Definition at line 1095 of file traywnd.cpp.

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

Referenced by ApplyClipping(), and ResizeWorkArea().

◆ GetScreenRectFromRect()

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

Definition at line 1043 of file traywnd.cpp.

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

Referenced by CalculateValidSize(), and RegLoadSettings().

◆ GetState()

CTrayWindow::GetState ( )
inlineoverride

Definition at line 3473 of file traywnd.cpp.

3474 {
3475 /* FIXME: Return ABS_ flags? */
3476 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3477 return 0;
3478 }

◆ GetTrayRect()

const RECT * CTrayWindow::GetTrayRect ( )
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3557 of file traywnd.cpp.

3557{ 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 1187 of file traywnd.cpp.

1191 {
1192 if (pTraySize == NULL)
1193 pTraySize = &m_TraySize;
1194
1195 *pRect = *pScreen;
1196
1197 if(!m_Theme)
1198 {
1199 /* Move the border outside of the screen */
1200 InflateRect(pRect,
1203 }
1204
1205 MakeTrayRectWithSize(Position, pTraySize, pRect);
1206 }
#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 3481 of file traywnd.cpp.

3482 {
3483 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3484 *phWndTray = m_hWnd;
3485 return S_OK;
3486 }

◆ GetTrayWnd()

HWND CTrayWindow::GetTrayWnd ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3558 of file traywnd.cpp.

3558{ return m_hWnd; }

◆ GetWindow()

STDMETHODIMP CTrayWindow::GetWindow ( HWND phwnd)
inlineoverride

Implements IOleWindow.

Definition at line 3513 of file traywnd.cpp.

3514 {
3515 if (!phwnd)
3516 return E_INVALIDARG;
3517 *phwnd = m_hWnd;
3518 return S_OK;
3519 }

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

◆ HandleCommand()

LRESULT CTrayWindow::HandleCommand ( UINT  uCommand)
inline

Definition at line 773 of file traywnd.cpp.

774 {
775 switch (uCommand)
776 {
778 // TODO:
779 break;
783 break;
785 SaveState();
786 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
787 break;
788 case TRAYCMD_CASCADE:
790 break;
791 case TRAYCMD_TILE_H:
793 break;
794 case TRAYCMD_TILE_V:
796 break;
799 break;
801 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
802 break;
805 break;
807 MinimizeAll();
808 break;
810 RestoreAll();
811 break;
813 ShowDesktop();
814 break;
817 break;
819 break;
822 {
825 }
826 break;
829 break;
831 // TODO:
832 break;
835 break;
837 // TODO:
838 break;
840 // TODO:
841 break;
843 // TODO:
844 break;
845 case IDM_SEARCH:
848 break;
851 break;
852
853 default:
854 break;
855 }
856
857 return FALSE;
858 }
#define IDM_SEARCH
Definition: resource.h:77
#define IDS_HELP_COMMAND
Definition: resource.h:109
VOID ToggleDesktop()
Definition: traywnd.cpp:622
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:425
VOID HideStartMenu()
Definition: traywnd.cpp:722
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3093
LRESULT DoExitWindows()
Definition: traywnd.cpp:460
void DisplayRunFileDlg()
Definition: traywnd.cpp:522
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1534
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:953
#define TRAYCMD_STARTMENU
Definition: undocshell.h:937
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:956
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:944
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:959
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:945
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:948
#define TRAYCMD_TILE_V
Definition: undocshell.h:942
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:958
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:950
#define TRAYCMD_TILE_H
Definition: undocshell.h:941
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:943
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:938
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:939
#define TRAYCMD_CASCADE
Definition: undocshell.h:940
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:949
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:947
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:954
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:955
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:946
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:957
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:952

Referenced by ExecContextMenuCmd(), and OnCommand().

◆ HandleHotKey()

LRESULT CTrayWindow::HandleHotKey ( DWORD  id)
inline

Definition at line 727 of file traywnd.cpp.

728 {
729 switch (id)
730 {
731 case IDHK_RUN:
734 break;
735 case IDHK_HELP:
737 break;
738 case IDHK_EXPLORE:
739 //FIXME: We don't support this yet:
740 //ShellExecuteW(0, L"explore", NULL, NULL, NULL, 1);
741 ShellExecuteW(0, NULL, L"explorer.exe", L"/e ,", NULL, 1);
742 break;
743 case IDHK_FIND:
745 break;
748 break;
750 //FIXME: Use SHRunControlPanel
751 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
752 break;
753 case IDHK_NEXT_TASK:
754 break;
755 case IDHK_PREV_TASK:
756 break;
758 MinimizeAll();
759 break;
760 case IDHK_RESTORE_ALL:
761 RestoreAll();
762 break;
763 case IDHK_DESKTOP:
765 break;
766 case IDHK_PAGER:
767 break;
768 }
769
770 return 0;
771 }
#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 722 of file traywnd.cpp.

723 {
724 m_StartMenuPopup->OnSelect(MPOS_CANCELLEVEL);
725 }
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 3350 of file traywnd.cpp.

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

◆ InvokeCommand()

HRESULT STDMETHODCALLTYPE CTrayWindow::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpici)
inline

Implements IContextMenu.

Definition at line 2273 of file traywnd.cpp.

2274 {
2275 if (!m_ContextMenu)
2276 return E_INVALIDARG;
2277
2278 return m_ContextMenu->InvokeCommand(lpici);
2279 }

◆ IsAlwaysOnTop()

BOOL CTrayWindow::IsAlwaysOnTop ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3553 of file traywnd.cpp.

DWORD AlwaysOnTop
Definition: precomp.h:208

◆ IsAutoHideState()

BOOL CTrayWindow::IsAutoHideState ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3551 of file traywnd.cpp.

3551{ 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 3058 of file traywnd.cpp.

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

Referenced by MinimizeWindowsProc().

◆ IsHidingState()

BOOL CTrayWindow::IsHidingState ( ) const
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3552 of file traywnd.cpp.

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

◆ IsHorizontal()

BOOL STDMETHODCALLTYPE CTrayWindow::IsHorizontal ( )
inline

Definition at line 2182 of file traywnd.cpp.

2183 {
2184 return IsPosHorizontal();
2185 }

◆ IsPointWithinShowDesktopButton()

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

Definition at line 2794 of file traywnd.cpp.

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

◆ IsPointWithinStartButton()

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

Definition at line 2751 of file traywnd.cpp.

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

Referenced by OnNcLButtonDown().

◆ IsPosHorizontal()

BOOL CTrayWindow::IsPosHorizontal ( )
inline

Definition at line 1208 of file traywnd.cpp.

1209 {
1210 return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1211 }

Referenced by AlignControls(), and IsHorizontal().

◆ IsSpecialHWND()

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

Definition at line 2176 of file traywnd.cpp.

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

Referenced by IsTaskWnd().

◆ IsTaskWnd()

BOOL STDMETHODCALLTYPE CTrayWindow::IsTaskWnd ( HWND  hWnd)
inline

Definition at line 2240 of file traywnd.cpp.

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

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

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

Referenced by ChangingWinPos(), and GetTrayRectFromScreenRect().

◆ MinimizeAll()

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

Definition at line 3093 of file traywnd.cpp.

3094 {
3095 MINIMIZE_INFO info;
3096 info.hwndDesktop = GetDesktopWindow();;
3097 info.hTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL);
3098 info.hwndProgman = FindWindowW(L"Progman", NULL);
3099 info.pMinimizedAll = &g_MinimizedAll;
3100 info.bShowDesktop = bShowDesktop;
3102
3105 }
HWND SetFocus()
Definition: atlwin.h:1198
static BOOL CALLBACK MinimizeWindowsProc(HWND hwnd, LPARAM lParam)
Definition: traywnd.cpp:3065
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 3065 of file traywnd.cpp.

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

3039 {
3040 OnAppBarNotifyAll(hMonitor, NULL, ABN_FULLSCREENAPP, bFullOpening);
3041 return S_OK;
3042 }
#define ABN_FULLSCREENAPP
Definition: shellapi.h:74

◆ OnActivate()

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

Definition at line 3244 of file traywnd.cpp.

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

2984 {
2985 DestroyWindow();
2986 return TRUE;
2987 }
BOOL DestroyWindow()
Definition: atlwin.h:462

◆ OnCommand()

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

Definition at line 3124 of file traywnd.cpp.

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

◆ OnContextMenu()

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

Definition at line 2852 of file traywnd.cpp.

2853 {
2854 LRESULT Ret = FALSE;
2855 POINT pt, *ppt = NULL;
2856 HWND hWndExclude = NULL;
2857
2858 /* Check if the administrator has forbidden access to context menus */
2860 return FALSE;
2861
2862 pt.x = (SHORT) LOWORD(lParam);
2863 pt.y = (SHORT) HIWORD(lParam);
2864
2865 if (pt.x != -1 || pt.y != -1)
2866 ppt = &pt;
2867 else
2868 hWndExclude = m_StartButton.m_hWnd;
2869
2871 {
2872 /* Make sure we can't track the context menu if the start
2873 menu is currently being shown */
2875 {
2876 CComPtr<IContextMenu> ctxMenu;
2878 TrackCtxMenu(ctxMenu, ppt, hWndExclude, m_Position == ABE_BOTTOM, this);
2879 }
2880 }
2881 else
2882 {
2883 /* See if the context menu should be handled by the task band site */
2884 if (ppt != NULL && m_TrayBandSite != NULL)
2885 {
2886 HWND hWndAtPt;
2887 POINT ptClient = *ppt;
2888
2889 /* Convert the coordinates to client-coordinates */
2890 ::MapWindowPoints(NULL, m_hWnd, &ptClient, 1);
2891
2892 hWndAtPt = ChildWindowFromPoint(ptClient);
2893 if (hWndAtPt != NULL &&
2894 (hWndAtPt == m_Rebar || ::IsChild(m_Rebar, hWndAtPt)))
2895 {
2896 /* Check if the user clicked on the task switch window */
2897 ptClient = *ppt;
2898 ::MapWindowPoints(NULL, m_Rebar, &ptClient, 1);
2899
2901 if (hWndAtPt == m_TaskSwitch)
2902 goto HandleTrayContextMenu;
2903
2904 /* Forward the message to the task band site */
2905 m_TrayBandSite->ProcessMessage(m_hWnd, uMsg, wParam, lParam, &Ret);
2906 }
2907 else
2908 goto HandleTrayContextMenu;
2909 }
2910 else
2911 {
2912HandleTrayContextMenu:
2913 /* Tray the default tray window context menu */
2914 TrackCtxMenu(this, ppt, NULL, FALSE, this);
2915 }
2916 }
2917 return Ret;
2918 }
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:932
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:1939
HWND WINAPI ChildWindowFromPointEx(_In_ HWND, _In_ POINT, _In_ UINT)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define CWP_SKIPDISABLED
Definition: winuser.h:209
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
#define BST_PUSHED
Definition: winuser.h:201
#define CWP_SKIPINVISIBLE
Definition: winuser.h:208

Referenced by OnNcRButtonUp().

◆ OnCopyData()

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

Definition at line 2486 of file traywnd.cpp.

2487 {
2489 if (!pCopyData)
2490 return FALSE;
2491
2492 switch (pCopyData->dwData)
2493 {
2494 case TABDMC_APPBAR:
2495 return OnAppBarMessage(pCopyData);
2496 case TABDMC_NOTIFY:
2497 case TABDMC_LOADINPROC:
2498 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2499 }
2500 return FALSE;
2501 }
LRESULT OnAppBarMessage(_Inout_ PCOPYDATASTRUCT pCopyData)
Definition: appbar.cpp:571
ULONG_PTR dwData
Definition: winuser.h:3077
#define TABDMC_APPBAR
Definition: undocshell.h:962
#define TABDMC_LOADINPROC
Definition: undocshell.h:964
#define TABDMC_NOTIFY
Definition: undocshell.h:963
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT

◆ OnCreate()

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

Definition at line 2297 of file traywnd.cpp.

2298 {
2299 HRESULT hRet;
2300
2301 ((ITrayWindow*)this)->AddRef();
2302
2303 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2304
2305 /* Create the Start button */
2307
2308 /* Load the saved tray window settings */
2310
2311 /* Create and initialize the start menu */
2315
2316 /* Create the task band */
2318 if (FAILED_UNEXPECTEDLY(hRet))
2319 return FALSE;
2320
2321 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2323 if (FAILED_UNEXPECTEDLY(hRet))
2324 return FALSE;
2325
2326 /* Create the tray notification window */
2328 if (FAILED_UNEXPECTEDLY(hRet))
2329 return FALSE;
2330
2331 /* Get the hwnd of the rebar */
2333 if (FAILED_UNEXPECTEDLY(hRet))
2334 return FALSE;
2335
2336 /* Get the hwnd of the tasks toolbar */
2338 if (FAILED_UNEXPECTEDLY(hRet))
2339 return FALSE;
2340
2341 /* Get the hwnd of the tray notification window */
2343 if (FAILED_UNEXPECTEDLY(hRet))
2344 return FALSE;
2345
2348 return FALSE;
2349
2350 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2351
2352 UpdateFonts();
2353
2355
2356 if (IsAutoHideState())
2357 {
2360 }
2361
2362 /* Set the initial lock state in the band site */
2364
2365 static const UINT winkeys[] =
2366 {
2379 };
2381 {
2382 for (UINT i = 0; i < _countof(winkeys); ++i)
2383 {
2384 UINT mod = HIBYTE(HIWORD(winkeys[i])), key = LOBYTE(HIWORD(winkeys[i]));
2385 RegisterHotKey(m_hWnd, LOWORD(winkeys[i]), mod, key);
2386 }
2387 }
2388
2389 return TRUE;
2390 }
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:1594
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:332
void UpdateFonts()
Definition: traywnd.cpp:1012
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:2218
#define MOD_WIN
Definition: winuser.h:2663
#define VK_F1
Definition: winuser.h:2274
#define VK_PAUSE
Definition: winuser.h:2224
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:2500
#define IID_PPV_ARG(Itype, ppType)

◆ OnCtlColorBtn()

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

Definition at line 2527 of file traywnd.cpp.

2528 {
2531 }
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 2392 of file traywnd.cpp.

2393 {
2394 return 0;
2395 }

◆ OnDisplayChange()

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

Definition at line 2472 of file traywnd.cpp.

2473 {
2474 /* Refresh workareas */
2476
2477 /* Load the saved tray window settings */
2479
2480 /* Move the tray window to the right position and resize it if necessary */
2482
2483 return TRUE;
2484 }
void RecomputeAllWorkareas()
Definition: appbar.cpp:449
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1572

◆ OnDoExitWindows()

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

Definition at line 3004 of file traywnd.cpp.

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

◆ OnEndSession()

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

Definition at line 2397 of file traywnd.cpp.

2398 {
2399 if (wParam)
2400 SaveState();
2401 return 0;
2402 }

◆ OnEnterSizeMove()

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

Definition at line 2662 of file traywnd.cpp.

2663 {
2664 InSizeMove = TRUE;
2665 IsDragging = FALSE;
2667 {
2668 /* Remove the clipping on multi monitor systems while dragging around */
2670 }
2672 return TRUE;
2673 }

◆ OnEraseBackground()

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

Definition at line 2459 of file traywnd.cpp.

2460 {
2461 HDC hdc = (HDC) wParam;
2462
2463 if (!m_Theme)
2464 {
2465 bHandled = FALSE;
2466 return 0;
2467 }
2468
2470 }
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2061

◆ OnExitSizeMove()

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

Definition at line 2675 of file traywnd.cpp.

2676 {
2677 InSizeMove = FALSE;
2679 {
2681
2682 /* Apply clipping */
2684 }
2685 return TRUE;
2686 }
#define WM_SIZE
Definition: winuser.h:1630
#define SIZE_RESTORED
Definition: winuser.h:2524

◆ OnGetMinMaxInfo()

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

Definition at line 3263 of file traywnd.cpp.

3264 {
3266 SIZE StartSize = m_StartButton.GetSize();
3267 pInfo->ptMinTrackSize.x = StartSize.cx + 2 * GetSystemMetrics(SM_CXFRAME);
3268 pInfo->ptMinTrackSize.y = StartSize.cy + 2 * GetSystemMetrics(SM_CYFRAME);
3269 return 0;
3270 }
POINT ptMinTrackSize
Definition: winuser.h:3706
#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 3025 of file traywnd.cpp.

3026 {
3027 bHandled = TRUE;
3028 return (LRESULT)m_TaskSwitch;
3029 }

◆ OnHotkey()

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

Definition at line 3044 of file traywnd.cpp.

3045 {
3046 return HandleHotKey(wParam);
3047 }
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:727

◆ OnInitMenuPopup()

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

Definition at line 3207 of file traywnd.cpp.

3208 {
3209 HMENU hMenu = (HMENU)wParam;
3211 {
3215 if (g_Arrangement != NONE)
3216 {
3219 MENUITEMINFOW mii = { sizeof(mii) };
3221 mii.fMask = MIIM_TYPE;
3222 mii.fType = MFT_STRING;
3223 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3225 }
3226 else
3227 {
3229 }
3230 }
3231 else
3232 {
3238 g_WindowPosBackup.RemoveAll();
3239 }
3240 return 0;
3241 }
#define IDS_TRAYWND_UNDO_TILE
Definition: resource.h:113
#define IDS_TRAYWND_UNDO_CASCADE
Definition: resource.h:112
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
LPWSTR dwTypeData
Definition: winuser.h:3345
CSimpleArray< WINDOWPOSBACKUPDATA > g_WindowPosBackup
Definition: traywnd.cpp:52
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:151
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI SetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_ENABLED
Definition: winuser.h:128
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
#define MFT_STRING
Definition: winuser.h:757
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MIIM_TYPE
Definition: winuser.h:736
#define MF_GRAYED
Definition: winuser.h:129
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ OnLButtonUp()

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

Definition at line 2976 of file traywnd.cpp.

2977 {
2979 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
2980 return FALSE;
2981 }
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 3140 of file traywnd.cpp.

3141 {
3143
3144 if (IsAutoHideState())
3145 {
3147 }
3148
3149 return TRUE;
3150 }
#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 2593 of file traywnd.cpp.

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

◆ OnNcActivate()

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

Definition at line 3170 of file traywnd.cpp.

3171 {
3173 DrawShowDesktopButton(); // We have to draw non-client area
3174 bHandled = TRUE;
3175 return ret;
3176 }
void DrawShowDesktopButton()
Definition: traywnd.cpp:2504
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 3178 of file traywnd.cpp.

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

◆ OnNcHitTest()

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

Definition at line 2538 of file traywnd.cpp.

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

◆ OnNcLButtonDblClick()

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

Definition at line 2954 of file traywnd.cpp.

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

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

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

◆ OnNcLButtonUp()

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

Definition at line 2964 of file traywnd.cpp.

2965 {
2966 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
2967 {
2970 bHandled = TRUE;
2971 }
2972
2973 return FALSE;
2974 }
#define WM_LBUTTONUP
Definition: winuser.h:1796

◆ OnNcPaint()

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

Definition at line 2511 of file traywnd.cpp.

2512 {
2513 DefWindowProc(uMsg, wParam, lParam);
2514 bHandled = TRUE;
2515
2517 {
2518 DrawShowDesktopButton(); // We have to draw non-client area
2519 return 0;
2520 }
2521
2522 DrawSizerWithTheme((HRGN) wParam);
2523 DrawShowDesktopButton(); // We have to draw non-client area
2524 return 0;
2525 }
int DrawSizerWithTheme(IN HRGN hRgn)
Definition: traywnd.cpp:2077

◆ OnNcRButtonUp()

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

Definition at line 2842 of file traywnd.cpp.

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

◆ OnNotify()

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

Definition at line 2920 of file traywnd.cpp.

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

◆ OnOpenStartMenu()

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

Definition at line 2989 of file traywnd.cpp.

2990 {
2991 HWND hwndStartMenu;
2992 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
2994 return FALSE;
2995
2996 if (::IsWindowVisible(hwndStartMenu))
2997 HideStartMenu();
2998 else
3000
3001 return TRUE;
3002 }

◆ OnRebarAutoSize()

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

Definition at line 3272 of file traywnd.cpp.

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

◆ OnSetFocus()

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

Definition at line 3256 of file traywnd.cpp.

3257 {
3259 return 0;
3260 }

◆ OnSettingChanged()

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

Definition at line 2424 of file traywnd.cpp.

2425 {
2426 if (wParam == SPI_SETNONCLIENTMETRICS)
2427 {
2430 UpdateFonts();
2433 }
2434
2435 // Note: We rely on CDesktopBrowser to get this message and call SHSettingsChanged
2436 if (m_DesktopWnd)
2438
2439 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2440 {
2441 HideStartMenu();
2442
2444#if 1 // FIXME: Please re-use the start menu
2445 /* Re-create the start menu */
2449 FIXME("Use UpdateStartMenu\n");
2450#else
2451 // Update the start menu
2453#endif
2454 }
2455
2456 return 0;
2457 }
#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:1672
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 3032 of file traywnd.cpp.

3033 {
3034 return ::SetWindowPos(m_hWnd, (HWND)wParam, 0, 0, 0, 0,
3036 }

◆ OnSize()

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

Definition at line 2636 of file traywnd.cpp.

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

◆ OnSizing()

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

Definition at line 2615 of file traywnd.cpp.

2616 {
2617 PRECT pRect = (PRECT) lParam;
2618
2620 {
2621 FitToRebar(pRect);
2622 }
2623 else
2624 {
2625 *pRect = m_TrayRects[m_Position];
2626 }
2627 return TRUE;
2628 }

◆ OnSysChar()

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

Definition at line 2688 of file traywnd.cpp.

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

◆ OnSysColorChange()

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

Definition at line 2533 of file traywnd.cpp.

2534 {
2535 return SendMessageW(m_Rebar, uMsg, wParam, lParam);
2536 }

◆ OnSysCommand()

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

Definition at line 3014 of file traywnd.cpp.

3015 {
3016 if (wParam == SC_CLOSE)
3017 {
3018 return DoExitWindows();
3019 }
3020
3021 bHandled = FALSE;
3022 return TRUE;
3023 }

◆ OnTaskbarSettingsChanged()

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

Definition at line 3323 of file traywnd.cpp.

3324 {
3325 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
3326
3327 /* Propagate the new settings to the children */
3330
3331 /* Toggle autohide */
3332 SetAutoHideState(newSettings->sr.AutoHide);
3333
3334 /* Toggle lock state */
3335 Lock(newSettings->bLock);
3336
3337 /* Toggle OnTop state */
3338 UpdateAlwaysOnTop(newSettings->sr.AlwaysOnTop);
3339
3340 /* Adjust taskbar size */
3342
3344 return 0;
3345 }
void SetAutoHideState(_In_ BOOL bAutoHide) override
Definition: traywnd.cpp:3561
void UpdateAlwaysOnTop(_In_ BOOL bAlwaysOnTop) override
Definition: traywnd.cpp:3573

◆ OnThemeChanged()

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

Definition at line 2404 of file traywnd.cpp.

2405 {
2406 if (m_Theme)
2408
2409 m_Theme = OpenThemeData(m_hWnd, L"TaskBar");
2410
2411 if (m_Theme)
2412 {
2414 }
2415 else
2416 {
2418 }
2420
2421 return TRUE;
2422 }
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 3152 of file traywnd.cpp.

3153 {
3154 switch (wParam)
3155 {
3158 break;
3159 case TIMER_ID_AUTOHIDE:
3161 break;
3162 default:
3163 WARN("Invalid timer ID: %u\n", (UINT)wParam);
3164 bHandled = FALSE;
3165 break;
3166 }
3167 return 0;
3168 }
#define WARN(fmt,...)
Definition: precomp.h:61
void ProcessMouseTracking()
Definition: traywnd.cpp:1899
void ProcessAutoHide()
Definition: traywnd.cpp:1946

◆ OnWindowPosChanging()

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

Definition at line 2630 of file traywnd.cpp.

2631 {
2633 return TRUE;
2634 }
VOID ChangingWinPos(IN OUT LPWINDOWPOS pwp)
Definition: traywnd.cpp:1390

◆ Open()

HRESULT STDMETHODCALLTYPE CTrayWindow::Open ( )
inline

Definition at line 2121 of file traywnd.cpp.

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

595 {
596 WCHAR szDir[MAX_PATH];
597
598 if (SHGetSpecialFolderPath(hWndOwner,
599 szDir,
601 FALSE))
602 {
603 ShellExecute(hWndOwner,
604 lpOperation,
605 szDir,
606 NULL,
607 NULL,
609 }
610 }
#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 612 of file traywnd.cpp.

613 {
614 ShellExecute(hWndOwner,
615 TEXT("open"),
616 TEXT("taskmgr.exe"),
617 NULL,
618 NULL,
620 }

Referenced by ExecContextMenuCmd(), and HandleCommand().

◆ PopupStartMenu()

void CTrayWindow::PopupStartMenu ( )
inline

Definition at line 1858 of file traywnd.cpp.

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

Referenced by OnNcLButtonDown(), and OnOpenStartMenu().

◆ ProcessAutoHide()

void CTrayWindow::ProcessAutoHide ( )
inline

Definition at line 1946 of file traywnd.cpp.

1947 {
1950
1951 switch (m_AutoHideState)
1952 {
1953 case AUTOHIDE_HIDING:
1954 switch (m_Position)
1955 {
1956 case ABE_LEFT:
1957 m_AutoHideOffset.cy = 0;
1959 if (m_AutoHideOffset.cx < -w)
1961 break;
1962 case ABE_TOP:
1963 m_AutoHideOffset.cx = 0;
1965 if (m_AutoHideOffset.cy < -h)
1967 break;
1968 case ABE_RIGHT:
1969 m_AutoHideOffset.cy = 0;
1971 if (m_AutoHideOffset.cx > w)
1973 break;
1974 case ABE_BOTTOM:
1975 m_AutoHideOffset.cx = 0;
1977 if (m_AutoHideOffset.cy > h)
1979 break;
1980 }
1981
1983 {
1985 break;
1986 }
1987
1988 /* fallthrough */
1989 case AUTOHIDE_HIDDEN:
1990 switch (m_Position)
1991 {
1992 case ABE_LEFT:
1994 m_AutoHideOffset.cy = 0;
1995 break;
1996 case ABE_TOP:
1997 m_AutoHideOffset.cx = 0;
1999 break;
2000 case ABE_RIGHT:
2002 m_AutoHideOffset.cy = 0;
2003 break;
2004 case ABE_BOTTOM:
2005 m_AutoHideOffset.cx = 0;
2007 break;
2008 }
2009
2012 break;
2013
2014 case AUTOHIDE_SHOWING:
2016 {
2018 }
2020 {
2022 }
2023 else
2024 {
2025 m_AutoHideOffset.cx = 0;
2026 }
2027
2029 {
2031 }
2033 {
2035 }
2036 else
2037 {
2038 m_AutoHideOffset.cy = 0;
2039 }
2040
2041 if (m_AutoHideOffset.cx != 0 || m_AutoHideOffset.cy != 0)
2042 {
2044 break;
2045 }
2046
2047 /* fallthrough */
2048 case AUTOHIDE_SHOWN:
2051 break;
2052 }
2053
2055 }
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 1899 of file traywnd.cpp.

1900 {
1901 POINT pt;
1902 GetCursorPos(&pt);
1903
1904 RECT rcCurrent;
1905 GetWindowRect(&rcCurrent);
1906
1907 BOOL over = PtInRect(&rcCurrent, pt);
1909 over = TRUE;
1910
1912 if (over)
1913 {
1914 if (state == AUTOHIDE_HIDING)
1915 {
1916 TRACE("AutoHide cancelling hide.\n");
1919 }
1920 else if (state == AUTOHIDE_HIDDEN)
1921 {
1922 TRACE("AutoHide starting show.\n");
1925 }
1926 }
1927 else
1928 {
1929 if (state == AUTOHIDE_SHOWING)
1930 {
1931 TRACE("AutoHide cancelling show.\n");
1934 }
1935 else if (state == AUTOHIDE_SHOWN)
1936 {
1937 TRACE("AutoHide starting hide.\n");
1940 }
1941
1943 }
1944 }
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 2257 of file traywnd.cpp.

2262 {
2263 if (!m_ContextMenu)
2264 {
2267 return hr;
2268 }
2269
2270 return m_ContextMenu->QueryContextMenu(hPopup, indexMenu, idCmdFirst, idCmdLast, uFlags);
2271 }
UINT uFlags
Definition: api.c:59
HRESULT TrayWindowCtxMenuCreator(ITrayWindow *TrayWnd, IN HWND hWndOwner, IContextMenu **ppCtxMenu)
Definition: traywnd.cpp:3714

◆ RaiseStartButton()

virtual HRESULT CTrayWindow::RaiseStartButton ( )
inlinevirtual

Definition at line 3504 of file traywnd.cpp.

3505 {
3506 m_StartButton.SendMessageW(BM_SETSTATE, FALSE, 0);
3507 return S_OK;
3508 }

Referenced by Tray_OnStartMenuDismissed().

◆ RegisterDesktopWindow()

STDMETHODIMP CTrayWindow::RegisterDesktopWindow ( IN HWND  hWndDesktop)
inlineoverride

Definition at line 3489 of file traywnd.cpp.

3490 {
3491 TRACE("IShellDesktopTray::RegisterDesktopWindow(0x%p)\n", hWndDesktop);
3492
3493 m_DesktopWnd = hWndDesktop;
3494 return S_OK;
3495 }

◆ RegLoadSettings()

VOID CTrayWindow::RegLoadSettings ( )
inline

Definition at line 1594 of file traywnd.cpp.

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

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

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

◆ RestoreAll()

VOID CTrayWindow::RestoreAll ( )
inline

Definition at line 3112 of file traywnd.cpp.

3113 {
3114 for (INT i = g_MinimizedAll.GetSize() - 1; i >= 0; --i)
3115 {
3116 HWND hwnd = g_MinimizedAll[i].hwnd;
3119 }
3120
3122 }
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:399
#define WS_OVERLAPPED
Definition: pedump.c:615
#define WS_DISABLED
Definition: pedump.c:621
#define SS_LEFT
Definition: pedump.c:692
#define WC_STATIC
Definition: commctrl.h:4687
#define RFF_CALCDIRECTORY
Definition: run.h:35
#define CreateWindowEx
Definition: winuser.h:5840

◆ s_RunFileDlgThread()

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

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

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

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:64

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

◆ SetAutoHideState()

void CTrayWindow::SetAutoHideState ( _In_ BOOL  bAutoHide)
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3561 of file traywnd.cpp.

3562 {
3563 g_TaskbarSettings.sr.AutoHide = bAutoHide;
3565
3567 if (bAutoHide)
3569 else
3571 }

Referenced by OnTaskbarSettingsChanged().

◆ ShowDesktop()

VOID CTrayWindow::ShowDesktop ( )
inline

Definition at line 3107 of file traywnd.cpp.

3108 {
3110 }

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

◆ ToggleDesktop()

VOID CTrayWindow::ToggleDesktop ( )
inline

Definition at line 622 of file traywnd.cpp.

623 {
625 {
626 ShowDesktop();
627 }
628 else
629 {
630 RestoreAll();
631 }
632 }

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

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

Referenced by OnContextMenu().

◆ TrackMenu()

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

Definition at line 861 of file traywnd.cpp.

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

Referenced by OnSysChar().

◆ TrayMessageLoop()

VOID CTrayWindow::TrayMessageLoop ( )
inline

Definition at line 3439 of file traywnd.cpp.

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

Referenced by TrayMessageLoop().

◆ TrayProcessMessages()

VOID CTrayWindow::TrayProcessMessages ( )
inline

Definition at line 3419 of file traywnd.cpp.

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

Referenced by TrayProcessMessages().

◆ TrayPropertiesThread()

DWORD WINAPI CTrayWindow::TrayPropertiesThread ( )
inline

Definition at line 539 of file traywnd.cpp.

540 {
541 HWND hwnd;
542 RECT posRect;
543
546 WC_STATIC,
547 NULL,
549 posRect.left,
550 posRect.top,
551 posRect.right - posRect.left,
552 posRect.bottom - posRect.top,
553 NULL,
554 NULL,
555 NULL,
556 NULL);
557
559
561
564
565 return 0;
566 }
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 3498 of file traywnd.cpp.

3499 {
3500 TRACE("IShellDesktopTray::Unknown(%u,%u) unimplemented!\n", dwUnknown1, dwUnknown2);
3501 return S_OK;
3502 }

◆ UpdateAlwaysOnTop()

void CTrayWindow::UpdateAlwaysOnTop ( _In_ BOOL  bAlwaysOnTop)
inlineoverrideprotectedvirtual

Implements CAppBarManager.

Definition at line 3573 of file traywnd.cpp.

3574 {
3575 g_TaskbarSettings.sr.AlwaysOnTop = bAlwaysOnTop;
3576 HWND hwndInsertAfter = (bAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST);
3577 SetWindowPos(hwndInsertAfter, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
3578 }
#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 1012 of file traywnd.cpp.

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

Referenced by OnCreate(), and OnSettingChanged().

Member Data Documentation

◆ 

union { ... } CTrayWindow::@124

◆ Flags

DWORD CTrayWindow::Flags

Definition at line 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: