ReactOS 0.4.16-dev-91-g764881a
CTrayWindow Class Reference
Inheritance diagram for CTrayWindow:
Collaboration diagram for CTrayWindow:

Classes

struct  MINIMIZE_INFO
 

Public Member Functions

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

Static Public Member Functions

static DWORD WINAPI s_RunFileDlgThread (IN OUT PVOID pParam)
 
static DWORD WINAPI s_TrayPropertiesThread (IN OUT PVOID pParam)
 
static BOOL IsDialog (HWND hwnd)
 
static BOOL CALLBACK MinimizeWindowsProc (HWND hwnd, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CComCoClass< CTrayWindow >
static LPCTSTR WINAPI GetObjectDescription ()
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CTrayWindow, CWindow, CControlWinTraits >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Public Attributes

CComPtr< ITrayBandSite > m_TrayBandSite
 
union {
   DWORD   Flags
 
   struct {
      DWORD   InSizeMove: 1
 
      DWORD   IsDragging: 1
 
      DWORD   NewPosSize: 1
 
      DWORD   IgnorePulse: 1
 
   } 
 
}; 
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 

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}
 

Detailed Description

Definition at line 322 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CTrayWindow()

CTrayWindow::CTrayWindow ( )
inline

Definition at line 385 of file traywnd.cpp.

385 :
388 m_Theme(NULL),
389 m_Font(NULL),
391 m_Rebar(NULL),
394 m_Position(0),
403 Flags(0)
404 {
410 }
DWORD m_DraggingPosition
Definition: traywnd.cpp:353
HWND m_TaskSwitch
Definition: traywnd.cpp:345
DWORD Flags
Definition: traywnd.cpp:373
HWND m_Rebar
Definition: traywnd.cpp:344
HMONITOR m_Monitor
Definition: traywnd.cpp:351
DWORD IgnorePulse
Definition: traywnd.cpp:380
CStartButton m_StartButton
Definition: traywnd.cpp:331
DWORD m_Position
Definition: traywnd.cpp:350
HTHEME m_Theme
Definition: traywnd.cpp:339
TRACKMOUSEEVENT m_MouseTrackingInfo
Definition: traywnd.cpp:364
HMONITOR m_PreviousMonitor
Definition: traywnd.cpp:352
HDPA m_ShellServices
Definition: traywnd.cpp:366
SIZE m_TraySize
Definition: traywnd.cpp:357
RECT m_TrayRects[4]
Definition: traywnd.cpp:356
HMONITOR m_DraggingMonitor
Definition: traywnd.cpp:354
UINT m_AutoHideState
Definition: traywnd.cpp:362
CTrayShowDesktopButton * m_pShowDesktopButton
Definition: traywnd.cpp:332
HWND m_TrayPropertiesOwner
Definition: traywnd.cpp:359
SIZE m_AutoHideOffset
Definition: traywnd.cpp:363
HWND m_RunFileDlgOwner
Definition: traywnd.cpp:360
HFONT m_Font
Definition: traywnd.cpp:341
HWND m_DesktopWnd
Definition: traywnd.cpp:343
HWND m_TrayNotify
Definition: traywnd.cpp:346
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define ZeroMemory
Definition: winbase.h:1712

◆ ~CTrayWindow()

virtual CTrayWindow::~CTrayWindow ( )
inlinevirtual

Definition at line 412 of file traywnd.cpp.

413 {
414 if (m_ShellServices != NULL)
415 {
418 }
419
420 if (m_Font != NULL)
421 {
423 m_Font = NULL;
424 }
425
426 if (m_Theme)
427 {
429 m_Theme = NULL;
430 }
431
433 }
HRESULT ShutdownShellServices(HDPA hdpa)
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
pKey DeleteObject()
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)

Member Function Documentation

◆ _Init()

void CTrayWindow::_Init ( )
inline

Definition at line 3540 of file traywnd.cpp.

3541 {
3542 m_Position = (DWORD) -1;
3543 }
#define DWORD
Definition: nt_native.h:44

◆ AdjustSizerRect()

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

Definition at line 1148 of file traywnd.cpp.

1149 {
1151 SIZE size;
1152
1153 if (pos > ABE_BOTTOM)
1154 pos = ABE_BOTTOM;
1155
1156 HRESULT hr = GetThemePartSize(m_Theme, NULL, iSizerPart[pos], 0, NULL, TS_TRUE, &size);
1158 return;
1159
1160 switch (pos)
1161 {
1162 case ABE_TOP:
1163 rc->bottom -= size.cy;
1164 break;
1165 case ABE_BOTTOM:
1166 rc->top += size.cy;
1167 break;
1168 case ABE_LEFT:
1169 rc->right -= size.cx;
1170 break;
1171 case ABE_RIGHT:
1172 rc->left += size.cx;
1173 break;
1174 }
1175 }
@ TS_TRUE
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
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 1688 of file traywnd.cpp.

