www.pudn.com > CapIT_src.zip > MyTrayIcon.h


#if !defined(AFX_MYTRAYICON_H__0E474F41_F007_11D6_A702_C99C0CE4946C__INCLUDED_) 
#define AFX_MYTRAYICON_H__0E474F41_F007_11D6_A702_C99C0CE4946C__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
// MyTrayIcon.h : header file 
// 
 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CMyTrayIcon command target 
 
class CMyTrayIcon : public CCmdTarget 
{ 
	DECLARE_DYNCREATE(CMyTrayIcon) 
 
	CMyTrayIcon();           // protected constructor used by dynamic creation 
	NOTIFYICONDATA m_nid;			// struct for Shell_NotifyIcon args 
 
// Attributes 
public: 
    ~CMyTrayIcon(); 
 
// Operations 
public: 
	// Call this to receive tray notifications 
	void SetNotificationWnd(CWnd* pNotifyWnd, UINT uCbMsg); 
 
	// SetIcon functions. To remove icon, call SetIcon(0) 
	// 
	BOOL SetIcon(UINT uID); // main variant you want to use 
	BOOL SetIcon(HICON hicon, LPCSTR lpTip); 
	BOOL SetIcon(LPCTSTR lpResName, LPCSTR lpTip) 
		{ return SetIcon(lpResName ?  
			AfxGetApp()->LoadIcon(lpResName) : NULL, lpTip); } 
	BOOL SetStandardIcon(LPCTSTR lpszIconName, LPCSTR lpTip) 
		{ return SetIcon(::LoadIcon(NULL, lpszIconName), lpTip); } 
 
	virtual LRESULT OnTrayNotification(WPARAM uID, LPARAM lEvent); 
 
// Overrides 
	// ClassWizard generated virtual function overrides 
	//{{AFX_VIRTUAL(CMyTrayIcon) 
	//}}AFX_VIRTUAL 
 
// Implementation 
protected: 
//	virtual ~CMyTrayIcon(); 
 
	// Generated message map functions 
	//{{AFX_MSG(CMyTrayIcon) 
		// NOTE - the ClassWizard will add and remove member functions here. 
	//}}AFX_MSG 
 
	DECLARE_MESSAGE_MAP() 
}; 
 
///////////////////////////////////////////////////////////////////////////// 
 
//{{AFX_INSERT_LOCATION}} 
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. 
 
#endif // !defined(AFX_MYTRAYICON_H__0E474F41_F007_11D6_A702_C99C0CE4946C__INCLUDED_)