AnimateTray.h
上传用户:cn05999
上传日期:2020-06-29
资源大小:84k
文件大小:2k
- #if !defined(AFX_ANIMATETRAY_H__09778F56_3FD5_4C5C_8E02_43B43AAD19F9__INCLUDED_)
- #define AFX_ANIMATETRAY_H__09778F56_3FD5_4C5C_8E02_43B43AAD19F9__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- // AnimateTray.h : header file
- //
- /////////////////////////////////////////////////////////////////////////////
- // CAnimateTray window
- class CAnimateTray : public CWnd
- {
- // Construction
- public:
- CAnimateTray();
- // Attributes
- public:
- // Operations
- public:
- BOOL CreateTray(/*动画*/CWnd* pNotifyWnd,UINT uID/*menu*/,LPCTSTR pszTooltipText, HICON* phIcons,int nNumIcons,DWORD dwDelay, UINT nNotifyMessage);
- BOOL CreateTray(/*非动画*/CWnd* pNotifyWnd,UINT uID/*menu*/,LPCTSTR pszTooltipText,HICON hIcon,UINT nNotifyMessage);
- protected:
- BOOL m_bCreated;
- CWnd* m_pNotificationWnd;
- BOOL m_bAnimated;
- NOTIFYICONDATA m_NotifyIconData;
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CAnimateTray)
- public:
- virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
- //}}AFX_VIRTUAL
- // Implementation
- public:
- void OnTimer1(UINT nIDEvent);
- BOOL SetIcon(LPCTSTR lpIconName);
- BOOL SetIcon(UINT nIDResourec);
- BOOL SetIcon(HICON hIcon);
- LRESULT OnTrayNotification(WPARAM wID, LPARAM lEvent);
- virtual ~CAnimateTray();
- BOOL m_bIsWindowNormal;
- BOOL m_bMenuOn;
- BOOL m_bHidden;
- HICON* m_phIcons;
- int m_nNumIcons;
- DWORD m_dwDelay;
- UINT m_nTimerID;
- int m_nCurrentIconIndex;
- HICON GetCurrentIcon() const {return m_phIcons[m_nCurrentIconIndex];};
-
- BOOL IsShowing() const {return !IsHidden();};
- BOOL IsHidden() const {return m_bHidden;};
- BOOL UsingAnimatedIcon() const{ return m_bAnimated;};
- // Generated message map functions
- protected:
- void RemoveIcon();
- //{{AFX_MSG(CAnimateTray)
- afx_msg void OnTimer(UINT nIDEvent);
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
- afx_msg void OnDestroy();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_ANIMATETRAY_H__09778F56_3FD5_4C5C_8E02_43B43AAD19F9__INCLUDED_)