2014-07-30 22:08:05 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS system libraries
|
|
|
|
* LICENSE: GPL - See COPYING in the top level directory
|
2015-09-27 18:40:24 +00:00
|
|
|
* FILE: dll/shellext/stobject/csystray.h
|
2014-07-30 22:08:05 +00:00
|
|
|
* PURPOSE: Systray shell service object
|
|
|
|
* PROGRAMMERS: Robert Naumann
|
2017-03-23 19:51:53 +00:00
|
|
|
* David Quintana <gigaherz@gmail.com>
|
2017-10-16 14:11:10 +00:00
|
|
|
* Shriraj Sawant a.k.a SR13 <sr.official@hotmail.com>
|
2014-07-30 22:08:05 +00:00
|
|
|
*/
|
2017-12-08 22:15:31 +00:00
|
|
|
|
2014-07-30 22:08:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
extern const GUID CLSID_SysTray;
|
|
|
|
|
|
|
|
|
|
|
|
typedef CWinTraits <
|
|
|
|
WS_POPUP | WS_DLGFRAME | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
|
|
|
|
WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_PALETTEWINDOW
|
|
|
|
> CMessageWndClass;
|
|
|
|
|
|
|
|
class CSysTray :
|
|
|
|
public CComCoClass<CSysTray, &CLSID_SysTray>,
|
|
|
|
public CComObjectRootEx<CComMultiThreadModelNoCS>,
|
|
|
|
public CWindowImpl<CSysTray, CWindow, CMessageWndClass>,
|
|
|
|
public IOleCommandTarget
|
|
|
|
{
|
2014-12-20 16:12:35 +00:00
|
|
|
CComPtr<IOleCommandTarget> pctNetShell;
|
|
|
|
|
2014-07-30 22:08:05 +00:00
|
|
|
// TODO: keep icon handlers here
|
|
|
|
|
2019-04-22 22:12:23 +00:00
|
|
|
DWORD dwServicesEnabled;
|
2022-06-18 19:24:41 +00:00
|
|
|
UINT wm_SHELLHOOK;
|
2022-06-18 19:19:42 +00:00
|
|
|
UINT wm_DESTROYWINDOW;
|
2014-07-30 22:08:05 +00:00
|
|
|
|
|
|
|
static DWORD WINAPI s_SysTrayThreadProc(PVOID param);
|
|
|
|
HRESULT SysTrayMessageLoop();
|
|
|
|
HRESULT SysTrayThreadProc();
|
|
|
|
HRESULT CreateSysTrayThread();
|
|
|
|
HRESULT DestroySysTrayWindow();
|
|
|
|
|
|
|
|
HRESULT InitIcons();
|
|
|
|
HRESULT ShutdownIcons();
|
|
|
|
HRESULT UpdateIcons();
|
2017-03-23 19:51:53 +00:00
|
|
|
HRESULT ProcessIconMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult);
|
2014-07-30 22:08:05 +00:00
|
|
|
|
2014-12-20 16:12:35 +00:00
|
|
|
HRESULT InitNetShell();
|
|
|
|
HRESULT ShutdownNetShell();
|
|
|
|
|
2019-04-22 22:12:23 +00:00
|
|
|
VOID GetServicesEnabled();
|
|
|
|
|
2014-07-30 22:08:05 +00:00
|
|
|
public:
|
2017-10-16 14:11:10 +00:00
|
|
|
HRESULT NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip, DWORD dwstate = 0);
|
2014-07-30 22:08:05 +00:00
|
|
|
|
|
|
|
HWND GetHWnd() { return m_hWnd; }
|
|
|
|
|
2019-04-22 22:12:23 +00:00
|
|
|
VOID EnableService(DWORD dwServiceFlag, BOOL bEnable);
|
|
|
|
BOOL IsServiceEnabled(DWORD dwServiceFlag);
|
|
|
|
|
2014-07-30 22:08:05 +00:00
|
|
|
protected:
|
|
|
|
BOOL ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID = 0);
|
|
|
|
|
|
|
|
public:
|
|
|
|
CSysTray();
|
|
|
|
virtual ~CSysTray();
|
|
|
|
|
|
|
|
// *** IOleCommandTarget methods ***
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText);
|
|
|
|
virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
|
|
|
|
|
|
|
|
DECLARE_WND_CLASS_EX(_T("SystemTray_Main"), CS_GLOBALCLASS, COLOR_3DFACE)
|
|
|
|
|
|
|
|
DECLARE_REGISTRY_RESOURCEID(IDR_SYSTRAY)
|
|
|
|
DECLARE_NOT_AGGREGATABLE(CSysTray)
|
|
|
|
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
|
|
|
|
|
|
|
BEGIN_COM_MAP(CSysTray)
|
|
|
|
COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
|
|
|
|
END_COM_MAP()
|
|
|
|
|
2022-06-18 19:19:42 +00:00
|
|
|
};
|