ReactOS  0.4.15-dev-5130-gc1c1279
csystray.cpp
Go to the documentation of this file.
1 /*
2 * PROJECT: ReactOS system libraries
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/shellext/stobject/csystray.cpp
5 * PURPOSE: Systray shell service object implementation
6 * PROGRAMMERS: David Quintana <gigaherz@gmail.com>
7 * Shriraj Sawant a.k.a SR13 <sr.official@hotmail.com>
8 */
9 
10 #include "precomp.h"
11 
12 #include <regstr.h>
13 #include <undocshell.h>
14 #include <shellutils.h>
15 
20 };
22 
23 CSysTray::CSysTray() : dwServicesEnabled(0)
24 {
26  wm_DESTROYWINDOW = RegisterWindowMessageW(L"CSysTray_DESTROY");
27 }
28 
30 {
31 }
32 
34 {
35  HKEY hKey;
36  DWORD dwSize;
37 
38  /* Enable power, volume and hotplug by default */
40 
42  0,
43  NULL,
45  KEY_READ,
46  NULL,
47  &hKey,
48  NULL) == ERROR_SUCCESS)
49  {
50  dwSize = sizeof(DWORD);
52  L"Services",
53  NULL,
54  NULL,
55  (LPBYTE)&this->dwServicesEnabled,
56  &dwSize);
57 
59  }
60 }
61 
63 {
64  HKEY hKey;
65 
66  if (bEnable)
67  this->dwServicesEnabled |= dwServiceFlag;
68  else
69  this->dwServicesEnabled &= ~dwServiceFlag;
70 
72  L"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\SysTray",
73  0,
74  NULL,
76  KEY_WRITE,
77  NULL,
78  &hKey,
79  NULL) == ERROR_SUCCESS)
80  {
82  L"Services",
83  0,
84  REG_DWORD,
85  (LPBYTE)&this->dwServicesEnabled,
86  sizeof(DWORD));
87 
89  }
90 }
91 
93 {
94  return (this->dwServicesEnabled & dwServiceFlag);
95 }
96 
98 {
99  HRESULT hr = CoCreateInstance(CLSID_ConnectionTray, 0, 1u, IID_PPV_ARG(IOleCommandTarget, &pctNetShell));
100  if (FAILED(hr))
101  return hr;
102 
103  return pctNetShell->Exec(&CGID_ShellServiceObject,
104  OLECMDID_NEW,
106 }
107 
109 {
110  if (!pctNetShell)
111  return S_FALSE;
112  HRESULT hr = pctNetShell->Exec(&CGID_ShellServiceObject,
115  pctNetShell.Release();
116  return hr;
117 }
118 
120 {
121  TRACE("Initializing Notification icons...\n");
122  for (int i = 0; i < g_NumIcons; i++)
123  {
124  if (this->dwServicesEnabled & g_IconHandlers[i].dwServiceFlag)
125  {
126  HRESULT hr = g_IconHandlers[i].pfnInit(this);
127  if (FAILED(hr))
128  return hr;
129  }
130  }
131 
132  MouseKeys_Init(this);
133 
134  return InitNetShell();
135 }
136 
138 {
139  TRACE("Shutting down Notification icons...\n");
140  for (int i = 0; i < g_NumIcons; i++)
141  {
142  if (this->dwServicesEnabled & g_IconHandlers[i].dwServiceFlag)
143  {
144  this->dwServicesEnabled &= ~g_IconHandlers[i].dwServiceFlag;
147  }
148  }
149 
150  MouseKeys_Shutdown(this);
151 
152  return ShutdownNetShell();
153 }
154 
156 {
157  TRACE("Updating Notification icons...\n");
158  for (int i = 0; i < g_NumIcons; i++)
159  {
160  if (this->dwServicesEnabled & g_IconHandlers[i].dwServiceFlag)
161  {
163  if (FAILED(hr))
164  return hr;
165  }
166  }
167 
168  return S_OK;
169 }
170 
172 {
173  for (int i = 0; i < g_NumIcons; i++)
174  {
175  HRESULT hr = g_IconHandlers[i].pfnMessage(this, uMsg, wParam, lParam, lResult);
176  if (FAILED(hr))
177  return hr;
178 
179  if (hr == S_OK)
180  return hr;
181  }
182 
183  // Not handled by anyone, so return accordingly.
184  return S_FALSE;
185 }
186 
187 /*++
188 * @name NotifyIcon
189 *
190 * Basically a Shell_NotifyIcon wrapper.
191 * Based on the parameters provided, it changes the current state of the notification icon.
192 *
193 * @param code
194 * Determines whether to add, delete or modify the notification icon (represented by uId).
195 * @param uId
196 * Represents the particular notification icon.
197 * @param hIcon
198 * A handle to an icon for the notification object.
199 * @param szTip
200 * A string for the tooltip of the notification.
201 * @param dwstate
202 * Determines whether to show or hide the notification icon.
203 *
204 * @return The error code.
205 *
206 *--*/
208 {
209  NOTIFYICONDATA nim = { 0 };
210 
211  TRACE("NotifyIcon code=%d, uId=%d, hIcon=%p, szTip=%S\n", code, uId, hIcon, szTip);
212 
213  nim.cbSize = sizeof(nim);
214  nim.uFlags = NIF_MESSAGE | NIF_ICON | NIF_STATE | NIF_TIP;
215  nim.hIcon = hIcon;
216  nim.uID = uId;
217  nim.uCallbackMessage = uId;
218  nim.dwState = dwstate;
219  nim.dwStateMask = NIS_HIDDEN;
220  nim.hWnd = m_hWnd;
221  nim.uVersion = NOTIFYICON_VERSION;
222  if (szTip)
223  StringCchCopy(nim.szTip, _countof(nim.szTip), szTip);
224  else
225  nim.szTip[0] = 0;
226  BOOL ret = Shell_NotifyIcon(code, &nim);
227  return ret ? S_OK : E_FAIL;
228 }
229 
231 {
232  CSysTray * st = (CSysTray*) param;
233  return st->SysTrayThreadProc();
234 }
235 
237 {
238  BOOL ret;
239  MSG msg;
240 
241  while ((ret = GetMessage(&msg, NULL, 0, 0)) != 0)
242  {
243  if (ret < 0)
244  break;
245 
248  }
249 
250  return S_OK;
251 }
252 
254 {
255  WCHAR strFileName[MAX_PATH];
256  GetModuleFileNameW(g_hInstance, strFileName, MAX_PATH);
257  HMODULE hLib = LoadLibraryW(strFileName);
258 
260 
261  Create(NULL);
262 
264 
265  CoUninitialize();
266 
267  Release();
269 }
270 
272 {
273  TRACE("CSysTray Init TODO: Initialize tray icon handlers.\n");
274  AddRef();
275 
277 
279 
280  return S_OK;
281 }
282 
284 {
285  if (!DestroyWindow())
286  {
287  // Window is from another thread, ask it politely to destroy itself:
289  }
290  return S_OK;
291 }
292 
293 // *** IOleCommandTarget methods ***
294 HRESULT STDMETHODCALLTYPE CSysTray::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
295 {
297  return S_OK;
298 }
299 
300 HRESULT STDMETHODCALLTYPE CSysTray::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
301 {
302  if (!IsEqualGUID(*pguidCmdGroup, CGID_ShellServiceObject))
303  return E_FAIL;
304 
305  switch (nCmdID)
306  {
307  case OLECMDID_NEW: // init
308  return CreateSysTrayThread();
309  case OLECMDID_SAVE: // shutdown
310  return DestroySysTrayWindow();
311  }
312  return S_OK;
313 }
314 
316 {
317  HRESULT hr;
318 
319  if (hWnd != m_hWnd)
320  return FALSE;
321 
322  if (wm_DESTROYWINDOW && uMsg == wm_DESTROYWINDOW)
323  {
324  return DestroyWindow();
325  }
326 
327  if (wm_SHELLHOOK && uMsg == wm_SHELLHOOK)
328  {
329  if (wParam == HSHELL_ACCESSIBILITYSTATE && lParam == ACCESS_MOUSEKEYS)
330  {
331  MouseKeys_Update(this);
332  }
333  lResult = 0L;
334  return TRUE;
335  }
336 
337  switch (uMsg)
338  {
339  case WM_NCCREATE:
340  case WM_NCDESTROY:
341  return FALSE;
342 
343  case WM_CREATE:
345  InitIcons();
346  SetTimer(1, 2000, NULL);
348  return TRUE;
349 
350  case WM_TIMER:
351  if (wParam == 1)
352  UpdateIcons();
353  else
354  ProcessIconMessage(uMsg, wParam, lParam, lResult);
355  return TRUE;
356 
357  case WM_SETTINGCHANGE:
358  if (wParam == SPI_SETMOUSEKEYS)
359  {
360  MouseKeys_Update(this);
361  }
362  break;
363 
364  case WM_DESTROY:
365  KillTimer(1);
367  ShutdownIcons();
368  PostQuitMessage(0);
369  return TRUE;
370  }
371 
372  TRACE("SysTray message received %u (%08p %08p)\n", uMsg, wParam, lParam);
373 
374  hr = ProcessIconMessage(uMsg, wParam, lParam, lResult);
375  if (FAILED(hr))
376  return FALSE;
377 
378  return (hr == S_OK);
379 }
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 * u
Definition: glfuncs.h:240
static DWORD WINAPI s_SysTrayThreadProc(PVOID param)
Definition: csystray.cpp:230
#define POWER_SERVICE_FLAG
Definition: precomp.h:38
#define HOTPLUG_SERVICE_FLAG
Definition: precomp.h:39
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
#define NIF_MESSAGE
Definition: shellapi.h:102
#define DispatchMessage
Definition: winuser.h:5755
HRESULT STDMETHODCALLTYPE Power_Init(_In_ CSysTray *pSysTray)
Definition: power.cpp:115
BOOL WINAPI TranslateMessage(_In_ const MSG *)
static HICON
Definition: imagelist.c:84
#define CloseHandle
Definition: compat.h:598
#define SPI_SETMOUSEKEYS
Definition: winuser.h:1394
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HRESULT InitNetShell()
Definition: csystray.cpp:97
HRESULT CreateSysTrayThread()
Definition: csystray.cpp:271
#define KEY_READ
Definition: nt_native.h:1023
#define TRUE
Definition: types.h:120
HRESULT STDMETHODCALLTYPE Power_Update(_In_ CSysTray *pSysTray)
Definition: power.cpp:123
_In_ BOOLEAN Create
Definition: pstypes.h:527
#define HKEY_CURRENT_USER
Definition: winreg.h:11
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
const int g_NumIcons
Definition: csystray.cpp:21
HWND hWnd
Definition: settings.c:17
UINT wm_SHELLHOOK
Definition: csystray.h:32
BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID=0)
Definition: csystray.cpp:315
HRESULT STDMETHODCALLTYPE Volume_Message(_In_ CSysTray *pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
Definition: volume.cpp:261
UINT_PTR WPARAM
Definition: windef.h:207
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
#define WM_NCCREATE
Definition: winuser.h:1673
BOOL WINAPI DestroyWindow(_In_ HWND)
#define DWORD
Definition: nt_native.h:44
int32_t INT
Definition: typedefs.h:58
SysTrayIconHandlers_t g_IconHandlers[]
Definition: csystray.cpp:16
WPARAM wParam
Definition: combotst.c:138
#define WM_SETTINGCHANGE
Definition: winuser.h:1619
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
HRESULT DestroySysTrayWindow()
Definition: csystray.cpp:283
VOID EnableService(DWORD dwServiceFlag, BOOL bEnable)
Definition: csystray.cpp:62
VOID WINAPI FreeLibraryAndExitThread(HMODULE hLibModule, DWORD dwExitCode)
Definition: loader.c:507
#define L(x)
Definition: ntvdm.h:50
unsigned char * LPBYTE
Definition: typedefs.h:53
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define REGSTR_PATH_SYSTRAY
Definition: regstr.h:531
DWORD dwStateMask
Definition: shellapi.h:237
BOOL IsServiceEnabled(DWORD dwServiceFlag)
Definition: csystray.cpp:92
CHAR szTip[128]
Definition: shellapi.h:235
HRESULT STDMETHODCALLTYPE Hotplug_Init(_In_ CSysTray *pSysTray)
Definition: hotplug.cpp:124
ULONG Release()
#define S_FALSE
Definition: winerror.h:2357
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define NIF_TIP
Definition: shellapi.h:104
HRESULT STDMETHODCALLTYPE Power_Message(_In_ CSysTray *pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
Definition: power.cpp:230
#define LoadLibraryW(x)
Definition: compat.h:606
LONG_PTR LPARAM
Definition: windef.h:208
#define NIF_ICON
Definition: shellapi.h:103
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
HRESULT NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip, DWORD dwstate=0)
Definition: csystray.cpp:207
#define WM_DESTROY
Definition: winuser.h:1599
HRESULT STDMETHODCALLTYPE Hotplug_Message(_In_ CSysTray *pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
Definition: hotplug.cpp:258
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4899
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwServicesEnabled
Definition: csystray.h:31
HRESULT STDMETHODCALLTYPE Hotplug_Shutdown(_In_ CSysTray *pSysTray)
Definition: hotplug.cpp:145
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4120
CSysTray()
Definition: csystray.cpp:23
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define VOLUME_SERVICE_FLAG
Definition: precomp.h:40
LONG HRESULT
Definition: typedefs.h:79
#define _countof(array)
Definition: sndvol32.h:68
#define WM_TIMER
Definition: winuser.h:1732
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:82
#define WM_NCDESTROY
Definition: winuser.h:1674
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:34
#define WINAPI
Definition: msvc.h:6
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned long DWORD
Definition: ntddk_ex.h:95
UINT wm_DESTROYWINDOW
Definition: csystray.h:33
HRESULT ShutdownIcons()
Definition: csystray.cpp:137
ULONG AddRef()
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: csystray.cpp:300
HRESULT STDMETHODCALLTYPE MouseKeys_Update(_In_ CSysTray *pSysTray)
Definition: mouse.cpp:43
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
int ret
#define StringCchCopy
Definition: strsafe.h:139
BOOL WINAPI RegisterShellHookWindow(_In_ HWND)
HRESULT STDMETHODCALLTYPE MouseKeys_Init(_In_ CSysTray *pSysTray)
Definition: mouse.cpp:15
virtual ~CSysTray()
Definition: csystray.cpp:29
CComPtr< IOleCommandTarget > pctNetShell
Definition: csystray.h:27
Definition: inflate.c:139
HRESULT ShutdownNetShell()
Definition: csystray.cpp:108
HRESULT SysTrayMessageLoop()
Definition: csystray.cpp:236
PFNSTUPDATE pfnUpdate
Definition: precomp.h:54
UINT uCallbackMessage
Definition: shellapi.h:229
HRESULT STDMETHODCALLTYPE MouseKeys_Shutdown(_In_ CSysTray *pSysTray)
Definition: mouse.cpp:23
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT SysTrayThreadProc()
Definition: csystray.cpp:253
UINT WINAPI RegisterWindowMessageW(_In_ LPCWSTR)
#define S_OK
Definition: intsafe.h:52
_In_ BOOL bEnable
Definition: winddi.h:3426
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
HICON hIcon
Definition: msconfig.c:44
HRESULT STDMETHODCALLTYPE Hotplug_Update(_In_ CSysTray *pSysTray)
Definition: hotplug.cpp:139
FxAutoRegKey hKey
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT ProcessIconMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
Definition: csystray.cpp:171
HRESULT InitIcons()
Definition: csystray.cpp:119
HRESULT UpdateIcons()
Definition: csystray.cpp:155
HRESULT STDMETHODCALLTYPE Volume_Update(_In_ CSysTray *pSysTray)
Definition: volume.cpp:168
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define GetMessage
Definition: winuser.h:5780
HANDLE hThread
Definition: wizard.c:28
PFNSTMESSAGE pfnMessage
Definition: precomp.h:55
HRESULT STDMETHODCALLTYPE Volume_Init(_In_ CSysTray *pSysTray)
Definition: volume.cpp:137
#define msg(x)
Definition: auth_time.c:54
VOID GetServicesEnabled()
Definition: csystray.cpp:33
#define Shell_NotifyIcon
Definition: shellapi.h:689
#define SendMessage
Definition: winuser.h:5833
#define WM_CREATE
Definition: winuser.h:1598
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:115
HRESULT STDMETHODCALLTYPE Volume_Shutdown(_In_ CSysTray *pSysTray)
Definition: volume.cpp:200
HRESULT STDMETHODCALLTYPE Power_Shutdown(_In_ CSysTray *pSysTray)
Definition: power.cpp:131
BOOL WINAPI DeregisterShellHookWindow(_In_ HWND)
HINSTANCE g_hInstance
Definition: MainWindow.cpp:18
LONG_PTR LRESULT
Definition: windef.h:209
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
Definition: csystray.cpp:294
#define REG_DWORD
Definition: sdbapi.c:596
LPARAM lParam
Definition: combotst.c:139
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define RegCloseKey(hKey)
Definition: registry.h:47
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
PFNSTINIT pfnInit
Definition: precomp.h:52
PFNSTSHUTDOWN pfnShutdown
Definition: precomp.h:53