1689 {
1690 RECT rcClient;
1691 SIZE TraySize, StartSize;
1692 POINT ptTrayNotify = { 0, 0 };
1693 BOOL Horizontal;
1694 HDWP dwp;
1695
1697 if (prcClient != NULL)
1698 {
1699 rcClient = *prcClient;
1700 }
1701 else
1702 {
1703 if (!GetClientRect(&rcClient))
1704 {
1705 ERR("Could not get client rect lastErr=%d\n", GetLastError());
1706 return;
1707 }
1708 }
1709
1710 Horizontal = IsPosHorizontal();
1711
1712 /* We're about to resize/move the start button, the rebar control and
1713 the tray notification control */
1714 dwp = BeginDeferWindowPos(4);
1715 if (dwp == NULL)
1716 {
1717 ERR("BeginDeferWindowPos failed. lastErr=%d\n", GetLastError());
1718 return;
1719 }
1720
1721 /* Limit the Start button width to the client width, if necessary */
1722 StartSize = m_StartButton.GetSize();
1723 if (StartSize.cx > rcClient.right)
1724 StartSize.cx = rcClient.right;
1725
1726 HWND hwndTaskToolbar = ::GetWindow(m_TaskSwitch, GW_CHILD);
1727 if (hwndTaskToolbar)
1728 {
1729 DWORD size = SendMessageW(hwndTaskToolbar, TB_GETBUTTONSIZE, 0, 0);
1730
1731 /* Themed button covers Edge area as well */
1732 StartSize.cy = HIWORD(size) + (m_Theme ? GetSystemMetrics(SM_CYEDGE) : 0);
1733 }
1734
1735 if (m_StartButton.m_hWnd != NULL)
1736 {
1737 /* Resize and reposition the button */
1738 dwp = m_StartButton.DeferWindowPos(dwp,
1739 NULL,
1740 0,
1741 0,
1742 StartSize.cx,
1743 StartSize.cy,
1745 if (dwp == NULL)
1746 {
1747 ERR("DeferWindowPos for start button failed. lastErr=%d\n", GetLastError());
1748 return;
1749 }
1750 }
1751
1752 /* Determine the size that the tray notification window needs */
1753 if (Horizontal)
1754 {
1755 TraySize.cx = 0;
1756 TraySize.cy = rcClient.bottom;
1757 }
1758 else
1759 {
1760 TraySize.cx = rcClient.right;
1761 TraySize.cy = 0;
1762 }
1763
1764 if (m_TrayNotify != NULL &&
1767 (WPARAM)Horizontal,
1768 (LPARAM)&TraySize))
1769 {
1770 /* Move the tray notification window to the desired location */
1771 if (Horizontal)
1772 ptTrayNotify.x = rcClient.right - TraySize.cx;
1773 else
1774 ptTrayNotify.y = rcClient.bottom - TraySize.cy;
1775
1776 dwp = ::DeferWindowPos(dwp,
1778 NULL,
1779 ptTrayNotify.x,
1780 ptTrayNotify.y,
1781 TraySize.cx,
1782 TraySize.cy,
1784 if (dwp == NULL)
1785 {
1786 ERR("DeferWindowPos for notification area failed. lastErr=%d\n", GetLastError());
1787 return;
1788 }
1789 }
1790
1791 /* Resize/Move the rebar control */
1792 if (m_Rebar != NULL)
1793 {
1794 POINT ptRebar = { 0, 0 };
1795 SIZE szRebar;
1796
1797 SetWindowStyle(m_Rebar, CCS_VERT, Horizontal ? 0 : CCS_VERT);
1798
1799 if (Horizontal)
1800 {
1801 ptRebar.x = StartSize.cx + GetSystemMetrics(SM_CXSIZEFRAME);
1802 szRebar.cx = ptTrayNotify.x - ptRebar.x;
1803 szRebar.cy = rcClient.bottom;
1804 }
1805 else
1806 {
1807 ptRebar.y = StartSize.cy + GetSystemMetrics(SM_CYSIZEFRAME);
1808 szRebar.cx = rcClient.right;
1809 szRebar.cy = ptTrayNotify.y - ptRebar.y;
1810 }
1811
1812 dwp = ::DeferWindowPos(dwp,
1813 m_Rebar,
1814 NULL,
1815 ptRebar.x,
1816 ptRebar.y,
1817 szRebar.cx,
1818 szRebar.cy,
1820 }
1821
1822 if (dwp != NULL)
1823 EndDeferWindowPos(dwp);
1824
1825 if (m_TaskSwitch != NULL)
1826 {
1827 /* Update the task switch window configuration */
1829 }
1830 }
#define ERR(fmt,...)
Definition: precomp.h:57
#define TSWM_UPDATETASKBARPOS
Definition: precomp.h:387
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:370
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:219
VOID UpdateSize()
Definition: traywnd.cpp:224
BOOL IsPosHorizontal()
Definition: traywnd.cpp:1223
HRESULT WINAPI GetWindow(HWND *phwnd)
Definition: traywnd.cpp:3527
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:1245
#define SM_CYEDGE
Definition: winuser.h:1012
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SendMessage
Definition: winuser.h:5855
#define SM_CXSIZEFRAME
Definition: winuser.h:996
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:766
#define SWP_NOZORDER
Definition: winuser.h:1250
#define SM_CYSIZEFRAME
Definition: winuser.h:998
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 1499 of file traywnd.cpp.

1500 {
1501 RECT rcClip, rcWindow;
1502 HRGN hClipRgn;
1503
1504 if (GetWindowRect(&rcWindow))
1505 {
1506 /* Disable clipping on systems with only one monitor */
1508 Clip = FALSE;
1509
1510 if (Clip)
1511 {
1512 rcClip = rcWindow;
1513
1514 GetScreenRect(m_Monitor, &rcClip);
1515
1516 if (!IntersectRect(&rcClip, &rcClip, &rcWindow))
1517 {
1518 rcClip = rcWindow;
1519 }
1520
1521 OffsetRect(&rcClip,
1522 -rcWindow.left,
1523 -rcWindow.top);
1524
1525 hClipRgn = CreateRectRgnIndirect(&rcClip);
1526 }
1527 else
1528 hClipRgn = NULL;
1529
1530 /* Set the clipping region or make sure the window isn't clipped
1531 by disabling it explicitly. */
1532 SetWindowRgn(hClipRgn, TRUE);
1533 }
1534 }
HMONITOR GetScreenRect(IN HMONITOR hMonitor, IN OUT RECT *pRect)
Definition: traywnd.cpp:1110
#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:1043

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

◆ CalculateValidSize()

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

Definition at line 1228 of file traywnd.cpp.

1231 {
1232 RECT rcScreen;
1233 //BOOL Horizontal;
1234 HMONITOR hMon;
1235 SIZE szMax, szWnd;
1236
1237 //Horizontal = IsPosHorizontal();
1238
1239 szWnd.cx = pRect->right - pRect->left;
1240 szWnd.cy = pRect->bottom - pRect->top;
1241
1242 rcScreen = *pRect;
1243 hMon = GetScreenRectFromRect(
1244 &rcScreen,
1245 MONITOR_DEFAULTTONEAREST);
1246
1247 /* Calculate the maximum size of the tray window and limit the window
1248 size to half of the screen's size. */
1249 szMax.cx = (rcScreen.right - rcScreen.left) / 2;
1250 szMax.cy = (rcScreen.bottom - rcScreen.top) / 2;
1251 if (szWnd.cx > szMax.cx)
1252 szWnd.cx = szMax.cx;
1253 if (szWnd.cy > szMax.cy)
1254 szWnd.cy = szMax.cy;
1255
1256 /* FIXME - calculate */
1257
1259 &rcScreen,
1260 &szWnd,
1261 pRect);
1262
1263 return hMon;
1264 }
HMONITOR GetScreenRectFromRect(IN OUT RECT *pRect, IN DWORD dwFlags)
Definition: traywnd.cpp:1058
VOID GetTrayRectFromScreenRect(IN DWORD Position, IN const RECT *pScreen, IN const SIZE *pTraySize OPTIONAL, OUT RECT *pRect)
Definition: traywnd.cpp:1202
static COORD Position
Definition: mouse.c:34

Referenced by FitToRebar().

◆ ChangingWinPos()

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

Definition at line 1405 of file traywnd.cpp.

1406 {
1407 RECT rcTray;
1408
1409 if (IsDragging)
1410 {
1411 rcTray.left = pwp->x;
1412 rcTray.top = pwp->y;
1413 rcTray.right = rcTray.left + pwp->cx;
1414 rcTray.bottom = rcTray.top + pwp->cy;
1415
1416 if (!EqualRect(&rcTray,
1418 {
1419 /* Recalculate the rectangle, the user dragged the tray
1420 window to another monitor or the window was somehow else
1421 moved or resized */
1423 &rcTray,
1425 //m_TrayRects[DraggingPosition] = rcTray;
1426 }
1427
1428 //Monitor = CalculateValidSize(DraggingPosition,
1429 // &rcTray);
1430
1435 IsDragging = FALSE;
1436
1437 m_TrayRects[m_Position] = rcTray;
1438 goto ChangePos;
1439 }
1440 else if (GetWindowRect(&rcTray))
1441 {
1442 if (InSizeMove)
1443 {
1444 if (!(pwp->flags & SWP_NOMOVE))
1445 {
1446 rcTray.left = pwp->x;
1447 rcTray.top = pwp->y;
1448 }
1449
1450 if (!(pwp->flags & SWP_NOSIZE))
1451 {
1452 rcTray.right = rcTray.left + pwp->cx;
1453 rcTray.bottom = rcTray.top + pwp->cy;
1454 }
1455
1457
1458 if (!(pwp->flags & (SWP_NOMOVE | SWP_NOSIZE)))
1459 {
1460 SIZE szWnd;
1461
1462 szWnd.cx = pwp->cx;
1463 szWnd.cy = pwp->cy;
1464
1465 MakeTrayRectWithSize(m_Position, &szWnd, &rcTray);
1466 }
1467
1468 m_TrayRects[m_Position] = rcTray;
1469 }
1470 else if (m_Position != (DWORD)-1)
1471 {
1472 /* If the user isn't resizing the tray window we need to make sure the
1473 new size or position is valid. this is to prevent changes to the window
1474 without user interaction. */
1475 rcTray = m_TrayRects[m_Position];
1476
1478 {
1479 rcTray.left += m_AutoHideOffset.cx;
1480 rcTray.right += m_AutoHideOffset.cx;
1481 rcTray.top += m_AutoHideOffset.cy;
1482 rcTray.bottom += m_AutoHideOffset.cy;
1483 }
1484
1485 }
1486
1487ChangePos:
1488 m_TraySize.cx = rcTray.right - rcTray.left;
1489 m_TraySize.cy = rcTray.bottom - rcTray.top;
1490
1491 pwp->flags &= ~(SWP_NOMOVE | SWP_NOSIZE);
1492 pwp->x = rcTray.left;
1493 pwp->y = rcTray.top;
1494 pwp->cx = m_TraySize.cx;
1495 pwp->cy = m_TraySize.cy;
1496 }
1497 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
DWORD InSizeMove
Definition: traywnd.cpp:377
DWORD IsDragging
Definition: traywnd.cpp:378
VOID MakeTrayRectWithSize(IN DWORD Position, IN const SIZE *pTraySize, IN OUT RECT *pRect)
Definition: traywnd.cpp:1177
DWORD GetDraggingRectFromRect(IN OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1387
TW_STRUCKRECTS2 sr
Definition: precomp.h:225
DWORD AutoHide
Definition: precomp.h:204
DWORD Position
Definition: precomp.h:210
#define SWP_NOMOVE
Definition: winuser.h:1247
#define SWP_NOSIZE
Definition: winuser.h:1248
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)

Referenced by OnWindowPosChanging().

◆ CheckTrayWndPosition()

VOID CTrayWindow::CheckTrayWndPosition ( )
inline

Definition at line 1588 of file traywnd.cpp.

1589 {
1590 /* Force the rebar bands to resize */
1592 IID_IDeskBand,
1594 0,
1595 NULL,
1596 NULL);
1597
1598 /* Calculate the size of the taskbar based on the rebar */
1600
1601 /* Move the tray window */
1602 /* The handler of WM_WINDOWPOSCHANGING will override whatever size
1603 * and position we use here with m_TrayRects */
1608 }
VOID ResizeWorkArea()
Definition: traywnd.cpp:1536
void FitToRebar(PRECT pRect)
Definition: traywnd.cpp:1832
CComPtr< ITrayBandSite > m_TrayBandSite
Definition: traywnd.cpp:369
VOID ApplyClipping(IN BOOL Clip)
Definition: traywnd.cpp:1499
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:2527
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:1214
#define RDW_ALLCHILDREN
Definition: winuser.h:1224
#define RDW_FRAME
Definition: winuser.h:1215
#define RDW_INTERNALPAINT
Definition: winuser.h:1216
#define RDW_INVALIDATE
Definition: winuser.h:1217

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

◆ Close()

HRESULT STDMETHODCALLTYPE CTrayWindow::Close ( )
inline

Definition at line 2187 of file traywnd.cpp.

2188 {
2189 if (m_hWnd != NULL)
2190 {
2193 0,
2194 0);
2195 }
2196
2197 return S_OK;
2198 }
#define S_OK
Definition: intsafe.h:52
#define WM_APP_TRAYDESTROY
Definition: traywnd.cpp:29

◆ ContextSensitiveHelp()

HRESULT WINAPI CTrayWindow::ContextSensitiveHelp ( BOOL  fEnterMode)
inline

Implements IOleWindow.

Definition at line 3535 of file traywnd.cpp.

3536 {
3537 return E_NOTIMPL;
3538 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DisplayProperties()

HWND STDMETHODCALLTYPE CTrayWindow::DisplayProperties ( )
inline

Definition at line 590 of file traywnd.cpp.

591 {
592 HWND hTrayProp;
593
595 {
597 if (hTrayProp != NULL &&
598 hTrayProp != m_TrayPropertiesOwner)
599 {
600 SetForegroundWindow(hTrayProp);
601 return NULL;
602 }
603 }
604
606 return NULL;
607 }
HWND GetLastActivePopup() const
Definition: atlwin.h:676
static DWORD WINAPI s_TrayPropertiesThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:583
#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 537 of file traywnd.cpp.

538 {
539 HWND hRunDlg;
541 {
543 if (hRunDlg != NULL &&
544 hRunDlg != m_RunFileDlgOwner)
545 {
546 SetForegroundWindow(hRunDlg);
547 return;
548 }
549 }
550
552 }
static DWORD WINAPI s_RunFileDlgThread(IN OUT PVOID pParam)
Definition: traywnd.cpp:531

Referenced by HandleCommand(), and HandleHotKey().

◆ DoExitWindows()

LRESULT CTrayWindow::DoExitWindows ( )
inline

Definition at line 475 of file traywnd.cpp.

476 {
477 SaveState();
478
479 /* Display the ReactOS Shutdown Dialog */
481
482 /*
483 * If the user presses CTRL+ALT+SHIFT while exiting
484 * the shutdown dialog, exit the shell cleanly.
485 */
486 if ((GetKeyState(VK_CONTROL) & 0x8000) &&
487 (GetKeyState(VK_SHIFT) & 0x8000) &&
488 (GetKeyState(VK_MENU) & 0x8000))
489 {
490 PostMessage(WM_QUIT, 0, 0);
491 }
492 return 0;
493 }
void SaveState()
Definition: traywnd.cpp:467
void WINAPI ExitWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1608
#define WM_QUIT
Definition: winuser.h:1626
#define VK_CONTROL
Definition: winuser.h:2206
#define PostMessage
Definition: winuser.h:5844
#define VK_SHIFT
Definition: winuser.h:2205
SHORT WINAPI GetKeyState(_In_ int)
#define VK_MENU
Definition: winuser.h:2207

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

◆ DrawShowDesktopButton()

void CTrayWindow::DrawShowDesktopButton ( )
inline

Definition at line 2516 of file traywnd.cpp.

2517 {
2518 if (!m_pShowDesktopButton || !m_pShowDesktopButton->IsWindow())
2519 return;
2521 }
#define RDW_UPDATENOW
Definition: winuser.h:1223
#define RDW_ERASENOW
Definition: winuser.h:1222

Referenced by OnNcActivate(), and OnNcPaint().

◆ DrawSizerWithTheme()

int CTrayWindow::DrawSizerWithTheme ( IN HRGN  hRgn)
inline

Definition at line 2102 of file traywnd.cpp.

2103 {
2104 HDC hdc;
2105 RECT rect;
2107 SIZE size;
2108
2110
2113 return 0;
2114
2116 OffsetRect(&rect, -rect.left, -rect.top);
2117
2118 hdc = GetWindowDC();
2119
2120 switch (m_Position)
2121 {
2122 case ABE_LEFT:
2123 rect.left = rect.right - size.cx;
2124 break;
2125 case ABE_TOP:
2126 rect.top = rect.bottom - size.cy;
2127 break;
2128 case ABE_RIGHT:
2129 rect.right = rect.left + size.cx;
2130 break;
2131 case ABE_BOTTOM:
2132 default:
2133 rect.bottom = rect.top + size.cy;
2134 break;
2135 }
2136
2137 DrawThemeBackground(m_Theme, hdc, iSizerPart[m_Position], 0, &rect, 0);
2138
2139 ReleaseDC(hdc);
2140 return 0;
2141 }
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 2086 of file traywnd.cpp.

2087 {
2088 RECT rect;
2090
2092
2093 if (m_Theme)
2094 {
2096 DrawThemeBackground(m_Theme, hdc, iSBkgndPart[m_Position], 0, &rect, 0);
2097 }
2098
2099 return 0;
2100 }
@ 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 649 of file traywnd.cpp.

650 {
651 switch (uiCmd)
652 {
655 break;
656
659 TEXT("open"));
660 break;
661
664 TEXT("explore"));
665 break;
666
667 case ID_LOCKTASKBAR:
669 break;
670
673 break;
674
677 break;
678
680 ShowDesktop();
681 break;
682
685 if (g_Arrangement == NONE)
686 {
688 }
692 break;
693
696 if (g_Arrangement == NONE)
697 {
699 }
703 break;
704
707 if (g_Arrangement == NONE)
708 {
710 }
714 break;
715
718 break;
719
721 //FIXME: Use SHRunControlPanel
722 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
723 break;
724
726 RestoreAll();
727 break;
728
729 default:
730 TRACE("ITrayWindow::ExecContextMenuCmd(%u): Unhandled Command ID!\n", uiCmd);
731 return FALSE;
732 }
733
734 return TRUE;
735 }
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define ID_SHELL_CMD_OPEN_TASKMGR
Definition: resource.h:208
#define ID_SHELL_CMD_CUST_NOTIF
Definition: resource.h:214
#define ID_SHELL_CMD_UNDO_ACTION
Definition: resource.h:209
#define ID_SHELL_CMD_PROPERTIES
Definition: resource.h:204
#define ID_SHELL_CMD_TILE_WND_H
Definition: resource.h:212
#define ID_SHELL_CMD_CASCADE_WND
Definition: resource.h:213
#define ID_SHELL_CMD_RESTORE_ALL
Definition: resource.h:216
#define ID_SHELL_CMD_TILE_WND_V
Definition: resource.h:211
#define ID_LOCKTASKBAR
Definition: resource.h:207
#define ID_SHELL_CMD_SHOW_DESKTOP
Definition: resource.h:210
#define ID_SHELL_CMD_EXPLORE_ALL_USERS
Definition: resource.h:206
#define ID_SHELL_CMD_ADJUST_DAT
Definition: resource.h:215
#define ID_SHELL_CMD_OPEN_ALL_USERS
Definition: resource.h:205
VOID OpenTaskManager(IN HWND hWndOwner)
Definition: traywnd.cpp:627
VOID ShowDesktop()
Definition: traywnd.cpp:3142
LRESULT HandleCommand(UINT uCommand)
Definition: traywnd.cpp:788
VOID RestoreAll()
Definition: traywnd.cpp:3147
HWND STDMETHODCALLTYPE DisplayProperties()
Definition: traywnd.cpp:590
VOID OpenCommonStartMenuDirectory(IN HWND hWndOwner, IN LPCTSTR lpOperation)
Definition: traywnd.cpp:609
#define TEXT(s)
Definition: k32.h:26
VOID ShowCustomizeNotifyIcons(HINSTANCE hInst, HWND hExplorer)
#define L(x)
Definition: ntvdm.h:50
#define ABN_WINDOWARRANGE
Definition: shellapi.h:75
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2482
#define TRACE(s)
Definition: solgame.cpp:4
@ TILED
Definition: traywnd.cpp:61
@ NONE
Definition: traywnd.cpp:61
@ CASCADED
Definition: traywnd.cpp:61
void appbar_notify_all(HMONITOR hMon, UINT uMsg, HWND hwndExclude, LPARAM lParam)
Definition: appbar.cpp:78
enum @96 g_Arrangement
VOID RestoreWindowPos()
Definition: traywnd.cpp:90
VOID BackupWindowPos()
Definition: traywnd.cpp:85
#define TRAYCMD_LOCK_TASKBAR
Definition: undocshell.h:875
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:2190
#define MDITILE_HORIZONTAL
Definition: winuser.h:2191
#define MDITILE_VERTICAL
Definition: winuser.h:2192
#define SW_NORMAL
Definition: winuser.h:772

◆ ExecResourceCmd()

HRESULT CTrayWindow::ExecResourceCmd ( int  id)
inline

Definition at line 443 of file traywnd.cpp.

444 {
445 WCHAR szCommand[256];
446 WCHAR *pszParameters;
447
449 id,
450 szCommand,
451 _countof(szCommand)))
452 {
453 return E_FAIL;
454 }
455
456 pszParameters = wcschr(szCommand, L'>');
457 if (pszParameters)
458 {
459 *pszParameters = 0;
460 pszParameters++;
461 }
462
463 ShellExecuteW(m_hWnd, NULL, szCommand, pszParameters, NULL, SW_SHOWNORMAL);
464 return S_OK;
465 }
#define E_FAIL
Definition: ddrawi.h:102
#define wcschr
Definition: compat.h:17
#define _countof(array)
Definition: sndvol32.h:70
#define SW_SHOWNORMAL
Definition: winuser.h:773
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by HandleCommand(), and HandleHotKey().

