ReactOS  0.4.14-dev-833-g5f692ed
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 
33 
39 
44 
47 
49 
50 public:
51  HRESULT NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip, DWORD dwstate = 0);
52 
53  HWND GetHWnd() { return m_hWnd; }
54 
55  VOID EnableService(DWORD dwServiceFlag, BOOL bEnable);
56  BOOL IsServiceEnabled(DWORD dwServiceFlag);
57 
58 protected:
59  BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID = 0);
60 
61 public:
62  CSysTray();
63  virtual ~CSysTray();
64 
65  // *** IOleCommandTarget methods ***
66  virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText);
67  virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
68 
70 
74 
76  COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
77  END_COM_MAP()
78 
79 };
static DWORD WINAPI s_SysTrayThreadProc(PVOID param)
Definition: csystray.cpp:219
HWND hwndSysTray
Definition: csystray.h:32
#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:90
#define WS_EX_LTRREADING
Definition: winuser.h:393
HRESULT CreateSysTrayThread()
Definition: csystray.cpp:259
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:1876
HWND hWnd
Definition: settings.c:17
#define WS_DLGFRAME
Definition: pedump.c:626
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:611
BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID=0)
Definition: csystray.cpp:299
UINT_PTR WPARAM
Definition: windef.h:207
#define IDR_SYSTRAY
Definition: resource.h:59
#define WS_CLIPCHILDREN
Definition: pedump.c:619
int32_t INT
Definition: typedefs.h:56
WPARAM wParam
Definition: combotst.c:138
VOID EnableService(DWORD dwServiceFlag, BOOL bEnable)
Definition: csystray.cpp:55
HRESULT DestroySysTrayWindow()
Definition: csystray.cpp:270
struct IOleCommandTarget::_tagOLECMDTEXT OLECMDTEXT
#define COLOR_3DFACE
Definition: winuser.h:919
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL IsServiceEnabled(DWORD dwServiceFlag)
Definition: csystray.cpp:85
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:196
#define BEGIN_COM_MAP(x)
Definition: atlcom.h:541
#define _T(x)
Definition: vfdio.h:22
DWORD dwServicesEnabled
Definition: csystray.h:31
CSysTray()
Definition: csystray.cpp:22
LONG HRESULT
Definition: typedefs.h:77
#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
HRESULT ShutdownIcons()
Definition: csystray.cpp:128
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
Definition: csystray.cpp:284
virtual ~CSysTray()
Definition: csystray.cpp:23
CComPtr< IOleCommandTarget > pctNetShell
Definition: csystray.h:27
#define DECLARE_REGISTRY_RESOURCEID(x)
Definition: atlcom.h:605
HRESULT ShutdownNetShell()
Definition: csystray.cpp:101
HRESULT SysTrayMessageLoop()
Definition: csystray.cpp:225
#define WS_EX_RIGHTSCROLLBAR
Definition: winuser.h:401
HRESULT SysTrayThreadProc()
Definition: csystray.cpp:242
_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:160
HRESULT InitIcons()
Definition: csystray.cpp:112
#define COM_INTERFACE_ENTRY_IID(iid, x)
Definition: atlcom.h:561
HRESULT UpdateIcons()
Definition: csystray.cpp:144
#define WS_POPUP
Definition: pedump.c:616
HWND GetHWnd()
Definition: csystray.h:53
unsigned int UINT
Definition: ndis.h:50
#define DECLARE_PROTECT_FINAL_CONSTRUCT()
Definition: atlcom.h:639
VOID GetServicesEnabled()
Definition: csystray.cpp:25
unsigned int ULONG
Definition: retypes.h:1
#define END_COM_MAP()
Definition: atlcom.h:552
LONG_PTR LRESULT
Definition: windef.h:209
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
Definition: csystray.cpp:278
LPARAM lParam
Definition: combotst.c:139