1 #pragma once 2 3 #define WIN32_NO_STATUS 4 #include <stdarg.h> 5 #include <tchar.h> 6 7 #define COBJMACROS 8 #define WIN32_NO_STATUS 9 #define _INC_WINDOWS 10 #define COM_NO_WINDOWS_H 11 #define NTOS_MODE_USER 12 13 #include <windef.h> 14 #include <winbase.h> 15 #include <winreg.h> 16 #include <winuser.h> 17 #include <wincon.h> 18 #include <ddeml.h> 19 #include <shlguid_undoc.h> 20 #include <shlwapi.h> 21 #include <shlobj.h> 22 #include <shlobj_undoc.h> 23 #include <shlwapi_undoc.h> 24 #include <tchar.h> 25 #include <strsafe.h> 26 #include <atlbase.h> 27 #include <atlcom.h> 28 #include <atlwin.h> 29 #include <undocshell.h> 30 #include <shellutils.h> 31 32 #include <shellapi.h> 33 34 #include <wine/debug.h> 35 #include <wine/unicode.h> 36 37 #include "resource.h" 38 39 extern HINSTANCE g_hInstance; 40 41 #define ID_ICON_VOLUME (WM_APP + 0x4CB) 42 #define ID_ICON_HOTPLUG (WM_APP + 0x4CC) 43 #define ID_ICON_POWER (WM_APP + 0x4CD) 44 45 #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) 46 #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) 47 48 #include "csystray.h" 49 50 typedef HRESULT(STDMETHODCALLTYPE * PFNSTINIT) (_In_ CSysTray * pSysTray); 51 typedef HRESULT(STDMETHODCALLTYPE * PFNSTSHUTDOWN) (_In_ CSysTray * pSysTray); 52 typedef HRESULT(STDMETHODCALLTYPE * PFNSTUPDATE) (_In_ CSysTray * pSysTray); 53 typedef HRESULT(STDMETHODCALLTYPE * PFNSTMESSAGE) (_In_ CSysTray * pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult); 54 55 struct SysTrayIconHandlers_t 56 { 57 PFNSTINIT pfnInit; 58 PFNSTSHUTDOWN pfnShutdown; 59 PFNSTUPDATE pfnUpdate; 60 PFNSTMESSAGE pfnMessage; 61 }; 62 63 extern SysTrayIconHandlers_t g_IconHandlers[]; 64 extern const int g_NumIcons; 65 66 /* --------------- Icon callbacks ------------------------------ */ 67 68 extern HRESULT STDMETHODCALLTYPE Volume_Init(_In_ CSysTray * pSysTray); 69 extern HRESULT STDMETHODCALLTYPE Volume_Shutdown(_In_ CSysTray * pSysTray); 70 extern HRESULT STDMETHODCALLTYPE Volume_Update(_In_ CSysTray * pSysTray); 71 extern HRESULT STDMETHODCALLTYPE Volume_Message(_In_ CSysTray * pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult); 72 73 extern HRESULT STDMETHODCALLTYPE Hotplug_Init(_In_ CSysTray * pSysTray); 74 extern HRESULT STDMETHODCALLTYPE Hotplug_Shutdown(_In_ CSysTray * pSysTray); 75 extern HRESULT STDMETHODCALLTYPE Hotplug_Update(_In_ CSysTray * pSysTray); 76 extern HRESULT STDMETHODCALLTYPE Hotplug_Message(_In_ CSysTray * pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult); 77 78 extern HRESULT STDMETHODCALLTYPE Power_Init(_In_ CSysTray * pSysTray); 79 extern HRESULT STDMETHODCALLTYPE Power_Shutdown(_In_ CSysTray * pSysTray); 80 extern HRESULT STDMETHODCALLTYPE Power_Update(_In_ CSysTray * pSysTray); 81 extern HRESULT STDMETHODCALLTYPE Power_Message(_In_ CSysTray * pSysTray, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult); 82 83 #define POWER_TIMER_ID 2 84 #define VOLUME_TIMER_ID 3 85 #define HOTPLUG_TIMER_ID 4