◆ FitToRebar()

void CTrayWindow::FitToRebar ( PRECT  pRect)
inline

Definition at line 1832 of file traywnd.cpp.

1833 {
1834 /* Get the rect of the rebar */
1835 RECT rebarRect, taskbarRect, clientRect;
1836 ::GetWindowRect(m_Rebar, &rebarRect);
1837 ::GetWindowRect(m_hWnd, &taskbarRect);
1838 ::GetClientRect(m_hWnd, &clientRect);
1839 OffsetRect(&rebarRect, -taskbarRect.left, -taskbarRect.top);
1840
1841 /* Calculate the difference of size of the taskbar and the rebar */
1842 SIZE margins;
1843 margins.cx = taskbarRect.right - taskbarRect.left - clientRect.right + clientRect.left;
1844 margins.cy = taskbarRect.bottom - taskbarRect.top - clientRect.bottom + clientRect.top;
1845
1846 /* Calculate the new size of the rebar and make it resize, then change the new taskbar size */
1847 switch (m_Position)
1848 {
1849 case ABE_TOP:
1850 rebarRect.bottom = rebarRect.top + pRect->bottom - pRect->top - margins.cy;
1852 pRect->bottom = pRect->top + rebarRect.bottom - rebarRect.top + margins.cy;
1853 break;
1854 case ABE_BOTTOM:
1855 rebarRect.top = rebarRect.bottom - (pRect->bottom - pRect->top - margins.cy);
1857 pRect->top = pRect->bottom - (rebarRect.bottom - rebarRect.top + margins.cy);
1858 break;
1859 case ABE_LEFT:
1860 rebarRect.right = rebarRect.left + (pRect->right - pRect->left - margins.cx);
1862 pRect->right = pRect->left + (rebarRect.right - rebarRect.left + margins.cx);
1863 break;
1864 case ABE_RIGHT:
1865 rebarRect.left = rebarRect.right - (pRect->right - pRect->left - margins.cx);
1867 pRect->left = pRect->right - (rebarRect.right - rebarRect.left + margins.cx);
1868 break;
1869 }
1870
1872 }
static RECT margins
Definition: print.c:55
HMONITOR CalculateValidSize(IN DWORD Position, IN OUT RECT *pRect)
Definition: traywnd.cpp:1228
#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 2310 of file traywnd.cpp.

