ReactOS  0.4.15-dev-5496-g599ba9c
csystray.h
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.h
5  * PURPOSE: Systray shell service object
6  * PROGRAMMERS: Robert Naumann
7  * David Quintana <gigaherz@gmail.com>
8  * Shriraj Sawant a.k.a SR13 <sr.official@hotmail.com>
9  */
10 
11 #pragma once
12 
13 extern const GUID CLSID_SysTray;
14 
15 
16 typedef CWinTraits <
20 
21 class CSysTray :
22  public CComCoClass<CSysTray, &CLSID_SysTray>,
23  public CComObjectRootEx<CComMultiThreadModelNoCS>,
24  public CWindowImpl<CSysTray, CWindow, CMessageWndClass>,
25  public IOleCommandTarget
26 {
27  CComPtr<IOleCommandTarget> pctNetShell;
28 
29  // TODO: keep icon handlers here
30 
34 
40 
45 
48 
50 
51 public:
52  HRESULT NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip, DWORD dwstate = 0);
53 
54  HWND GetHWnd() { return m_hWnd; }
55 
56  VOID EnableService(DWORD dwServiceFlag, BOOL bEnable);
57  BOOL IsServiceEnabled(DWORD dwServiceFlag);
58 
59 protected:
60  BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID = 0);
61 
62 public:
63  CSysTray();
64  virtual ~CSysTray();
65 
66  // *** IOleCommandTarget methods ***
67  virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText);
68  virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
69 
71 
75 
77  COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
78  END_COM_MAP()
79 
80 };
static DWORD WINAPI s_SysTrayThreadProc(PVOID param)
Definition: csystray.cpp:230
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
static HICON
Definition: imagelist.c:84
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HRESULT InitNetShell()
Definition: csystray.cpp:97
#define WS_EX_LTRREADING
Definition: winuser.h:393
HRESULT CreateSysTrayThread()
Definition: csystray.cpp:271
struct IOleCommandTarget::_tagOLECMD OLECMD
#define WS_EX_PALETTEWINDOW
Definition: winuser.h:399
const GUID CLSID_SysTray
#define DECLARE_WND_CLASS_EX(WndClassName, style, bkgnd)
Definition: atlwin.h:1998
HWND hWnd
Definition: settings.c:17
#define WS_DLGFRAME
Definition: pedump.c:626
UINT wm_SHELLHOOK
Definition: csystray.h:32
CWinTraits< WS_POPUP|WS_DLGFRAME|WS_CLIPCHILDREN|WS_CLIPSIBLINGS, WS_EX_LEFT|WS_EX_LTRREADING|WS_EX_RIGHTSCROLLBAR|WS_EX_PALETTEWINDOW > CMessageWndClass
Definition: csystray.h:19
#define DECLARE_NOT_AGGREGATABLE(x)
Definition: atlcom.h:612
BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID=0)
Definition: csystray.cpp:315
UINT_PTR WPARAM
Definition: windef.h:207
#define IDR_SYSTRAY
Definition: resource.h:71
#define WS_CLIPCHILDREN
Definition: pedump.c:619
int32_t INT
Definition: typedefs.h:58
WPARAM wParam
Definition: combotst.c:138
VOID EnableService(DWORD dwServiceFlag, BOOL bEnable)
Definition: csystray.cpp:62
HRESULT DestroySysTrayWindow()
Definition: csystray.cpp:283
struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
#define COLOR_3DFACE
Definition: winuser.h:923
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL IsServiceEnabled(DWORD dwServiceFlag)
Definition: csystray.cpp:92
LONG_PTR LPARAM
Definition: windef.h:208
#define WS_EX_LEFT
Definition: winuser.h:391
HRESULT NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip, DWORD dwstate=0)
Definition: csystray.cpp:207
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:542
#define _T(x)
Definition: vfdio.h:22
DWORD dwServicesEnabled
Definition: csystray.h:31
CSysTray()
Definition: csystray.cpp:23
LONG HRESULT
Definition: typedefs.h:79
#define CS_GLOBALCLASS
Definition: winuser.h:647
GLfloat param
Definition: glext.h:5796
#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
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: csystray.cpp:300
virtual ~CSysTray()
Definition: csystray.cpp:29
CComPtr< IOleCommandTarget > pctNetShell
Definition: csystray.h:27
Definition: inflate.c:139
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:606
HRESULT ShutdownNetShell()
Definition: csystray.cpp:108
HRESULT SysTrayMessageLoop()
Definition: csystray.cpp:236
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
HRESULT SysTrayThreadProc()
Definition: csystray.cpp:253
_In_ BOOL bEnable
Definition: winddi.h:3426
HICON hIcon
Definition: msconfig.c:44
HRESULT ProcessIconMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult)
Definition: csystray.cpp:171
HRESULT InitIcons()
Definition: csystray.cpp:119
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:562
HRESULT UpdateIcons()
Definition: csystray.cpp:155
#define WS_POPUP
Definition: pedump.c:616
HWND GetHWnd()
Definition: csystray.h:54
unsigned int UINT
Definition: ndis.h:50
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:640
VOID GetServicesEnabled()
Definition: csystray.cpp:33
unsigned int ULONG
Definition: retypes.h:1
#define END_COM_MAP()
Definition: atlcom.h:553
LONG_PTR LRESULT
Definition: windef.h:209
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
Definition: csystray.cpp:294
LPARAM lParam
Definition: combotst.c:139