ReactOS 0.4.16-dev-329-g9223134
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)
 
HRESULT WINAPI GetWindow (HWND *phwnd)
 
HRESULT WINAPI ContextSensitiveHelp (BOOL fEnterMode)
 
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:1737

◆ ~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 234 of file trayntfy.cpp.

235 {
236 RECT rcClient;
237 if (prcClient != NULL)
238 rcClient = *prcClient;
239 else
240 GetClientRect(&rcClient);
241
242 rcClient.left += ContentMargin.cxLeftWidth;
243 rcClient.top += ContentMargin.cyTopHeight;
244 rcClient.right -= ContentMargin.cxRightWidth;
246
248
250 {
251 POINT ptShowDesktop =
252 {
253 rcClient.left,
254 rcClient.top
255 };
256 SIZE showDesktopSize =
257 {
258 rcClient.right - rcClient.left,
259 rcClient.bottom - rcClient.top
260 };
261
262 INT cxyShowDesktop = m_ShowDesktopButton.WidthOrHeight();
263 if (IsHorizontal)
264 {
265 if (!TrayTheme)
266 {
267 ptShowDesktop.y -= ContentMargin.cyTopHeight;
269 }
270
271 rcClient.right -= (cxyShowDesktop - ContentMargin.cxRightWidth);
272
273 ptShowDesktop.x = rcClient.right;
274 showDesktopSize.cx = cxyShowDesktop;
275
276 // HACK: Clock has layout problems - remove this once addressed.
277 rcClient.right -= CLOCK_TEXT_HACK;
278 }
279 else
280 {
281 if (!TrayTheme)
282 {
283 ptShowDesktop.x -= ContentMargin.cxLeftWidth;
285 }
286
287 rcClient.bottom -= (cxyShowDesktop - ContentMargin.cyBottomHeight);
288
289 ptShowDesktop.y = rcClient.bottom;
290 showDesktopSize.cy = cxyShowDesktop;
291
292 // HACK: Clock has layout problems - remove this once addressed.
293 rcClient.bottom -= CLOCK_TEXT_HACK;
294 }
295
296 /* Resize and reposition the button */
298 NULL,
299 ptShowDesktop.x,
300 ptShowDesktop.y,
301 showDesktopSize.cx,
302 showDesktopSize.cy,
303 swpFlags);
304 }
305
307 {
308 POINT ptClock = { rcClient.left, rcClient.top };
309 SIZE clockSize = { rcClient.right - rcClient.left, rcClient.bottom - rcClient.top };
310
311 if (IsHorizontal)
312 {
313 rcClient.right -= trayClockMinSize.cx;
314
315 ptClock.x = rcClient.right;
316 clockSize.cx = trayClockMinSize.cx;
317 }
318 else
319 {
320 rcClient.bottom -= trayClockMinSize.cy;
321
322 ptClock.y = rcClient.bottom;
323 clockSize.cy = trayClockMinSize.cy;
324 }
325
327 NULL,
328 ptClock.x,
329 ptClock.y,
330 clockSize.cx,
331 clockSize.cy,
332 swpFlags);
333 }
334
335 POINT ptPager;
336 if (IsHorizontal)
337 {
338 ptPager.x = ContentMargin.cxLeftWidth;
339 ptPager.y = ((rcClient.bottom - rcClient.top) - trayNotifySize.cy) / 2;
341 ptPager.y += ContentMargin.cyTopHeight;
342 }
343 else
344 {
345 ptPager.x = ((rcClient.right - rcClient.left) - trayNotifySize.cx) / 2;
347 ptPager.x += ContentMargin.cxLeftWidth;
348 ptPager.y = ContentMargin.cyTopHeight;
349 }
350
352 NULL,
353 ptPager.x,
354 ptPager.y,
357 swpFlags);
358
359 if (prcClient != NULL)
360 {
361 prcClient->left = rcClient.left - ContentMargin.cxLeftWidth;
362 prcClient->top = rcClient.top - ContentMargin.cyTopHeight;
363 prcClient->right = rcClient.right + ContentMargin.cxRightWidth;
364 prcClient->bottom = rcClient.bottom + ContentMargin.cyBottomHeight;
365 }
366 }
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
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:224
TW_STRUCKRECTS2 sr
Definition: precomp.h:225
BOOL UseCompactTrayIcons()
Definition: precomp.h:229
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
DWORD HideClock
Definition: precomp.h:207
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:1242
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SWP_NOCOPYBITS
Definition: winuser.h:1246
#define SWP_NOZORDER
Definition: winuser.h:1250

Referenced by Size().

◆ ContextSensitiveHelp()

HRESULT WINAPI CTrayNotifyWnd::ContextSensitiveHelp ( BOOL  fEnterMode)
inline

Implements IOleWindow.

Definition at line 507 of file trayntfy.cpp.