2315 {
2316 if (!m_ContextMenu)
2317 return E_INVALIDARG;
2318
2319 return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, pszName, cchMax);
2320 }
UINT cchMax
CComPtr< IContextMenu > m_ContextMenu
Definition: traywnd.cpp:338
#define E_INVALIDARG
Definition: ddrawi.h:101

◆ GetDraggingRectFromPt()

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

Definition at line 1285 of file traywnd.cpp.

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

Referenced by GetDraggingRectFromRect(), and OnMoving().

◆ GetDraggingRectFromRect()

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

Definition at line 1387 of file traywnd.cpp.

1390 {
1391 POINT pt;
1392
1393 /* Calculate the center of the rectangle. We call
1394 GetDraggingRectFromPt to calculate a valid
1395 dragging rectangle */
1396 pt.x = pRect->left + ((pRect->right - pRect->left) / 2);
1397 pt.y = pRect->top + ((pRect->bottom - pRect->top) / 2);
1398
1399 return GetDraggingRectFromPt(
1400 pt,
1401 pRect,
1402 phMonitor);
1403 }
DWORD GetDraggingRectFromPt(IN POINT pt, OUT RECT *pRect, OUT HMONITOR *phMonitor)
Definition: traywnd.cpp:1285

Referenced by ChangingWinPos().

