You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.5 KiB
67 lines
1.5 KiB
5 years ago
|
//========= 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
|