ReactOS 0.4.16-dev-1025-gd3456f5
CNotifyToolbar Class Reference
Inheritance diagram for CNotifyToolbar:
Collaboration diagram for CNotifyToolbar:

Public Member Functions

 CNotifyToolbar ()
 
virtual ~CNotifyToolbar ()
 
int GetVisibleButtonCount ()
 
int FindItem (IN HWND hWnd, IN UINT uID, InternalIconData **pdata)
 
int FindExistingSharedIcon (HICON handle)
 
BOOL AddButton (IN CONST NOTIFYICONDATA *iconData)
 
BOOL SwitchVersion (IN CONST NOTIFYICONDATA *iconData)
 
BOOL UpdateButton (IN CONST NOTIFYICONDATA *iconData)
 
BOOL RemoveButton (IN CONST NOTIFYICONDATA *iconData)
 
VOID ResizeImagelist ()
 
bool SendNotifyCallback (InternalIconData *notifyItem, UINT uMsg)
 
void RefreshToolbarMetrics (BOOL bForceRefresh)
 
void Initialize (HWND hWndParent, CBalloonQueue *queue)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< CToolbar< InternalIconData >, CControlWinTraits >
 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
 

Private Member Functions

LRESULT OnCtxMenu (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
VOID SendMouseEvent (IN WORD wIndex, IN UINT uMsg, IN WPARAM wParam)
 
LRESULT OnMouseEvent (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
LRESULT OnTooltipShow (INT uCode, LPNMHDR hdr, BOOL &bHandled)
 

Private Attributes

HIMAGELIST m_ImageList
 
int m_VisibleButtonCount
 
CBalloonQueuem_BalloonQueue
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< TBase >
enum  { WINSTATE_DESTROYED = 0x00000001 }
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< CToolbar< InternalIconData >, CControlWinTraits >
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::CWindowImplBaseT< CToolbar< InternalIconData >, CControlWinTraits >
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 147 of file syspager.cpp.

Constructor & Destructor Documentation

◆ CNotifyToolbar()

CNotifyToolbar::CNotifyToolbar ( )

Definition at line 667 of file syspager.cpp.

667 :
671{
672}
HIMAGELIST m_ImageList
Definition: syspager.cpp:150
CBalloonQueue * m_BalloonQueue
Definition: syspager.cpp:153
int m_VisibleButtonCount
Definition: syspager.cpp:151
#define NULL
Definition: types.h:112

◆ ~CNotifyToolbar()

CNotifyToolbar::~CNotifyToolbar ( )
virtual

Definition at line 674 of file syspager.cpp.

675{
676}

Member Function Documentation

◆ AddButton()

BOOL CNotifyToolbar::AddButton ( IN CONST NOTIFYICONDATA iconData)

Definition at line 720 of file syspager.cpp.

721{
722 TBBUTTON tbBtn = { 0 };
723 InternalIconData * notifyItem;
724 WCHAR text[] = L"";
725
726 TRACE("Adding icon %d from hWnd %08x flags%s%s state%s%s\n",
727 iconData->uID, iconData->hWnd,
728 (iconData->uFlags & NIF_ICON) ? " ICON" : "",
729 (iconData->uFlags & NIF_STATE) ? " STATE" : "",
730 (iconData->dwState & NIS_HIDDEN) ? " HIDDEN" : "",
731 (iconData->dwState & NIS_SHAREDICON) ? " SHARED" : "");
732
733 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
734 if (index >= 0)
735 {
736 TRACE("Icon %d from hWnd %08x ALREADY EXISTS!\n", iconData->uID, iconData->hWnd);
737 return FALSE;
738 }
739
740 notifyItem = new InternalIconData();
741 ZeroMemory(notifyItem, sizeof(*notifyItem));
742
743 notifyItem->hWnd = iconData->hWnd;
744 notifyItem->uID = iconData->uID;
745
746 tbBtn.fsState = TBSTATE_ENABLED;
747 tbBtn.fsStyle = BTNS_NOPREFIX;
748 tbBtn.dwData = (DWORD_PTR)notifyItem;
749 tbBtn.iString = (INT_PTR) text;
750 tbBtn.idCommand = GetButtonCount();
751 tbBtn.iBitmap = -1;
752
753 if (iconData->uFlags & NIF_STATE)
754 {
755 notifyItem->dwState = iconData->dwState & iconData->dwStateMask;
756 }
757
758 if (iconData->uFlags & NIF_MESSAGE)
759 {
760 notifyItem->uCallbackMessage = iconData->uCallbackMessage;
761 }
762
763 if (iconData->uFlags & NIF_ICON)
764 {
765 notifyItem->hIcon = iconData->hIcon;
766 BOOL hasSharedIcon = notifyItem->dwState & NIS_SHAREDICON;
767 if (hasSharedIcon)
768 {
769 INT iIcon = FindExistingSharedIcon(notifyItem->hIcon);
770 if (iIcon < 0)
771 {
772 notifyItem->hIcon = NULL;
773 TRACE("Shared icon requested, but HICON not found!!!\n");
774 }
775 tbBtn.iBitmap = iIcon;
776 }
777 else
778 {
779 tbBtn.iBitmap = ImageList_AddIcon(m_ImageList, notifyItem->hIcon);
780 }
781 }
782
783 if (iconData->uFlags & NIF_TIP)
784 {
785 StringCchCopy(notifyItem->szTip, _countof(notifyItem->szTip), iconData->szTip);
786 }
787
788 if (iconData->uFlags & NIF_INFO)
789 {
790 // NOTE: In Vista+, the uTimeout value is disregarded, and the accessibility settings are used always.
791 StringCchCopy(notifyItem->szInfo, _countof(notifyItem->szInfo), iconData->szInfo);
792 StringCchCopy(notifyItem->szInfoTitle, _countof(notifyItem->szInfoTitle), iconData->szInfoTitle);
793 notifyItem->dwInfoFlags = iconData->dwInfoFlags;
794 notifyItem->uTimeout = iconData->uTimeout;
795 }
796
797 if (notifyItem->dwState & NIS_HIDDEN)
798 {
799 tbBtn.fsState |= TBSTATE_HIDDEN;
800 }
801 else
802 {
804 }
805
806 /* TODO: support VERSION_4 (NIF_GUID, NIF_REALTIME, NIF_SHOWTIP) */
807
808 CToolbar::AddButton(&tbBtn);
810
811 if (iconData->uFlags & NIF_INFO)
812 {
813 m_BalloonQueue->UpdateInfo(notifyItem);
814 }
815
816 return TRUE;
817}
void UpdateInfo(InternalIconData *notifyItem)
Definition: syspager.cpp:557
int FindItem(IN HWND hWnd, IN UINT uID, InternalIconData **pdata)
Definition: syspager.cpp:683
int FindExistingSharedIcon(HICON handle)
Definition: syspager.cpp:703
DWORD AddButton(TBBUTTON *btn)
Definition: rosctrls.h:327
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
const WCHAR * text
Definition: package.c:1794
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint index
Definition: glext.h:6031
#define L(x)
Definition: ntvdm.h:50
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define BTNS_NOPREFIX
Definition: commctrl.h:1005
#define TBSTATE_HIDDEN
Definition: commctrl.h:975
#define NIF_ICON
Definition: shellapi.h:107
#define NIF_MESSAGE
Definition: shellapi.h:106
#define NIF_TIP
Definition: shellapi.h:108
#define _countof(array)
Definition: sndvol32.h:70
#define TRACE(s)
Definition: solgame.cpp:4
#define StringCchCopy
Definition: strsafe.h:139
CHAR szInfoTitle[64]
Definition: shellapi.h:246
CHAR szInfo[256]
Definition: shellapi.h:241
UINT uCallbackMessage
Definition: shellapi.h:232
DWORD dwInfoFlags
Definition: shellapi.h:247
CHAR szTip[128]
Definition: shellapi.h:238
BYTE fsState
Definition: commctrl.h:951
INT_PTR iString
Definition: commctrl.h:959
int idCommand
Definition: commctrl.h:950
DWORD_PTR dwData
Definition: commctrl.h:958
int iBitmap
Definition: commctrl.h:949
BYTE fsStyle
Definition: commctrl.h:952
#define DWORD_PTR
Definition: treelist.c:76
int32_t INT_PTR
Definition: typedefs.h:64
int32_t INT
Definition: typedefs.h:58
#define ZeroMemory
Definition: winbase.h:1743
#define SM_CYSMICON
Definition: winuser.h:1024
#define SM_CXSMICON
Definition: winuser.h:1023
int WINAPI GetSystemMetrics(_In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CSysPagerWnd::NotifyIcon(), and UpdateButton().

◆ FindExistingSharedIcon()

int CNotifyToolbar::FindExistingSharedIcon ( HICON  handle)

Definition at line 703 of file syspager.cpp.

704{
705 int count = GetButtonCount();
706 for (int i = 0; i < count; i++)
707 {
708 InternalIconData * data = GetItemData(i);
709 if (data->hIcon == handle)
710 {
711 TBBUTTON btn;
712 GetButton(i, &btn);
713 return btn.iBitmap;
714 }
715 }
716
717 return -1;
718}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by AddButton(), ResizeImagelist(), and UpdateButton().

◆ FindItem()

int CNotifyToolbar::FindItem ( IN HWND  hWnd,
IN UINT  uID,
InternalIconData **  pdata 
)

Definition at line 683 of file syspager.cpp.

684{
685 int count = GetButtonCount();
686
687 for (int i = 0; i < count; i++)
688 {
689 InternalIconData * data = GetItemData(i);
690
691 if (data->hWnd == hWnd &&
692 data->uID == uID)
693 {
694 if (pdata)
695 *pdata = data;
696 return i;
697 }
698 }
699
700 return -1;
701}
HWND hWnd
Definition: settings.c:17
static PROTOCOLDATA * pdata
Definition: protocol.c:158

Referenced by AddButton(), RemoveButton(), SwitchVersion(), and UpdateButton().

◆ GetVisibleButtonCount()

int CNotifyToolbar::GetVisibleButtonCount ( )

Definition at line 678 of file syspager.cpp.

679{
681}

Referenced by CSysPagerWnd::GetSize(), and CSysPagerWnd::NotifyIcon().

◆ Initialize()

void CNotifyToolbar::Initialize ( HWND  hWndParent,
CBalloonQueue queue 
)

Definition at line 1231 of file syspager.cpp.

1232{
1234
1235 DWORD styles =
1239
1240 // HACK & FIXME: CORE-18016
1242 m_hWnd = NULL;
1244
1245 // Force the toolbar tooltips window to always show tooltips even if not foreground
1246 HWND tooltipsWnd = (HWND)SendMessageW(TB_GETTOOLTIPS);
1247 if (tooltipsWnd)
1248 {
1249 ::SetWindowLong(tooltipsWnd, GWL_STYLE, ::GetWindowLong(tooltipsWnd, GWL_STYLE) | TTS_ALWAYSTIP);
1250 }
1251
1252 SetWindowTheme(m_hWnd, L"TrayNotify", NULL);
1253
1256
1258
1260}
HWND m_hWnd
Definition: atlwin.h:273
void RefreshToolbarMetrics(BOOL bForceRefresh)
Definition: syspager.cpp:1262
HWND Create(HWND hWndParent, DWORD dwStyles=0, DWORD dwExStyles=0)
Definition: rosctrls.h:256
Definition: _queue.h:67
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
HANDLE HWND
Definition: compat.h:19
unsigned long DWORD
Definition: ntddk_ex.h:95
static VOID SetImageList(HWND hwnd)
Definition: mplay32.c:238
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define TB_GETTOOLTIPS
Definition: commctrl.h:1138
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define ILC_COLOR32
Definition: commctrl.h:358
#define TBSTYLE_TRANSPARENT
Definition: commctrl.h:996
#define CCS_NODIVIDER
Definition: commctrl.h:2253
#define CCS_TOP
Definition: commctrl.h:2247
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define ILC_MASK
Definition: commctrl.h:351
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2251
#define CCS_NORESIZE
Definition: commctrl.h:2250
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:990
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SubclassWindow(hwnd, lpfn)
Definition: windowsx.h:542
#define SetWindowLong
Definition: winuser.h:5873
#define GetWindowLong
Definition: winuser.h:5816
#define GWL_STYLE
Definition: winuser.h:863
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CSysPagerWnd::OnCreate().

◆ OnCtxMenu()

LRESULT CNotifyToolbar::OnCtxMenu ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 1034 of file syspager.cpp.

1035{
1036 bHandled = FALSE;
1037
1038 /*
1039 * WM_CONTEXTMENU message can be generated either by the mouse,
1040 * in which case lParam encodes the mouse coordinates where the
1041 * user right-clicked the mouse, or can be generated by (Shift-)F10
1042 * keyboard press, in which case lParam equals -1.
1043 */
1044 INT iBtn = GetHotItem();
1045 if (iBtn < 0)
1046 return 0;
1047
1048 InternalIconData* notifyItem = GetItemData(iBtn);
1049
1050 if (!::IsWindow(notifyItem->hWnd))
1051 return 0;
1052
1053 if (notifyItem->uVersionCopy >= NOTIFYICON_VERSION)
1054 {
1055 /* Transmit the WM_CONTEXTMENU message if the notification icon supports it */
1056 ::SendNotifyMessage(notifyItem->hWnd,
1057 notifyItem->uCallbackMessage,
1058 notifyItem->uID,
1060 }
1061 else if (lParam == -1)
1062 {
1063 /*
1064 * Otherwise, and only if the WM_CONTEXTMENU message was generated
1065 * from the keyboard, simulate right-click mouse messages. This is
1066 * not needed if the message came from the mouse because in this
1067 * case the right-click mouse messages were already sent together.
1068 */
1069 ::SendNotifyMessage(notifyItem->hWnd,
1070 notifyItem->uCallbackMessage,
1071 notifyItem->uID,
1073 ::SendNotifyMessage(notifyItem->hWnd,
1074 notifyItem->uCallbackMessage,
1075 notifyItem->uID,
1076 WM_RBUTTONUP);
1077 }
1078
1079 return 0;
1080}
BOOL IsWindow() const
Definition: atlwin.h:947
LPARAM lParam
Definition: combotst.c:139
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_RBUTTONUP
Definition: winuser.h:1791
#define WM_RBUTTONDOWN
Definition: winuser.h:1790
#define SendNotifyMessage
Definition: winuser.h:5866

◆ OnMouseEvent()

LRESULT CNotifyToolbar::OnMouseEvent ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
private

Definition at line 1151 of file syspager.cpp.

1152{
1154 INT iBtn = HitTest(&pt);
1155
1156 if (iBtn >= 0)
1157 {
1158 SendMouseEvent(iBtn, uMsg, wParam);
1159 }
1160
1161 bHandled = FALSE;
1162 return FALSE;
1163}
VOID SendMouseEvent(IN WORD wIndex, IN UINT uMsg, IN WPARAM wParam)
Definition: syspager.cpp:1120
WPARAM wParam
Definition: combotst.c:138
#define pt(x, y)
Definition: drawing.c:79
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299

◆ OnTooltipShow()

LRESULT CNotifyToolbar::OnTooltipShow ( INT  uCode,
LPNMHDR  hdr,
BOOL bHandled 
)
private

Definition at line 1178 of file syspager.cpp.

1179{
1180 RECT rcTip, rcItem;
1181 ::GetWindowRect(hdr->hwndFrom, &rcTip);
1182
1183 SIZE szTip = { rcTip.right - rcTip.left, rcTip.bottom - rcTip.top };
1184
1185 INT iBtn = GetHotItem();
1186
1187 if (iBtn >= 0)
1188 {
1189 MONITORINFO monInfo = { 0 };
1190 HMONITOR hMon = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
1191
1192 monInfo.cbSize = sizeof(monInfo);
1193
1194 if (hMon)
1195 GetMonitorInfo(hMon, &monInfo);
1196 else
1197 ::GetWindowRect(GetDesktopWindow(), &monInfo.rcMonitor);
1198
1199 GetItemRect(iBtn, &rcItem);
1200
1201 POINT ptItem = { rcItem.left, rcItem.top };
1202 SIZE szItem = { rcItem.right - rcItem.left, rcItem.bottom - rcItem.top };
1203 ClientToScreen(&ptItem);
1204
1205 ptItem.x += szItem.cx / 2;
1206 ptItem.y -= szTip.cy;
1207
1208 if (ptItem.x + szTip.cx > monInfo.rcMonitor.right)
1209 ptItem.x = monInfo.rcMonitor.right - szTip.cx;
1210
1211 if (ptItem.y + szTip.cy > monInfo.rcMonitor.bottom)
1212 ptItem.y = monInfo.rcMonitor.bottom - szTip.cy;
1213
1214 if (ptItem.x < monInfo.rcMonitor.left)
1215 ptItem.x = monInfo.rcMonitor.left;
1216
1217 if (ptItem.y < monInfo.rcMonitor.top)
1218 ptItem.y = monInfo.rcMonitor.top;
1219
1220 TRACE("ptItem { %d, %d }\n", ptItem.x, ptItem.y);
1221
1222 ::SetWindowPos(hdr->hwndFrom, NULL, ptItem.x, ptItem.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
1223
1224 return TRUE;
1225 }
1226
1227 bHandled = FALSE;
1228 return 0;
1229}
BOOL SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
Definition: atlwin.h:1288
BOOL GetWindowRect(LPRECT lpRect) const
Definition: atlwin.h:816
BOOL ClientToScreen(LPPOINT lpPoint) const
Definition: atlwin.h:393
char hdr[14]
Definition: iptest.cpp:33
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
RECT rcMonitor
Definition: winuser.h:3796
DWORD cbSize
Definition: winuser.h:3795
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 GetMonitorInfo
Definition: winuser.h:5811
#define SWP_NOACTIVATE
Definition: winuser.h:1253
#define SWP_NOSIZE
Definition: winuser.h:1256
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define SWP_NOZORDER
Definition: winuser.h:1258

◆ RefreshToolbarMetrics()

void CNotifyToolbar::RefreshToolbarMetrics ( BOOL  bForceRefresh = FALSE)

Definition at line 1262 of file syspager.cpp.

1263{
1264 // Toolbar metrics only needs to be refreshed for the automatic setting and first launch
1265 if (g_TaskbarSettings.eCompactTrayIcons == TrayIconsMode::TIM_Default ||
1266 bForceRefresh)
1267 {
1268 TBMETRICS tbm = {sizeof(tbm)};
1270 tbm.cxPad = 1;
1271 tbm.cyPad = 1;
1273 {
1276 }
1277 tbm.cxBarPad = 1;
1278 tbm.cyBarPad = 1;
1279 tbm.cxButtonSpacing = 1;
1280 tbm.cyButtonSpacing = 1;
1281 SetMetrics(&tbm);
1282 }
1283}
TaskbarSettings g_TaskbarSettings
Definition: settings.cpp:23
#define TBMF_BUTTONSPACING
Definition: commctrl.h:1289
#define TBMF_PAD
Definition: commctrl.h:1287
#define TBMF_BARPAD
Definition: commctrl.h:1288
int cyButtonSpacing
Definition: commctrl.h:1299
int cxButtonSpacing
Definition: commctrl.h:1298
int cxBarPad
Definition: commctrl.h:1296
DWORD dwMask
Definition: commctrl.h:1293
int cyBarPad
Definition: commctrl.h:1297
int cyPad
Definition: commctrl.h:1295
int cxPad
Definition: commctrl.h:1294
TrayIconsMode eCompactTrayIcons
Definition: precomp.h:224
BOOL UseCompactTrayIcons()
Definition: precomp.h:230

Referenced by Initialize(), and CSysPagerWnd::OnSize().

◆ RemoveButton()

BOOL CNotifyToolbar::RemoveButton ( IN CONST NOTIFYICONDATA iconData)

Definition at line 947 of file syspager.cpp.

948{
949 InternalIconData * notifyItem;
950
951 TRACE("Removing icon %d from hWnd %08x\n", iconData->uID, iconData->hWnd);
952
953 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
954 if (index < 0)
955 {
956 TRACE("Icon %d from hWnd %08x ALREADY MISSING!\n", iconData->uID, iconData->hWnd);
957
958 return FALSE;
959 }
960
961 if (!(notifyItem->dwState & NIS_HIDDEN))
962 {
964 }
965
966 if (!(notifyItem->dwState & NIS_SHAREDICON))
967 {
968 TBBUTTON btn;
969 GetButton(index, &btn);
970 int oldIconIndex = btn.iBitmap;
971 ImageList_Remove(m_ImageList, oldIconIndex);
972
973 // Update other icons!
974 int count = GetButtonCount();
975 for (int i = 0; i < count; i++)
976 {
977 TBBUTTON btn;
978 GetButton(i, &btn);
979
980 if (btn.iBitmap > oldIconIndex)
981 {
982 TBBUTTONINFO tbbi2 = { 0 };
983 tbbi2.cbSize = sizeof(tbbi2);
984 tbbi2.dwMask = TBIF_BYINDEX | TBIF_IMAGE;
985 tbbi2.iImage = btn.iBitmap-1;
986 SetButtonInfo(i, &tbbi2);
987 }
988 }
989 }
990
991 m_BalloonQueue->RemoveInfo(notifyItem);
992
993 DeleteButton(index);
994
995 delete notifyItem;
996
997 return TRUE;
998}
void RemoveInfo(InternalIconData *notifyItem)
Definition: syspager.cpp:581
BOOL WINAPI ImageList_Remove(HIMAGELIST himl, INT i)
Definition: imagelist.c:2628
#define TBIF_IMAGE
Definition: commctrl.h:1219
#define TBBUTTONINFO
Definition: commctrl.h:1254
#define TBIF_BYINDEX
Definition: commctrl.h:1226

Referenced by CSysPagerWnd::NotifyIcon(), and SendNotifyCallback().

◆ ResizeImagelist()

VOID CNotifyToolbar::ResizeImagelist ( )

Definition at line 1000 of file syspager.cpp.

1001{
1002 int cx, cy;
1003 HIMAGELIST iml;
1004
1006 return;
1007
1009 return;
1010
1012 if (!iml)
1013 return;
1014
1016 m_ImageList = iml;
1018
1019 int count = GetButtonCount();
1020 for (int i = 0; i < count; i++)
1021 {
1022 InternalIconData * data = GetItemData(i);
1023 BOOL hasSharedIcon = data->dwState & NIS_SHAREDICON;
1024 INT iIcon = hasSharedIcon ? FindExistingSharedIcon(data->hIcon) : -1;
1025 if (iIcon < 0)
1026 iIcon = ImageList_AddIcon(iml, data->hIcon);
1027 TBBUTTONINFO tbbi = { sizeof(tbbi), TBIF_BYINDEX | TBIF_IMAGE, 0, iIcon};
1028 SetButtonInfo(i, &tbbi);
1029 }
1030
1032}
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
Definition: imagelist.c:2055
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585

Referenced by CSysPagerWnd::OnSettingChanged().

◆ SendMouseEvent()

VOID CNotifyToolbar::SendMouseEvent ( IN WORD  wIndex,
IN UINT  uMsg,
IN WPARAM  wParam 
)
private

Definition at line 1120 of file syspager.cpp.

1121{
1122 static LPCWSTR eventNames [] = {
1123 L"WM_MOUSEMOVE",
1124 L"WM_LBUTTONDOWN",
1125 L"WM_LBUTTONUP",
1126 L"WM_LBUTTONDBLCLK",
1127 L"WM_RBUTTONDOWN",
1128 L"WM_RBUTTONUP",
1129 L"WM_RBUTTONDBLCLK",
1130 L"WM_MBUTTONDOWN",
1131 L"WM_MBUTTONUP",
1132 L"WM_MBUTTONDBLCLK",
1133 L"WM_MOUSEWHEEL",
1134 L"WM_XBUTTONDOWN",
1135 L"WM_XBUTTONUP",
1136 L"WM_XBUTTONDBLCLK"
1137 };
1138
1139 InternalIconData * notifyItem = GetItemData(wIndex);
1140
1141 if (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST)
1142 {
1143 TRACE("Sending message %S from button %d to %p (msg=%x, w=%x, l=%x)...\n",
1144 eventNames[uMsg - WM_MOUSEFIRST], wIndex,
1145 notifyItem->hWnd, notifyItem->uCallbackMessage, notifyItem->uID, uMsg);
1146 }
1147
1148 SendNotifyCallback(notifyItem, uMsg);
1149}
bool SendNotifyCallback(InternalIconData *notifyItem, UINT uMsg)
Definition: syspager.cpp:1082
#define WM_MOUSEFIRST
Definition: winuser.h:1785
#define WM_MOUSELAST
Definition: winuser.h:1812
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by OnMouseEvent().

◆ SendNotifyCallback()

bool CNotifyToolbar::SendNotifyCallback ( InternalIconData notifyItem,
UINT  uMsg 
)

Definition at line 1082 of file syspager.cpp.

1083{
1084 if (!::IsWindow(notifyItem->hWnd))
1085 {
1086 // We detect and destroy icons with invalid handles only on mouse move over systray, same as MS does.
1087 // Alternatively we could search for them periodically (would waste more resources).
1088 TRACE("Destroying icon %d with invalid handle hWnd=%08x\n", notifyItem->uID, notifyItem->hWnd);
1089
1090 RemoveButton(notifyItem);
1091
1092 /* Ask the parent to resize */
1093 NMHDR nmh = {GetParent(), 0, NTNWM_REALIGN};
1094 GetParent().SendMessage(WM_NOTIFY, 0, (LPARAM) &nmh);
1095
1096 return true;
1097 }
1098
1099 DWORD pid;
1100 GetWindowThreadProcessId(notifyItem->hWnd, &pid);
1101
1102 if (pid == GetCurrentProcessId() ||
1103 (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST))
1104 {
1105 ::PostMessage(notifyItem->hWnd,
1106 notifyItem->uCallbackMessage,
1107 notifyItem->uID,
1108 uMsg);
1109 }
1110 else
1111 {
1112 ::SendMessage(notifyItem->hWnd,
1113 notifyItem->uCallbackMessage,
1114 notifyItem->uID,
1115 uMsg);
1116 }
1117 return false;
1118}
#define NTNWM_REALIGN
Definition: precomp.h:375
LRESULT SendMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:1116
CWindow GetParent() const
Definition: atlwin.h:700
BOOL RemoveButton(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:947
#define WM_NOTIFY
Definition: richedit.h:61
DWORD WINAPI GetCurrentProcessId(void)
Definition: proc.c:1158
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
LONG_PTR LPARAM
Definition: windef.h:208
#define SendMessage
Definition: winuser.h:5863
#define PostMessage
Definition: winuser.h:5852

Referenced by CBalloonQueue::Close(), SendMouseEvent(), and CBalloonQueue::Show().

◆ SwitchVersion()

BOOL CNotifyToolbar::SwitchVersion ( IN CONST NOTIFYICONDATA iconData)

Definition at line 819 of file syspager.cpp.

820{
821 InternalIconData * notifyItem;
822 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
823 if (index < 0)
824 {
825 WARN("Icon %d from hWnd %08x DOES NOT EXIST!\n", iconData->uID, iconData->hWnd);
826 return FALSE;
827 }
828
829 if (iconData->uVersion != 0 && iconData->uVersion != NOTIFYICON_VERSION)
830 {
831 WARN("Tried to set the version of icon %d from hWnd %08x, to an unknown value %d. Vista+ program?\n", iconData->uID, iconData->hWnd, iconData->uVersion);
832 return FALSE;
833 }
834
835 // We can not store the version in the uVersion field, because it's union'd with uTimeout,
836 // which we also need to keep track of.
837 notifyItem->uVersionCopy = iconData->uVersion;
838
839 return TRUE;
840}
#define WARN(fmt,...)
Definition: precomp.h:61

Referenced by CSysPagerWnd::NotifyIcon().

◆ UpdateButton()

BOOL CNotifyToolbar::UpdateButton ( IN CONST NOTIFYICONDATA iconData)

Definition at line 842 of file syspager.cpp.

843{
844 InternalIconData * notifyItem;
845 TBBUTTONINFO tbbi = { 0 };
846
847 TRACE("Updating icon %d from hWnd %08x flags%s%s state%s%s\n",
848 iconData->uID, iconData->hWnd,
849 (iconData->uFlags & NIF_ICON) ? " ICON" : "",
850 (iconData->uFlags & NIF_STATE) ? " STATE" : "",
851 (iconData->dwState & NIS_HIDDEN) ? " HIDDEN" : "",
852 (iconData->dwState & NIS_SHAREDICON) ? " SHARED" : "");
853
854 int index = FindItem(iconData->hWnd, iconData->uID, &notifyItem);
855 if (index < 0)
856 {
857 WARN("Icon %d from hWnd %08x DOES NOT EXIST!\n", iconData->uID, iconData->hWnd);
858 return AddButton(iconData);
859 }
860
861 TBBUTTON btn;
862 GetButton(index, &btn);
863 int oldIconIndex = btn.iBitmap;
864
865 tbbi.cbSize = sizeof(tbbi);
866 tbbi.dwMask = TBIF_BYINDEX | TBIF_COMMAND;
867 tbbi.idCommand = index;
868
869 if (iconData->uFlags & NIF_STATE)
870 {
871 if (iconData->dwStateMask & NIS_HIDDEN &&
872 (notifyItem->dwState & NIS_HIDDEN) != (iconData->dwState & NIS_HIDDEN))
873 {
874 tbbi.dwMask |= TBIF_STATE;
875 if (iconData->dwState & NIS_HIDDEN)
876 {
877 tbbi.fsState |= TBSTATE_HIDDEN;
879 }
880 else
881 {
882 tbbi.fsState &= ~TBSTATE_HIDDEN;
884 }
885 }
886
887 notifyItem->dwState &= ~iconData->dwStateMask;
888 notifyItem->dwState |= (iconData->dwState & iconData->dwStateMask);
889 }
890
891 if (iconData->uFlags & NIF_MESSAGE)
892 {
893 notifyItem->uCallbackMessage = iconData->uCallbackMessage;
894 }
895
896 if (iconData->uFlags & NIF_ICON)
897 {
898 BOOL hasSharedIcon = notifyItem->dwState & NIS_SHAREDICON;
899 if (hasSharedIcon)
900 {
901 INT iIcon = FindExistingSharedIcon(iconData->hIcon);
902 if (iIcon >= 0)
903 {
904 notifyItem->hIcon = iconData->hIcon;
905 tbbi.dwMask |= TBIF_IMAGE;
906 tbbi.iImage = iIcon;
907 }
908 else
909 {
910 TRACE("Shared icon requested, but HICON not found!!! IGNORING!\n");
911 }
912 }
913 else
914 {
915 notifyItem->hIcon = iconData->hIcon;
916 tbbi.dwMask |= TBIF_IMAGE;
917 tbbi.iImage = ImageList_ReplaceIcon(m_ImageList, oldIconIndex, notifyItem->hIcon);
918 }
919 }
920
921 if (iconData->uFlags & NIF_TIP)
922 {
923 StringCchCopy(notifyItem->szTip, _countof(notifyItem->szTip), iconData->szTip);
924 }
925
926 if (iconData->uFlags & NIF_INFO)
927 {
928 // NOTE: In Vista+, the uTimeout value is disregarded, and the accessibility settings are used always.
929 StringCchCopy(notifyItem->szInfo, _countof(notifyItem->szInfo), iconData->szInfo);
930 StringCchCopy(notifyItem->szInfoTitle, _countof(notifyItem->szInfoTitle), iconData->szInfoTitle);
931 notifyItem->dwInfoFlags = iconData->dwInfoFlags;
932 notifyItem->uTimeout = iconData->uTimeout;
933 }
934
935 /* TODO: support VERSION_4 (NIF_GUID, NIF_REALTIME, NIF_SHOWTIP) */
936
937 SetButtonInfo(index, &tbbi);
938
939 if (iconData->uFlags & NIF_INFO)
940 {
941 m_BalloonQueue->UpdateInfo(notifyItem);
942 }
943
944 return TRUE;
945}
#define index(s, c)
Definition: various.h:29
BOOL AddButton(IN CONST NOTIFYICONDATA *iconData)
Definition: syspager.cpp:720
INT WINAPI ImageList_ReplaceIcon(HIMAGELIST himl, INT nIndex, HICON hIcon)
Definition: imagelist.c:2839
#define TBIF_COMMAND
Definition: commctrl.h:1224
#define TBIF_STATE
Definition: commctrl.h:1221

Referenced by CSysPagerWnd::NotifyIcon().

Member Data Documentation

◆ m_BalloonQueue

CBalloonQueue* CNotifyToolbar::m_BalloonQueue
private

Definition at line 153 of file syspager.cpp.

Referenced by AddButton(), Initialize(), RemoveButton(), and UpdateButton().

◆ m_ImageList

HIMAGELIST CNotifyToolbar::m_ImageList
private

Definition at line 150 of file syspager.cpp.

Referenced by AddButton(), Initialize(), RemoveButton(), ResizeImagelist(), and UpdateButton().

◆ m_VisibleButtonCount

int CNotifyToolbar::m_VisibleButtonCount
private

Definition at line 151 of file syspager.cpp.

Referenced by AddButton(), GetVisibleButtonCount(), RemoveButton(), and UpdateButton().


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