508 {
509 return E_NOTIMPL;
510 }
#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
144 {
145 if (IsHorizontal)
146 {
147 clockSize.cy = pSize->cy;
148 if (clockSize.cy <= 0)
149 goto NoClock;
150 }
151 else
152 {
153 clockSize.cx = pSize->cx;
154 if (clockSize.cx <= 0)
155 goto NoClock;
156 }
157
159
160 trayClockMinSize = clockSize;
161 }
162 else
163 NoClock:
164 trayClockMinSize = clockSize;
165
166 if (IsHorizontal)
167 {
168 traySize.cy = pSize->cy - 2 * TRAY_NOTIFY_WND_SPACING_Y;
169 }
170 else
171 {
172 traySize.cx = pSize->cx - 2 * TRAY_NOTIFY_WND_SPACING_X;
173 }
174
176
177 trayNotifySize = traySize;
178
179 INT showDesktopButtonExtent = 0;
181 {
182 showDesktopButtonExtent = m_ShowDesktopButton.WidthOrHeight();
183 if (IsHorizontal)
184 {
185 showDesktopSize.cx = showDesktopButtonExtent;
186 showDesktopSize.cy = pSize->cy;
187 }
188 else
189 {
190 showDesktopSize.cx = pSize->cx;
191 showDesktopSize.cy = showDesktopButtonExtent;
192 }
193 }
194 trayShowDesktopSize = showDesktopSize;
195
196 if (IsHorizontal)
197 {
198 pSize->cx = 2 * TRAY_NOTIFY_WND_SPACING_X;
199
202
204 pSize->cx += showDesktopButtonExtent;
205
206 pSize->cx += traySize.cx;
208 }
209 else
210 {
211 pSize->cy = 2 * TRAY_NOTIFY_WND_SPACING_Y;
212
215
217 pSize->cy += showDesktopButtonExtent;
218
219 pSize->cy += traySize.cy;
221 }
222
223 return TRUE;
224 }
#define TNWM_GETMINIMUMSIZE
Definition: precomp.h:370
#define TRUE
Definition: types.h:120
#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:5855

Referenced by OnGetMinimumSize().

◆ GetWindow()

HRESULT WINAPI CTrayNotifyWnd::GetWindow ( HWND phwnd)
inline

Implements IOleWindow.

Definition at line 499 of file trayntfy.cpp.

500 {
501 if (!phwnd)
502 return E_INVALIDARG;
503 *phwnd = m_hWnd;
504 return S_OK;
505 }
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 512 of file trayntfy.cpp.

513 {
515 Create(hwndParent, 0, NULL, dwStyle, WS_EX_STATICEDGE);
516 return m_hWnd ? S_OK : E_FAIL;
517 }
@ 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 465 of file trayntfy.cpp.

466 {
467 return SendMessageW(m_hwndClock, uMsg, wParam, lParam);
468 }
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:779
HRESULT CSysPagerWnd_CreateInstance(HWND hwndParent, REFIID riid, void **ppv)
Definition: syspager.cpp:1611
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:121
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 455 of file trayntfy.cpp.

456 {
457 bHandled = TRUE;
458
459 if (reinterpret_cast<HWND>(wParam) == m_hwndClock)
460 return GetParent().SendMessage(uMsg, wParam, lParam);
461 else
462 return 0;
463 }
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 368 of file trayntfy.cpp.

369 {
370 HDC hdc = (HDC) wParam;
371
372 if (!TrayTheme)
373 {
374 bHandled = FALSE;
375 return 0;
376 }
377
378 RECT rect;
382
384
385 return TRUE;
386 }
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 388 of file trayntfy.cpp.

389 {
390 BOOL Horizontal = (BOOL) wParam;
391
392 if (Horizontal != IsHorizontal)
393 IsHorizontal = Horizontal;
394
396 IsHorizontal ? L"TrayNotifyHoriz" : L"TrayNotifyVert",
397 NULL);
399
401 }
BOOL GetMinimumSize(IN OUT PSIZE pSize)
Definition: trayntfy.cpp:137
unsigned int BOOL
Definition: ntddk_ex.h:94
#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 403 of file trayntfy.cpp.

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

◆ OnMouseMove()

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

Definition at line 444 of file trayntfy.cpp.

445 {
446 POINT pt;
448
451
452 return TRUE;
453 }
BOOL PtInButton(LPPOINT pt) const
#define pt(x, y)
Definition: drawing.c:79
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2722

◆ OnNcHitTest()

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

Definition at line 432 of file trayntfy.cpp.

433 {
434 POINT pt;
437
439 return HTCLIENT;
440
441 return HTTRANSPARENT;
442 }
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define HTCLIENT
Definition: winuser.h:2478
#define HTTRANSPARENT
Definition: winuser.h:2476

◆ OnPagerMessage()

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

Definition at line 488 of file trayntfy.cpp.

489 {
490 return SendMessageW(m_hwndPager, uMsg, wParam, lParam);
491 }

◆ OnRealign()

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

Definition at line 493 of file trayntfy.cpp.

494 {
495 hdr->hwndFrom = m_hWnd;
497 }
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 420 of file trayntfy.cpp.

421 {
422 SIZE clientSize;
423
424 clientSize.cx = LOWORD(lParam);
425 clientSize.cy = HIWORD(lParam);
426
427 Size(&clientSize);
428
429 return TRUE;
430 }
#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 470 of file trayntfy.cpp.

471 {
472 TaskbarSettings* newSettings = (TaskbarSettings*)lParam;
473
474 /* Toggle show desktop button */
476 {
479
480 /* Ask the parent to resize */
481 NMHDR nmh = {m_hWnd, 0, NTNWM_REALIGN};
482 SendMessage(WM_NOTIFY, 0, (LPARAM) &nmh);
483 }
484
485 return OnClockMessage(uMsg, wParam, lParam, bHandled);
486 }
#define NTNWM_REALIGN
Definition: precomp.h:374
LRESULT OnClockMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
Definition: trayntfy.cpp:465
#define SW_HIDE
Definition: winuser.h:771
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_SHOW
Definition: winuser.h:778

◆ 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:835
BOOL WINAPI IsThemeActive(void)
Definition: system.c:606
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
#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 226 of file trayntfy.cpp.

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

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: