2 * Copyright 2018 Hermes Belusca-Maito
4 * Pass on icon notification messages to the systray implementation
5 * in the currently running shell.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #ifndef _USERNOTIFICATION_H_
23 #define _USERNOTIFICATION_H_
27 class CUserNotification
:
28 public CComCoClass
<CUserNotification
, &CLSID_UserNotification
>,
29 public CComObjectRootEx
<CComMultiThreadModelNoCS
>,
30 public IUserNotification
31 // public IUserNotification2 // On Vista+
40 UINT m_uContinuePoolInterval
;
43 IQueryContinue
* m_pqc
;
46 CStringW m_szInfoTitle
;
50 VOID
DelayRemoveIcon(IN HRESULT hRes
);
55 IN OUT PNOTIFYICONDATAW pnid
);
57 static LRESULT CALLBACK
69 virtual HRESULT STDMETHODCALLTYPE
SetBalloonInfo(
72 IN DWORD dwInfoFlags
);
74 virtual HRESULT STDMETHODCALLTYPE
SetBalloonRetry(
75 IN DWORD dwShowTime
, // Time intervals in milliseconds
79 virtual HRESULT STDMETHODCALLTYPE
SetIconInfo(
81 IN LPCWSTR pszToolTip
);
83 // Blocks until the notification times out.
84 virtual HRESULT STDMETHODCALLTYPE
Show(
85 IN IQueryContinue
* pqc
,
86 IN DWORD dwContinuePollInterval
);
88 virtual HRESULT STDMETHODCALLTYPE
PlaySound(
89 IN LPCWSTR pszSoundName
);
93 // Blocks until the notification times out.
94 virtual HRESULT STDMETHODCALLTYPE
Show(
95 IN IQueryContinue
* pqc
,
96 IN DWORD dwContinuePollInterval
,
97 IN IUserNotificationCallback
* pSink
);
100 DECLARE_REGISTRY_RESOURCEID(IDR_USERNOTIFICATION
)
101 DECLARE_NOT_AGGREGATABLE(CUserNotification
)
103 DECLARE_PROTECT_FINAL_CONSTRUCT()
105 BEGIN_COM_MAP(CUserNotification
)
106 COM_INTERFACE_ENTRY_IID(IID_IUserNotification
, IUserNotification
)
107 // COM_INTERFACE_ENTRY_IID(IID_IUserNotification2, IUserNotification2)
111 #endif /* _USERNOTIFICATION_H_ */