diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/vmpi/vmpi_service_ui/shell_icon_mgr.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'utils/vmpi/vmpi_service_ui/shell_icon_mgr.h')
| -rw-r--r-- | utils/vmpi/vmpi_service_ui/shell_icon_mgr.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/utils/vmpi/vmpi_service_ui/shell_icon_mgr.h b/utils/vmpi/vmpi_service_ui/shell_icon_mgr.h new file mode 100644 index 0000000..81188d4 --- /dev/null +++ b/utils/vmpi/vmpi_service_ui/shell_icon_mgr.h @@ -0,0 +1,66 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef SHELL_ICON_MGR_H +#define SHELL_ICON_MGR_H +#ifdef _WIN32 +#pragma once +#endif + + +class IShellIconMgrHelper +{ +public: + virtual HINSTANCE GetHInstance() = 0; + virtual int WindowProc( void *hWnd, int uMsg, long wParam, long lParam ) = 0; +}; + +class CShellIconMgr +{ +public: + + CShellIconMgr(); + ~CShellIconMgr(); + + bool Init( + IShellIconMgrHelper *pHelper, + const char *pToolTip, // This must be allocated by the caller and must be valid as + // long as the CShellIconMgr exists. + int iCallbackMessage, + int iIconResourceID ); + + void Term(); + + void ChangeIcon( int iIconResourceID ); + + +private: + + void CreateTrayIcon(); + + LRESULT WindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ); + + static LRESULT CALLBACK StaticWindowProc( + HWND hwnd, // handle to window + UINT uMsg, // message identifier + WPARAM wParam, // first message parameter + LPARAM lParam // second message parameter + ); + + HWND m_hWnd; // Invisible window to get timer and shell icon messages. + ATOM m_hWndClass; + + UINT m_uTaskbarRestart; // This message is sent to us when the taskbar is created. + int m_iCurIconResourceID; + int m_iCallbackMessage; + const char *m_pToolTip; + + IShellIconMgrHelper *m_pHelper; +}; + + +#endif // SHELL_ICON_MGR_H |