◆ GetHWND()

HWND STDMETHODCALLTYPE CTrayWindow::GetHWND ( )
inline

Definition at line 2200 of file traywnd.cpp.

2201 {
2202 return m_hWnd;
2203 }

◆ GetMonitorFromRect()

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

Definition at line 1085 of file traywnd.cpp.

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

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

◆ GetScreenRect()

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

Definition at line 1110 of file traywnd.cpp.

1113 {
1114 HMONITOR hMon = NULL;
1115
1116 if (hMonitor != NULL)
1117 {
1119
1120 mi.cbSize = sizeof(mi);
1121 if (!GetMonitorInfo(hMonitor, &mi))
1122 {
1123 /* Hm, the monitor is gone? Try to find a monitor where it
1124 could be located now */
1125 hMon = GetMonitorFromRect(pRect);
1126 if (hMon == NULL ||
1127 !GetMonitorInfo(hMon, &mi))
1128 {
1129 hMon = NULL;
1130 goto GetPrimaryRect;
1131 }
1132 }
1133
1134 *pRect = mi.rcMonitor;
1135 }
1136 else
1137 {
1138GetPrimaryRect:
1139 pRect->left = 0;
1140 pRect->top = 0;
1141 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1142 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1143 }
1144
1145 return hMon;
1146 }

Referenced by ApplyClipping(), and ResizeWorkArea().

◆ GetScreenRectFromRect()

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

Definition at line 1058 of file traywnd.cpp.

1061 {
1063 HMONITOR hMon;
1064
1065 mi.cbSize = sizeof(mi);
1066 hMon = MonitorFromRect(pRect, dwFlags);
1067 if (hMon != NULL &&
1068 GetMonitorInfo(hMon, &mi))
1069 {
1070 *pRect = mi.rcMonitor;
1071 }
1072 else
1073 {
1074 pRect->left = 0;
1075 pRect->top = 0;
1076 pRect->right = GetSystemMetrics(SM_CXSCREEN);
1077 pRect->bottom = GetSystemMetrics(SM_CYSCREEN);
1078
1079 hMon = NULL;
1080 }
1081
1082 return hMon;
1083 }
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by CalculateValidSize(), and RegLoadSettings().

◆ GetState()

virtual ULONG STDMETHODCALLTYPE CTrayWindow::GetState ( )
inlinevirtual

Definition at line 3493 of file traywnd.cpp.

3494 {
3495 /* FIXME: Return ABS_ flags? */
3496 TRACE("IShellDesktopTray::GetState() unimplemented!\n");
3497 return 0;
3498 }

◆ GetTrayRectFromScreenRect()

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

Definition at line 1202 of file traywnd.cpp.

1206 {
1207 if (pTraySize == NULL)
1208 pTraySize = &m_TraySize;
1209
1210 *pRect = *pScreen;
1211
1212 if(!m_Theme)
1213 {
1214 /* Move the border outside of the screen */
1215 InflateRect(pRect,
1218 }
1219
1220 MakeTrayRectWithSize(Position, pTraySize, pRect);
1221 }
#define SM_CXEDGE
Definition: winuser.h:1011
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)

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

◆ GetTrayWindow()

virtual HRESULT STDMETHODCALLTYPE CTrayWindow::GetTrayWindow ( OUT HWND phWndTray)
inlinevirtual

Definition at line 3500 of file traywnd.cpp.

3501 {
3502 TRACE("IShellDesktopTray::GetTrayWindow(0x%p)\n", phWndTray);
3503 *phWndTray = m_hWnd;
3504 return S_OK;
3505 }

◆ GetWindow()

HRESULT WINAPI CTrayWindow::GetWindow ( HWND phwnd)
inline

Implements IOleWindow.

Definition at line 3527 of file traywnd.cpp.

3528 {
3529 if (!phwnd)
3530 return E_INVALIDARG;
3531 *phwnd = m_hWnd;
3532 return S_OK;
3533 }

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

◆ HandleCommand()

LRESULT CTrayWindow::HandleCommand ( UINT  uCommand)
inline

Definition at line 788 of file traywnd.cpp.

789 {
790 switch (uCommand)
791 {
793 // TODO:
794 break;
798 break;
800 SaveState();
801 LogoffWindowsDialog(m_hWnd); // FIXME: Maybe handle it in a similar way as DoExitWindows?
802 break;
803 case TRAYCMD_CASCADE:
805 break;
806 case TRAYCMD_TILE_H:
808 break;
809 case TRAYCMD_TILE_V:
811 break;
814 break;
816 ShellExecuteW(m_hWnd, NULL, L"timedate.cpl", NULL, NULL, SW_NORMAL);
817 break;
820 break;
822 MinimizeAll();
823 break;
825 RestoreAll();
826 break;
828 ShowDesktop();
829 break;
832 break;
834 break;
837 {
840 }
841 break;
844 break;
846 // TODO:
847 break;
850 break;
852 // TODO:
853 break;
855 // TODO:
856 break;
858 // TODO:
859 break;
860 case IDM_SEARCH:
863 break;
866 break;
867
868 default:
869 break;
870 }
871
872 return FALSE;
873 }
#define IDM_SEARCH
Definition: resource.h:71
#define IDS_HELP_COMMAND
Definition: resource.h:103
VOID ToggleDesktop()
Definition: traywnd.cpp:637
HRESULT ExecResourceCmd(int id)
Definition: traywnd.cpp:443
VOID HideStartMenu()
Definition: traywnd.cpp:737
VOID MinimizeAll(BOOL bShowDesktop=FALSE)
Definition: traywnd.cpp:3124
LRESULT DoExitWindows()
Definition: traywnd.cpp:475
void DisplayRunFileDlg()
Definition: traywnd.cpp:537
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1545
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
Definition: utils.cpp:750
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
Definition: shellord.c:2462
@ REST_CLASSICSHELL
Definition: shlobj.h:1680
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:150
#define TRAYCMD_CONTROL_PANEL
Definition: undocshell.h:877
#define TRAYCMD_STARTMENU
Definition: undocshell.h:861
#define TRAYCMD_LOCK_DESKTOP
Definition: undocshell.h:880
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:868
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:883
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:869
#define TRAYCMD_SHOW_DESKTOP
Definition: undocshell.h:872
#define TRAYCMD_TILE_V
Definition: undocshell.h:866
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:882
#define TRAYCMD_CUSTOMIZE_TASKBAR
Definition: undocshell.h:874
#define TRAYCMD_TILE_H
Definition: undocshell.h:865
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:867
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:862
#define TRAYCMD_LOGOFF_DIALOG
Definition: undocshell.h:863
#define TRAYCMD_CASCADE
Definition: undocshell.h:864
#define TRAYCMD_SHOW_TASK_MGR
Definition: undocshell.h:873
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:871
#define TRAYCMD_SHUTDOWN_DIALOG
Definition: undocshell.h:878
#define TRAYCMD_PRINTERS_AND_FAXES
Definition: undocshell.h:879
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:870
#define TRAYCMD_SWITCH_USER_DIALOG
Definition: undocshell.h:881
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:876

Referenced by ExecContextMenuCmd(), and OnCommand().

◆ HandleHotKey()

LRESULT CTrayWindow::HandleHotKey ( DWORD  id)
inline

Definition at line 742 of file traywnd.cpp.

