ReactOS 0.4.16-dev-1097-g530d26a
CTrayNotifyWnd Class Reference
Inheritance diagram for CTrayNotifyWnd:
Collaboration diagram for CTrayNotifyWnd:

Public Member Functions

 CTrayNotifyWnd ()
 
 ~CTrayNotifyWnd ()
 
LRESULT OnThemeChanged ()
 
LRESULT OnThemeChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCreate (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
BOOL GetMinimumSize (IN OUT PSIZE pSize)
 
VOID Size (IN OUT SIZE *pszClient)
 
VOID AlignControls (IN CONST PRECT prcClient OPTIONAL)
 
LRESULT OnEraseBackground (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetMinimumSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnGetShowDesktopButton (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnSize (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnNcHitTest (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnMouseMove (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnCtxMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnClockMessage (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnTaskbarSettingsChanged (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnPagerMessage (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnRealign (INT uCode, LPNMHDR hdr, BOOL &bHandled)
 
STDMETHODIMP GetWindow (HWND *phwnd) override
 
STDMETHODIMP ContextSensitiveHelp (BOOL fEnterMode) override
 
HRESULT Initialize (IN HWND hwndParent)
 
- 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< CTrayNotifyWnd, 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 ()
 

Private Attributes

CComPtr< IUnknownm_clock
 
CTrayShowDesktopButton m_ShowDesktopButton
 
CComPtr< IUnknownm_pager
 
HWND m_hwndClock
 
HWND m_hwndShowDesktop
 
HWND m_hwndPager
 
HTHEME TrayTheme
 
SIZE trayClockMinSize
 
SIZE trayShowDesktopSize
 
SIZE trayNotifySize
 
MARGINS ContentMargin
 
BOOL IsHorizontal
 

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
 
- Static Public Member Functions inherited from ATL::CComCoClass< CTrayNotifyWnd >
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< CTrayNotifyWnd, 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 inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Public Attributes inherited from ATL::CWindowImplBaseT< TBase, TWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< TBase >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 35 of file trayntfy.cpp.

Constructor & Destructor Documentation

◆ CTrayNotifyWnd()

CTrayNotifyWnd::CTrayNotifyWnd ( )
inline

Definition at line 57 of file trayntfy.cpp.

57 :
62 {
67 }
SIZE trayShowDesktopSize
Definition: trayntfy.cpp:51
SIZE trayNotifySize
Definition: trayntfy.cpp:52
SIZE trayClockMinSize
Definition: trayntfy.cpp:50
BOOL IsHorizontal
Definition: trayntfy.cpp:54
HTHEME TrayTheme
Definition: trayntfy.cpp:49
HWND m_hwndClock
Definition: trayntfy.cpp:45
HWND m_hwndPager
Definition: trayntfy.cpp:47
MARGINS ContentMargin
Definition: trayntfy.cpp:53
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define ZeroMemory
Definition: winbase.h:1743

◆ ~CTrayNotifyWnd()

CTrayNotifyWnd::~CTrayNotifyWnd ( )
inline

Definition at line 68 of file trayntfy.cpp.

68{ }

Member Function Documentation

◆ AlignControls()

VOID CTrayNotifyWnd::AlignControls ( IN CONST PRECT prcClient  OPTIONAL)
inline

Definition at line 235 of file trayntfy.cpp.

236 {
237 RECT rcClient;
238 if (prcClient != NULL)
239 rcClient = *prcClient;
240 else
241 GetClientRect(&rcClient);
242
243 rcClient.left += ContentMargin.cxLeftWidth;
244 rcClient.top += ContentMargin.cyTopHeight;
245 rcClient.right -= ContentMargin.cxRightWidth;
247
249
251 {
252 POINT ptShowDesktop =
253 {
254 rcClient.left,
255 rcClient.top
256 };
257 SIZE showDesktopSize =
258 {
259 rcClient.right - rcClient.left,
260 rcClient.bottom - rcClient.top
261 };
262
263 INT cxyShowDesktop = m_ShowDesktopButton.WidthOrHeight();
264 if (IsHorizontal)
265 {
266 if (!TrayTheme)
267 {
268 ptShowDesktop.y -= ContentMargin.cyTopHeight;
270 }
271
272 rcClient.right -= (cxyShowDesktop - ContentMargin.cxRightWidth);
273
274 ptShowDesktop.x = rcClient.right;
275 showDesktopSize.cx = cxyShowDesktop;
276
277 // HACK: Clock has layout problems - remove this once addressed.
278 rcClient.right -= CLOCK_TEXT_HACK;
279 }
280 else
281 {
282 if (!TrayTheme)
283 {
284 ptShowDesktop.x -= ContentMargin.cxLeftWidth;
286 }
287
288 rcClient.bottom -= (cxyShowDesktop - ContentMargin.cyBottomHeight);
289
290 ptShowDesktop.y = rcClient.bottom;
291 showDesktopSize.cy = cxyShowDesktop;
292
293 // HACK: Clock has layout problems - remove this once addressed.
294 rcClient.bottom -= CLOCK_TEXT_HACK;
295 }
296
297 /* Resize and reposition the button */
299 NULL,
300 ptShowDesktop.x,
301 ptShowDesktop.y,
302 showDesktopSize.cx,
303 showDesktopSize.cy,
304 swpFlags);
305 }
306
307 if (!GetHideClock())
308 {
309 POINT ptClock = { rcClient.left, rcClient.top };
310 SIZE clockSize = { rcClient.right - rcClient.left, rcClient.bottom - rcClient.top };
311
312 if (IsHorizontal)
313 {
314 rcClient.right -= trayClockMinSize.cx;
315
316 ptClock.x = rcClient.right;
317 clockSize.cx = trayClockMinSize.cx;
318 }
319 else
320 {
321 rcClient.bottom -= trayClockMinSize.cy;
322
323 ptClock.y = rcClient.bottom;
324 clockSize.cy = trayClockMinSize.cy;
325 }
326
328 NULL,
329 ptClock.x,
330 ptClock.y,
331 clockSize.cx,
332 clockSize.cy,
333 swpFlags);
334 }
335
336 POINT ptPager;
337 if (IsHorizontal)
338 {
339 ptPager.x = ContentMargin.cxLeftWidth;
340 ptPager.y = ((rcClient.bottom - rcClient.top) - trayNotifySize.cy) / 2;
342 ptPager.y += ContentMargin.cyTopHeight;
343 }
344 else
345 {
346 ptPager.x = ((rcClient.right - rcClient.left) - trayNotifySize.cx) / 2;
348 ptPager.x += ContentMargin.cxLeftWidth;
349 ptPager.y = ContentMargin.cyTopHeight;
350 }
351
353 NULL,
354 ptPager.x,
355 ptPager.y,
358 swpFlags);
359
360 if (prcClient != NULL)
361 {
362 prcClient->left = rcClient.left - ContentMargin.cxLeftWidth;
363 prcClient->top = rcClient.top - ContentMargin.cyTopHeight;
364 prcClient->right = rcClient.right + ContentMargin.cxRightWidth;
365 prcClient->bottom = rcClient.bottom + ContentMargin.cyBottomHeight;
366 }
367 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
static BOOL GetHideClock()
Definition: precomp.h:372
HWND m_hwndShowDesktop
Definition: trayntfy.cpp:46
CTrayShowDesktopButton m_ShowDesktopButton
Definition: trayntfy.cpp:42
INT WidthOrHeight() const
Definition: traydeskbtn.cpp:33
unsigned int UINT
Definition: ndis.h:50
#define CONST
Definition: pedump.c:81
BOOL bShowDesktopButton
Definition: precomp.h:225
BOOL UseCompactTrayIcons()
Definition: precomp.h:230
int cyBottomHeight
Definition: misc.c:283
int cyTopHeight
Definition: misc.c:282
int cxRightWidth
Definition: misc.c:281
int cxLeftWidth
Definition: misc.c:280
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define CLOCK_TEXT_HACK
Definition: trayntfy.cpp:29
int32_t INT
Definition: typedefs.h:58
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_DRAWFRAME
Definition: winuser.h:1250
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOCOPYBITS
Definition: winuser.h:1254
#define SWP_NOZORDER
Definition: winuser.h:1258

Referenced by Size().

◆ ContextSensitiveHelp()

STDMETHODIMP CTrayNotifyWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inlineoverride

Implements IOleWindow.

Definition at line 514 of file trayntfy.cpp.

515 {
516 return E_NOTIMPL;
517 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ GetMinimumSize()

BOOL CTrayNotifyWnd::GetMinimumSize ( IN OUT PSIZE  pSize)
inline

Definition at line 137 of file trayntfy.cpp.

138 {
139 SIZE clockSize = { 0, 0 };
140 SIZE traySize = { 0, 0 };
141 SIZE showDesktopSize = { 0, 0 };
142 BOOL bHideClock = GetHideClock();
143
144 if (!bHideClock)
145 {
146 if (IsHorizontal)
147 {
148 clockSize.cy = pSize->cy;
149 if (clockSize.cy <= 0)
150 goto NoClock;
151 }
152 else
153 {
154 clockSize.cx = pSize->cx;
155 if (clockSize.cx <= 0)
156 goto NoClock;
157 }
158
160
161 trayClockMinSize = clockSize;
162 }
163 else
164 NoClock:
165 trayClockMinSize = clockSize;
166
167 if (IsHorizontal)
168 {
169 traySize.cy = pSize->cy - 2 * TRAY_NOTIFY_WND_SPACING_Y;
170 }
171 else
172 {
173 traySize.cx = pSize->cx - 2 * TRAY_NOTIFY_WND_SPACING_X;
174 }
175
177
178 trayNotifySize = traySize;
179
180 INT showDesktopButtonExtent = 0;
182 {
183 showDesktopButtonExtent = m_ShowDesktopButton.WidthOrHeight();
184 if (IsHorizontal)
185 {
186 showDesktopSize.cx = showDesktopButtonExtent;
187 showDesktopSize.cy = pSize->cy;
188 }
189 else
190 {
191 showDesktopSize.cx = pSize->cx;
192 showDesktopSize.cy = showDesktopButtonExtent;
193 }
194 }
195 trayShowDesktopSize = showDesktopSize;
196
197 if (IsHorizontal)
198 {
199 pSize->cx = 2 * TRAY_NOTIFY_WND_SPACING_X;
200
201 if (!bHideClock)
203
205 pSize->cx += showDesktopButtonExtent;
206
207 pSize->cx += traySize.cx;
209 }
210 else
211 {
212 pSize->cy = 2 * TRAY_NOTIFY_WND_SPACING_Y;
213
214 if (!bHideClock)
216
218 pSize->cy += showDesktopButtonExtent;
219
220 pSize->cy += traySize.cy;
222 }
223
224 return TRUE;
225 }
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:378
#define TRUE
Definition: types.h:120
unsigned int BOOL
Definition: ntddk_ex.h:94
#define TRAY_NOTIFY_WND_SPACING_Y
Definition: trayntfy.cpp:28
#define TRAY_NOTIFY_WND_SPACING_X
Definition: trayntfy.cpp:27
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define SendMessage
Definition: winuser.h:5863

Referenced by OnGetMinimumSize().

◆ GetWindow()

STDMETHODIMP CTrayNotifyWnd::GetWindow ( HWND phwnd)
inlineoverride

Implements IOleWindow.

Definition at line 505 of file trayntfy.cpp.

506 {
507 if (!phwnd)
508 return E_INVALIDARG;
509 *phwnd = m_hWnd;
510 return S_OK;
511 }
HWND m_hWnd
Definition: atlwin.h:273
#define E_INVALIDARG
Definition: ddrawi.h:101
#define S_OK
Definition: intsafe.h:52

◆ Initialize()

HRESULT CTrayNotifyWnd::Initialize ( IN HWND  hwndParent)
inline

Definition at line 519 of file trayntfy.cpp.

520 {
522 Create(hwndParent, 0, NULL, dwStyle, WS_EX_STATICEDGE);
523 return m_hWnd ? S_OK : E_FAIL;
524 }
@ Create
Definition: registry.c:563
static HWND hwndParent
Definition: cryptui.c:300
#define E_FAIL
Definition: ddrawi.h:102
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WS_EX_STATICEDGE
Definition: winuser.h:403

◆ OnClockMessage()

LRESULT CTrayNotifyWnd::OnClockMessage ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 466 of file trayntfy.cpp.

467 {
468 return SendMessageW(m_hwndClock, uMsg, wParam, lParam);
469 }
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by OnTaskbarSettingsChanged().

◆ OnCreate()

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

Definition at line 110 of file trayntfy.cpp.

111 {
112 HRESULT hr;
113
116 return FALSE;
117
120 return FALSE;
121
124 return FALSE;
125
128 return FALSE;
129
130 /* Create the 'Show Desktop' button */
133
134 return TRUE;
135 }
HRESULT CTrayClockWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: trayclock.cpp:783
HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: syspager.cpp:1614
CComPtr< IUnknown > m_pager
Definition: trayntfy.cpp:43
CComPtr< IUnknown > m_clock
Definition: trayntfy.cpp:41
HRESULT DoCreate(HWND hwndParent)
Definition: traydeskbtn.cpp:62
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:65
HRESULT WINAPI IUnknown_GetWindow(IUnknown *lpUnknown, HWND *lphWnd)
Definition: ordinal.c:1336
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)

◆ OnCtxMenu()

LRESULT CTrayNotifyWnd::OnCtxMenu ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 456 of file trayntfy.cpp.

457 {
458 bHandled = TRUE;
459
460 if (reinterpret_cast<HWND>(wParam) == m_hwndClock)
461 return GetParent().SendMessage(uMsg, wParam, lParam);
462 else
463 return 0;
464 }
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
CWindow GetParent() const
Definition: atlwin.h:700

◆ OnEraseBackground()

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

Definition at line 369 of file trayntfy.cpp.

370 {
371 HDC hdc = (HDC) wParam;
372
373 if (!TrayTheme)
374 {
375 bHandled = FALSE;
376 return 0;
377 }
378
379 RECT rect;
383
385
386 return TRUE;
387 }
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
Definition: draw.c:1927
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
& rect
Definition: startmenu.cpp:1413
@ TNP_BACKGROUND
Definition: vssym32.h:543

◆ OnGetMinimumSize()

LRESULT CTrayNotifyWnd::OnGetMinimumSize ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 389 of file trayntfy.cpp.

390 {
391 BOOL Horizontal = (BOOL) wParam;
392
393 if (Horizontal != IsHorizontal)
394 IsHorizontal = Horizontal;
395
397 IsHorizontal ? L"TrayNotifyHoriz" : L"TrayNotifyVert",
398 NULL);
400
402 }
BOOL GetMinimumSize(IN OUT PSIZE pSize)
Definition: trayntfy.cpp:137
#define BOOL
Definition: nt_native.h:43
#define L(x)
Definition: ntvdm.h:50
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
LONG_PTR LRESULT
Definition: windef.h:209

◆ OnGetShowDesktopButton()

LRESULT CTrayNotifyWnd::OnGetShowDesktopButton ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 404 of file trayntfy.cpp.

405 {
406 if (wParam == NULL)
407 return 0;
408
411 {
412 *ptr = NULL;
413 return 0;
414 }
415
417 bHandled = TRUE;
418 return 0;
419 }
static PVOID ptr
Definition: dispmode.c:27

◆ OnMouseMove()

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

Definition at line 445 of file trayntfy.cpp.

446 {
447 POINT pt;
449
452
453 return TRUE;
454 }
BOOL PtInButton(LPPOINT pt) const
#define pt(x, y)
Definition: drawing.c:79
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3032

◆ OnNcHitTest()

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

Definition at line 433 of file trayntfy.cpp.

434 {
435 POINT pt;
438
440 return HTCLIENT;
441
442 return HTTRANSPARENT;
443 }
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define HTCLIENT
Definition: winuser.h:2486
#define HTTRANSPARENT
Definition: winuser.h:2484

◆ OnPagerMessage()

LRESULT CTrayNotifyWnd::OnPagerMessage ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 491 of file trayntfy.cpp.

492 {
493 return SendMessageW(m_hwndPager, uMsg, wParam, lParam);
494 }

◆ OnRealign()

LRESULT CTrayNotifyWnd::OnRealign ( INT  uCode,
LPNMHDR  hdr,
BOOL bHandled 
)
inline

Definition at line 496 of file trayntfy.cpp.

497 {
498 hdr->hwndFrom = m_hWnd;
500 }
char hdr[14]
Definition: iptest.cpp:33
#define WM_NOTIFY
Definition: richedit.h:61

◆ OnSize()

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

Definition at line 421 of file trayntfy.cpp.

422 {
423 SIZE clientSize;
424
425 clientSize.cx = LOWORD(lParam);
426 clientSize.cy = HIWORD(lParam);
427
428 Size(&clientSize);
429
430 return TRUE;
431 }
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

◆ OnTaskbarSettingsChanged()

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

Definition at line 471 of file trayntfy.cpp.

472 {
473 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
474
475 /* Toggle show desktop button */
477 {
480
481 /* Ask the parent to resize */
482 NMHDR nmh = {m_hWnd, 0, NTNWM_REALIGN};
483 SendMessage(WM_NOTIFY, 0, (LPARAM) &nmh);
484 }
485
487
488 return OnClockMessage(uMsg, wParam, lParam, bHandled);
489 }
#define NTNWM_REALIGN
Definition: precomp.h:382
LRESULT OnClockMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayntfy.cpp:466
BOOL bHideInactiveIcons
Definition: precomp.h:222
#define SW_HIDE
Definition: winuser.h:779
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_SHOW
Definition: winuser.h:786

◆ OnThemeChanged() [1/2]

LRESULT CTrayNotifyWnd::OnThemeChanged ( )
inline

Definition at line 70 of file trayntfy.cpp.

71 {
72 if (TrayTheme)
74
75 if (IsThemeActive())
76 TrayTheme = OpenThemeData(m_hWnd, L"TrayNotify");
77 else
79
80 if (TrayTheme)
81 {
83
85 NULL,
87 0,
89 NULL,
91 }
92 else
93 {
95
100 }
101
102 return TRUE;
103 }
HRESULT WINAPI GetThemeMargins(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, RECT *prc, MARGINS *pMargins)
Definition: property.c:216
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:850
BOOL WINAPI IsThemeActive(void)
Definition: system.c:621
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:965
#define SetWindowExStyle(h, val)
Definition: utility.h:154
#define TMT_CONTENTMARGINS
Definition: vssym32.h:324

Referenced by OnThemeChanged().

◆ OnThemeChanged() [2/2]

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

Definition at line 105 of file trayntfy.cpp.

106 {
107 return OnThemeChanged();
108 }
LRESULT OnThemeChanged()
Definition: trayntfy.cpp:70

◆ Size()

VOID CTrayNotifyWnd::Size ( IN OUT SIZE pszClient)
inline

Definition at line 227 of file trayntfy.cpp.

228 {
229 RECT rcClient = {0, 0, pszClient->cx, pszClient->cy};
230 AlignControls(&rcClient);
231 pszClient->cx = rcClient.right - rcClient.left;
232 pszClient->cy = rcClient.bottom - rcClient.top;
233 }
VOID AlignControls(IN CONST PRECT prcClient OPTIONAL)
Definition: trayntfy.cpp:235

Member Data Documentation

◆ ContentMargin

MARGINS CTrayNotifyWnd::ContentMargin
private

Definition at line 53 of file trayntfy.cpp.

Referenced by AlignControls(), CTrayNotifyWnd(), GetMinimumSize(), and OnThemeChanged().

◆ IsHorizontal

BOOL CTrayNotifyWnd::IsHorizontal
private

Definition at line 54 of file trayntfy.cpp.

Referenced by AlignControls(), GetMinimumSize(), and OnGetMinimumSize().

◆ m_clock

CComPtr<IUnknown> CTrayNotifyWnd::m_clock
private

Definition at line 41 of file trayntfy.cpp.

Referenced by OnCreate().

◆ m_hwndClock

HWND CTrayNotifyWnd::m_hwndClock
private

Definition at line 45 of file trayntfy.cpp.

Referenced by AlignControls(), GetMinimumSize(), OnClockMessage(), OnCreate(), and OnCtxMenu().

◆ m_hwndPager

HWND CTrayNotifyWnd::m_hwndPager
private

Definition at line 47 of file trayntfy.cpp.

Referenced by AlignControls(), GetMinimumSize(), OnCreate(), and OnPagerMessage().

◆ m_hwndShowDesktop

HWND CTrayNotifyWnd::m_hwndShowDesktop
private

Definition at line 46 of file trayntfy.cpp.

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

◆ m_pager

CComPtr<IUnknown> CTrayNotifyWnd::m_pager
private

Definition at line 43 of file trayntfy.cpp.

Referenced by OnCreate().

◆ m_ShowDesktopButton

CTrayShowDesktopButton CTrayNotifyWnd::m_ShowDesktopButton
private

◆ trayClockMinSize

SIZE CTrayNotifyWnd::trayClockMinSize
private

Definition at line 50 of file trayntfy.cpp.

Referenced by AlignControls(), CTrayNotifyWnd(), and GetMinimumSize().

◆ trayNotifySize

SIZE CTrayNotifyWnd::trayNotifySize
private

Definition at line 52 of file trayntfy.cpp.

Referenced by AlignControls(), CTrayNotifyWnd(), and GetMinimumSize().

◆ trayShowDesktopSize

SIZE CTrayNotifyWnd::trayShowDesktopSize
private

Definition at line 51 of file trayntfy.cpp.

Referenced by CTrayNotifyWnd(), and GetMinimumSize().

◆ TrayTheme

HTHEME CTrayNotifyWnd::TrayTheme
private

Definition at line 49 of file trayntfy.cpp.

Referenced by AlignControls(), OnEraseBackground(), and OnThemeChanged().


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