ReactOS  0.4.15-dev-3745-g356babc
CUserNotification.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Hermes Belusca-Maito
3  *
4  * Pass on icon notification messages to the systray implementation
5  * in the currently running shell.
6  *
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.
11  *
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.
16  *
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
20  */
21 
22 #ifndef _USERNOTIFICATION_H_
23 #define _USERNOTIFICATION_H_
24 
25 #undef PlaySound
26 
28  public CComCoClass<CUserNotification, &CLSID_UserNotification>,
29  public CComObjectRootEx<CComMultiThreadModelNoCS>,
30  public IUserNotification
31 // public IUserNotification2 // On Vista+
32 {
33 private:
43  IQueryContinue* m_pqc;
47 
48 private:
49  VOID RemoveIcon();
51  VOID TimeoutIcon();
52 
54  IN UINT uFlags,
55  IN OUT PNOTIFYICONDATAW pnid);
56 
57  static LRESULT CALLBACK
59  IN HWND hWnd,
60  IN UINT uMsg,
62  IN LPARAM lParam);
63 
64 public:
67 
68  // IUserNotification
70  IN LPCWSTR pszTitle,
71  IN LPCWSTR pszText,
72  IN DWORD dwInfoFlags);
73 
75  IN DWORD dwShowTime, // Time intervals in milliseconds
76  IN DWORD dwInterval,
77  IN UINT cRetryCount);
78 
80  IN HICON hIcon,
81  IN LPCWSTR pszToolTip);
82 
83  // Blocks until the notification times out.
85  IN IQueryContinue* pqc,
86  IN DWORD dwContinuePollInterval);
87 
89  IN LPCWSTR pszSoundName);
90 
91 #if 0
92  // IUserNotification2
93  // Blocks until the notification times out.
95  IN IQueryContinue* pqc,
96  IN DWORD dwContinuePollInterval,
97  IN IUserNotificationCallback* pSink);
98 #endif
99 
102 
104 
106  COM_INTERFACE_ENTRY_IID(IID_IUserNotification , IUserNotification )
107  // COM_INTERFACE_ENTRY_IID(IID_IUserNotification2, IUserNotification2)
108  END_COM_MAP()
109 };
110 
111 #endif /* _USERNOTIFICATION_H_ */
VOID DelayRemoveIcon(IN HRESULT hRes)
#define IN
Definition: typedefs.h:39
static HICON
Definition: imagelist.c:84
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define CALLBACK
Definition: compat.h:35
HWND hWnd
Definition: settings.c:17
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:612
UINT_PTR WPARAM
Definition: windef.h:207
UINT uFlags
Definition: api.c:59
static LRESULT CALLBACK WorkerWndProc(IN HWND hWnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
WPARAM wParam
Definition: combotst.c:138
VOID SetUpNotifyData(IN UINT uFlags, IN OUT PNOTIFYICONDATAW pnid)
virtual HRESULT STDMETHODCALLTYPE SetIconInfo(IN HICON hIcon, IN LPCWSTR pszToolTip)
virtual HRESULT STDMETHODCALLTYPE SetBalloonRetry(IN DWORD dwShowTime, IN DWORD dwInterval, IN UINT cRetryCount)
unsigned int BOOL
Definition: ntddk_ex.h:94
virtual HRESULT STDMETHODCALLTYPE SetBalloonInfo(IN LPCWSTR pszTitle, IN LPCWSTR pszText, IN DWORD dwInfoFlags)
virtual HRESULT STDMETHODCALLTYPE PlaySound(IN LPCWSTR pszSoundName)
LONG_PTR LPARAM
Definition: windef.h:208
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:542
LONG HRESULT
Definition: typedefs.h:79
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned long DWORD
Definition: ntddk_ex.h:95
virtual HRESULT STDMETHODCALLTYPE Show(IN IQueryContinue *pqc, IN DWORD dwContinuePollInterval)
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:606
IQueryContinue * m_pqc
#define IDR_USERNOTIFICATION
Definition: shresdef.h:876
HICON hIcon
Definition: msconfig.c:44
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
unsigned int UINT
Definition: ndis.h:50
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:640
#define OUT
Definition: typedefs.h:40
CAtlStringW CStringW
Definition: atlstr.h:130
#define END_COM_MAP()
Definition: atlcom.h:553
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139