743 {
744 switch (id)
745 {
746 case IDHK_RUN:
749 break;
750 case IDHK_HELP:
752 break;
753 case IDHK_EXPLORE:
754 //FIXME: We don't support this yet:
755 //ShellExecuteW(0, L"explore", NULL, NULL, NULL, 1);
756 ShellExecuteW(0, NULL, L"explorer.exe", L"/e ,", NULL, 1);
757 break;
758 case IDHK_FIND:
760 break;
763 break;
765 //FIXME: Use SHRunControlPanel
766 ShellExecuteW(m_hWnd, NULL, L"sysdm.cpl", NULL, NULL, SW_NORMAL);
767 break;
768 case IDHK_NEXT_TASK:
769 break;
770 case IDHK_PREV_TASK:
771 break;
773 MinimizeAll();
774 break;
775 case IDHK_RESTORE_ALL:
776 RestoreAll();
777 break;
778 case IDHK_DESKTOP:
780 break;
781 case IDHK_PAGER:
782 break;
783 }
784
785 return 0;
786 }
#define IDHK_NEXT_TASK
Definition: traywnd.cpp:53
#define IDHK_RUN
Definition: traywnd.cpp:46
#define IDHK_DESKTOP
Definition: traywnd.cpp:56
#define IDHK_EXPLORE
Definition: traywnd.cpp:50
#define IDHK_MINIMIZE_ALL
Definition: traywnd.cpp:47
#define IDHK_RESTORE_ALL
Definition: traywnd.cpp:48
#define IDHK_SYS_PROPERTIES
Definition: traywnd.cpp:55
#define IDHK_PREV_TASK
Definition: traywnd.cpp:54
#define IDHK_FIND
Definition: traywnd.cpp:51
#define IDHK_HELP
Definition: traywnd.cpp:49
#define IDHK_FIND_COMPUTER
Definition: traywnd.cpp:52
#define IDHK_PAGER
Definition: traywnd.cpp:57

Referenced by OnHotkey().

◆ HideStartMenu()

VOID CTrayWindow::HideStartMenu ( )
inline

Definition at line 737 of file traywnd.cpp.

738 {
739 m_StartMenuPopup->OnSelect(MPOS_CANCELLEVEL);
740 }
CComPtr< IMenuPopup > m_StartMenuPopup
Definition: traywnd.cpp:335

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

◆ if()

CTrayWindow::if ( m_StartMenuBand = NULL)
inline

Definition at line 3374 of file traywnd.cpp.

3375 {
3376 MSG Msg;
3377 LRESULT lRet;
3378
3379 Msg.hwnd = m_hWnd;
3380 Msg.message = uMsg;
3381 Msg.wParam = wParam;
3382 Msg.lParam = lParam;
3383
3384 if (m_StartMenuBand->TranslateMenuMessage(&Msg, &lRet) == S_OK)
3385 {
3386 return lRet;
3387 }
3388
3389 wParam = Msg.wParam;
3390 lParam = Msg.lParam;
3391 }
CComPtr< IMenuBand > m_StartMenuBand
Definition: traywnd.cpp:334
struct @1636 Msg[]
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
LONG_PTR LRESULT
Definition: windef.h:209

◆ InvokeCommand()

HRESULT STDMETHODCALLTYPE CTrayWindow::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpici)
inline

Implements IContextMenu.

Definition at line 2302 of file traywnd.cpp.

2303 {
2304 if (!m_ContextMenu)
2305 return E_INVALIDARG;
2306
2307 return m_ContextMenu->InvokeCommand(lpici);
2308 }

◆ IsDialog()

static BOOL CTrayWindow::IsDialog ( HWND  hwnd)
inlinestatic

Definition at line 3089 of file traywnd.cpp.

3090 {
3091 WCHAR szClass[32];
3092 GetClassNameW(hwnd, szClass, _countof(szClass));
3093 return wcscmp(szClass, L"#32770") == 0;
3094 }
_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().

◆ IsHorizontal()

BOOL STDMETHODCALLTYPE CTrayWindow::IsHorizontal ( )
inline

Definition at line 2211 of file traywnd.cpp.

2212 {
2213 return IsPosHorizontal();
2214 }

◆ IsPointWithinShowDesktopButton()

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

Definition at line 2805 of file traywnd.cpp.

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

◆ IsPointWithinStartButton()

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

Definition at line 2762 of file traywnd.cpp.

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

Referenced by OnNcLButtonDown().

◆ IsPosHorizontal()

BOOL CTrayWindow::IsPosHorizontal ( )
inline

Definition at line 1223 of file traywnd.cpp.

1224 {
1225 return m_Position == ABE_TOP || m_Position == ABE_BOTTOM;
1226 }

Referenced by AlignControls(), and IsHorizontal().

◆ IsSpecialHWND()

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

Definition at line 2205 of file traywnd.cpp.

2206 {
2207 return (m_hWnd == hWnd ||
2209 }
HWND hWnd
Definition: settings.c:17

Referenced by IsTaskWnd().

◆ IsTaskWnd()

BOOL STDMETHODCALLTYPE CTrayWindow::IsTaskWnd ( HWND  hWnd)
inline

Definition at line 2269 of file traywnd.cpp.

2270 {
2272 {
2274 if (((exStyle & WS_EX_APPWINDOW) || ::GetWindow(hWnd, GW_OWNER) == NULL) &&
2275 !(exStyle & WS_EX_TOOLWINDOW))
2276 {
2277 return TRUE;
2278 }
2279 }
2280 return FALSE;
2281 }
BOOL IsWindowVisible() const
Definition: atlwin.h:958
BOOL IsWindow() const
Definition: atlwin.h:947
BOOL STDMETHODCALLTYPE IsSpecialHWND(IN HWND hWnd)
Definition: traywnd.cpp:2205
#define GetWindowLongPtr
Definition: treelist.c:73
#define GW_OWNER
Definition: winuser.h:769
#define WS_EX_APPWINDOW
Definition: winuser.h:383
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
#define GWL_EXSTYLE
Definition: winuser.h:854

Referenced by RestoreMinimizedNonTaskWnds().

◆ Lock()

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

Definition at line 2216 of file traywnd.cpp.

2217 {
2218 BOOL bPrevLock = g_TaskbarSettings.bLock;
2219
2220 if (g_TaskbarSettings.bLock != bLock)
2221 {
2222 g_TaskbarSettings.bLock = bLock;
2223
2224 if (m_TrayBandSite != NULL)
2225 {
2226 if (!SUCCEEDED(m_TrayBandSite->Lock(bLock)))
2227 {
2228 /* Reset?? */
2229 g_TaskbarSettings.bLock = bPrevLock;
2230 return bPrevLock;
2231 }
2232 }
2233
2234 if (m_Theme)
2235 {
2236 /* Update cached tray sizes */
2237 for(DWORD Pos = ABE_LEFT; Pos <= ABE_BOTTOM; Pos++)
2238 {
2239 RECT rcGripper = {0};
2240 AdjustSizerRect(&rcGripper, Pos);
2241
2243 {
2244 m_TrayRects[Pos].top += rcGripper.top;
2245 m_TrayRects[Pos].left += rcGripper.left;
2246 m_TrayRects[Pos].bottom += rcGripper.bottom;
2247 m_TrayRects[Pos].right += rcGripper.right;
2248 }
2249 else
2250 {
2251 m_TrayRects[Pos].top -= rcGripper.top;
2252 m_TrayRects[Pos].left -= rcGripper.left;
2253 m_TrayRects[Pos].bottom -= rcGripper.bottom;
2254 m_TrayRects[Pos].right -= rcGripper.right;
2255 }
2256 }
2257 }
2261 }
2262
2263 return bPrevLock;
2264 }
VOID AdjustSizerRect(RECT *rc, DWORD pos)
Definition: traywnd.cpp:1148
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define SWP_FRAMECHANGED
Definition: winuser.h:1243
#define SWP_NOOWNERZORDER
Definition: winuser.h:1252

◆ MakeTrayRectWithSize()

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

Definition at line 1177 of file traywnd.cpp.

1180 {
1181 switch (Position)
1182 {
1183 case ABE_LEFT:
1184 pRect->right = pRect->left + pTraySize->cx;
1185 break;
1186
1187 case ABE_TOP:
1188 pRect->bottom = pRect->top + pTraySize->cy;
1189 break;
1190
1191 case ABE_RIGHT:
1192 pRect->left = pRect->right - pTraySize->cx;
1193 break;
1194
1195 case ABE_BOTTOM:
1196 default:
1197 pRect->top = pRect->bottom - pTraySize->cy;
1198 break;
1199 }
1200 }

Referenced by ChangingWinPos(), and GetTrayRectFromScreenRect().

◆ MinimizeAll()

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

Definition at line 3124 of file traywnd.cpp.

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

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

◆ MinimizeWindowsProc()

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

Definition at line 3096 of file traywnd.cpp.

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

Referenced by MinimizeAll().

◆ OnAppTrayDestroy()

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

Definition at line 2994 of file traywnd.cpp.

2995 {
2996 DestroyWindow();
2997 return TRUE;
2998 }
BOOL DestroyWindow()
Definition: atlwin.h:462

◆ OnCommand()

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

Definition at line 3163 of file traywnd.cpp.

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

◆ OnContextMenu()

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

Definition at line 2863 of file traywnd.cpp.

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

2502 {
2503 COPYDATASTRUCT *pCopyData = (COPYDATASTRUCT *)lParam;
2504 switch (pCopyData->dwData)
2505 {
2506 case TABDMC_APPBAR:
2507 return appbar_message(pCopyData);
2508 case TABDMC_NOTIFY:
2509 case TABDMC_LOADINPROC:
2510 return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
2511 }
2512 return FALSE;
2513 }
ULONG_PTR dwData
Definition: winuser.h:3004
LRESULT appbar_message(COPYDATASTRUCT *cds)
Definition: appbar.cpp:229
#define TABDMC_APPBAR
Definition: undocshell.h:886
#define TABDMC_LOADINPROC
Definition: undocshell.h:888
#define TABDMC_NOTIFY
Definition: undocshell.h:887

◆ OnCreate()

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

Definition at line 2326 of file traywnd.cpp.

2327 {
2328 HRESULT hRet;
2329
2330 ((ITrayWindow*)this)->AddRef();
2331
2332 SetWindowTheme(m_hWnd, L"TaskBar", NULL);
2333
2334 /* Create the Start button */
2336
2337 /* Load the saved tray window settings */
2339
2340 /* Create and initialize the start menu */
2344
2345 /* Create the task band */
2347 if (FAILED_UNEXPECTEDLY(hRet))
2348 return FALSE;
2349
2350 /* Create the rebar band site. This actually creates the rebar and the tasks toolbar. */
2352 if (FAILED_UNEXPECTEDLY(hRet))
2353 return FALSE;
2354
2355 /* Create the tray notification window */
2357 if (FAILED_UNEXPECTEDLY(hRet))
2358 return FALSE;
2359
2360 /* Get the hwnd of the rebar */
2362 if (FAILED_UNEXPECTEDLY(hRet))
2363 return FALSE;
2364
2365 /* Get the hwnd of the tasks toolbar */
2367 if (FAILED_UNEXPECTEDLY(hRet))
2368 return FALSE;
2369
2370 /* Get the hwnd of the tray notification window */
2372 if (FAILED_UNEXPECTEDLY(hRet))
2373 return FALSE;
2374
2377 return FALSE;
2378
2379 SetWindowTheme(m_Rebar, L"TaskBar", NULL);
2380
2381 UpdateFonts();
2382
2384
2386 {
2389 }
2390
2391 /* Set the initial lock state in the band site */
2393
2406
2407 return TRUE;
2408 }
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:548
HRESULT CTrayBandSite_CreateInstance(IN ITrayWindow *tray, IN IDeskBand *pTaskBand, OUT ITrayBandSite **pBandSite)
Definition: tbsite.cpp:715
#define TNWM_GETSHOWDESKTOPBUTTON
Definition: precomp.h:372
HRESULT InitShellServices(HDPA *phdpa)
HRESULT CTaskBand_CreateInstance(IN ITrayWindow *Tray, HWND hWndStartButton, REFIID riid, void **ppv)
Definition: taskband.cpp:346
#define IDB_STARTMENU
Definition: resource.h:44
HWND Create(HWND hwndParent)
Definition: traywnd.cpp:276
CComPtr< IDeskBand > m_TaskBand
Definition: traywnd.cpp:337
VOID RegLoadSettings()
Definition: traywnd.cpp:1610
CComPtr< IUnknown > m_TrayNotifyInstance
Definition: traywnd.cpp:348
void UpdateFonts()
Definition: traywnd.cpp:1027
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336
#define MOD_SHIFT
Definition: imm.h:186
#define MOD_CONTROL
Definition: imm.h:185
ULONG AddRef()
static HBITMAP
Definition: button.c:44
DWORD SmSmallIcons
Definition: precomp.h:206
#define AUTOHIDE_DELAY_HIDE
Definition: traywnd.cpp:34
#define AUTOHIDE_HIDING
Definition: traywnd.cpp:44
#define TIMER_ID_AUTOHIDE
Definition: traywnd.cpp:31
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
#define VK_TAB
Definition: winuser.h:2202
#define MOD_WIN
Definition: winuser.h:2647
#define VK_F1
Definition: winuser.h:2258
#define VK_PAUSE
Definition: winuser.h:2208
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:2207
#define IID_PPV_ARG(Itype, ppType)

◆ OnCtlColorBtn()

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

Definition at line 2539 of file traywnd.cpp.

2540 {
2543 }
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 2413 of file traywnd.cpp.

2414 {
2416 return 0;
2417 }

◆ OnDisplayChange()

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

Definition at line 2490 of file traywnd.cpp.

2491 {
2492 /* Load the saved tray window settings */
2494
2495 /* Move the tray window to the right position and resize it if necessary */
2497
2498 return TRUE;
2499 }
VOID CheckTrayWndPosition()
Definition: traywnd.cpp:1588

◆ OnDoExitWindows()

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

Definition at line 3015 of file traywnd.cpp.

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

◆ OnEndSession()

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

Definition at line 2419 of file traywnd.cpp.

2420 {
2421 if (wParam)
2422 SaveState();
2423 return 0;
2424 }

◆ OnEnterSizeMove()

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

Definition at line 2674 of file traywnd.cpp.

2675 {
2676 InSizeMove = TRUE;
2677 IsDragging = FALSE;
2679 {
2680 /* Remove the clipping on multi monitor systems while dragging around */
2682 }
2683 return TRUE;
2684 }

◆ OnEraseBackground()

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

Definition at line 2477 of file traywnd.cpp.

2478 {
2479 HDC hdc = (HDC) wParam;
2480
2481 if (!m_Theme)
2482 {
2483 bHandled = FALSE;
2484 return 0;
2485 }
2486
2488 }
LRESULT EraseBackgroundWithTheme(HDC hdc)
Definition: traywnd.cpp:2086

◆ OnExitSizeMove()

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

Definition at line 2686 of file traywnd.cpp.

2687 {
2688 InSizeMove = FALSE;
2690 {
2692
2693 /* Apply clipping */
2695 }
2696 return TRUE;
2697 }
#define WM_SIZE
Definition: winuser.h:1614
#define SIZE_RESTORED
Definition: winuser.h:2508

◆ OnGetTaskSwitch()

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

Definition at line 3036 of file traywnd.cpp.

3037 {
3038 bHandled = TRUE;
3039 return (LRESULT)m_TaskSwitch;
3040 }

◆ OnHotkey()

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

Definition at line 3075 of file traywnd.cpp.

3076 {
3077 return HandleHotKey(wParam);
3078 }
LRESULT HandleHotKey(DWORD id)
Definition: traywnd.cpp:742

◆ OnInitMenuPopup()

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

Definition at line 3246 of file traywnd.cpp.

3247 {
3248 HMENU hMenu = (HMENU)wParam;
3250 {
3254 if (g_Arrangement != NONE)
3255 {
3258 MENUITEMINFOW mii = { sizeof(mii) };
3260 mii.fMask = MIIM_TYPE;
3261 mii.fType = MFT_STRING;
3262 mii.dwTypeData = const_cast<LPWSTR>(&strCaption[0]);
3264 }
3265 else
3266 {
3268 }
3269 }
3270 else
3271 {
3277 g_WindowPosBackup.RemoveAll();
3278 }
3279 return 0;
3280 }
#define IDS_TRAYWND_UNDO_TILE
Definition: resource.h:107
#define IDS_TRAYWND_UNDO_CASCADE
Definition: resource.h:106
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
LPWSTR dwTypeData
Definition: winuser.h:3272
CSimpleArray< WINDOWPOSBACKUPDATA > g_WindowPosBackup
Definition: traywnd.cpp:68
static BOOL IsThereAnyEffectiveWindow(BOOL bMustBeInMonitor)
Definition: traywnd.cpp:167
#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:749
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MIIM_TYPE
Definition: winuser.h:728
#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 2987 of file traywnd.cpp.

2988 {
2990 m_pShowDesktopButton->OnLButtonUp(uMsg, wParam, lParam, bHandled);
2991 return FALSE;
2992 }
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 3179 of file traywnd.cpp.

3180 {
3182
3184 {
3186 }
3187
3188 return TRUE;
3189 }
#define TIMER_ID_MOUSETRACK
Definition: traywnd.cpp:32
#define MOUSETRACK_INTERVAL
Definition: traywnd.cpp:33

◆ OnMoving()

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

Definition at line 2605 of file traywnd.cpp.

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

◆ OnNcActivate()

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

Definition at line 3209 of file traywnd.cpp.

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

◆ OnNcCalcSize()

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

Definition at line 3217 of file traywnd.cpp.

3218 {
3219 RECT *rc = NULL;
3220 /* Ignore WM_NCCALCSIZE if we are not themed or locked */
3222 {
3223 bHandled = FALSE;
3224 return 0;
3225 }
3226 if(!wParam)
3227 {
3228 rc = (RECT*)wParam;
3229 }
3230 else
3231 {
3233 if(prms->lppos->flags & SWP_NOSENDCHANGING)
3234 {
3235 bHandled = FALSE;
3236 return 0;
3237 }
3238 rc = &prms->rgrc[0];
3239 }
3240
3242
3243 return 0;
3244 }
UINT flags
Definition: winuser.h:3597
PWINDOWPOS lppos
Definition: winuser.h:3602
#define SWP_NOSENDCHANGING
Definition: winuser.h:1254

◆ OnNcHitTest()

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

Definition at line 2550 of file traywnd.cpp.

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

◆ OnNcLButtonDblClick()

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

Definition at line 2965 of file traywnd.cpp.

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

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

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

◆ OnNcLButtonUp()

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

Definition at line 2975 of file traywnd.cpp.

2976 {
2977 if (m_pShowDesktopButton && m_pShowDesktopButton->m_bPressed) // Did you click the button?
2978 {
2981 bHandled = TRUE;
2982 }
2983
2984 return FALSE;
2985 }
#define WM_LBUTTONUP
Definition: winuser.h:1780

◆ OnNcPaint()

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

Definition at line 2523 of file traywnd.cpp.

2524 {
2525 DefWindowProc(uMsg, wParam, lParam);
2526 bHandled = TRUE;
2527
2529 {
2530 DrawShowDesktopButton(); // We have to draw non-client area
2531 return 0;
2532 }
2533
2534 DrawSizerWithTheme((HRGN) wParam);
2535 DrawShowDesktopButton(); // We have to draw non-client area
2536 return 0;
2537 }
int DrawSizerWithTheme(IN HRGN hRgn)
Definition: traywnd.cpp:2102

◆ OnNcRButtonUp()

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

Definition at line 2853 of file traywnd.cpp.

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

◆ OnNotify()

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

Definition at line 2931 of file traywnd.cpp.

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

◆ OnOpenStartMenu()

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

Definition at line 3000 of file traywnd.cpp.

3001 {
3002 HWND hwndStartMenu;
3003 HRESULT hr = IUnknown_GetWindow(m_StartMenuPopup, &hwndStartMenu);
3005 return FALSE;
3006
3007 if (::IsWindowVisible(hwndStartMenu))
3008 HideStartMenu();
3009 else
3011
3012 return TRUE;
3013 }

◆ OnPulse()

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

Definition at line 3063 of file traywnd.cpp.

3064 {
3065 if (IgnorePulse)
3066 return 0;
3067
3069 IgnorePulse = TRUE;
3072 return 0;
3073 }
void RestoreMinimizedNonTaskWnds(BOOL bDestroyed, HWND hwndActive)
Definition: traywnd.cpp:3042

◆ OnRebarAutoSize()

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

Definition at line 3282 of file traywnd.cpp.

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

◆ OnSettingChanged()

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

Definition at line 2446 of file traywnd.cpp.

2447 {
2448 if (wParam == SPI_SETNONCLIENTMETRICS)
2449 {
2452 UpdateFonts();
2455 }
2456
2457 if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
2458 {
2459 HideStartMenu();
2460
2462#if 1 // FIXME: Please re-use the start menu
2463 /* Re-create the start menu */
2467 FIXME("Use UpdateStartMenu\n");
2468#else
2469 // Update the start menu
2471#endif
2472 }
2473
2474 return 0;
2475 }
#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:1688
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4261
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ OnSize()

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

Definition at line 2648 of file traywnd.cpp.

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

◆ OnSizing()

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

Definition at line 2627 of file traywnd.cpp.

2628 {
2629 PRECT pRect = (PRECT) lParam;
2630
2632 {
2633 FitToRebar(pRect);
2634 }
2635 else
2636 {
2637 *pRect = m_TrayRects[m_Position];
2638 }
2639 return TRUE;
2640 }

◆ OnSysChar()

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

Definition at line 2699 of file traywnd.cpp.

2700 {
2701 switch (wParam)
2702 {
2703 case TEXT(' '):
2704 {
2705 /* The user pressed Alt+Space, this usually brings up the system menu of a window.
2706 The tray window needs to handle this specially, since it normally doesn't have
2707 a system menu. */
2708
2709 static const UINT uidDisableItem [] = {
2710 SC_RESTORE,
2711 SC_MOVE,
2712 SC_SIZE,
2715 };
2716 HMENU hSysMenu;
2717 UINT i, uId;
2718
2719 /* temporarily enable the system menu */
2721
2722 hSysMenu = GetSystemMenu(FALSE);
2723 if (hSysMenu != NULL)
2724 {
2725 /* Disable all items that are not relevant */
2726 for (i = 0; i < _countof(uidDisableItem); i++)
2727 {
2728 EnableMenuItem(hSysMenu,
2729 uidDisableItem[i],
2731 }
2732
2733 EnableMenuItem(hSysMenu,
2734 SC_CLOSE,
2735 MF_BYCOMMAND |
2737
2738 /* Display the system menu */
2739 uId = TrackMenu(
2740 hSysMenu,
2741 NULL,
2744 FALSE);
2745 if (uId != 0)
2746 {
2748 }
2749 }
2750
2751 /* revert the system menu window style */
2753 break;
2754 }
2755
2756 default:
2757 bHandled =