//MsgWnd.h #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef MsgWndh #define MsgWndh class CMsgWnd : public CWnd { public: CMsgWnd(); virtual ~CMsgWnd() {} BOOL Create(CPoint pt, CWnd* pParentWnd, UINT nID=0); void SetCursor(int nID) {Cursor=::LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(nID));} void SetAVI (int nID) {AC.Open(nID);} void Show(CString Msg) {SetWindowText(Msg); ShowDelayed(0 );} void ShowDelayed(CString Msg, UINT msec=100) {SetWindowText(Msg); ShowDelayed(msec);} void Show() {ShowDelayed(0);} void ShowDelayed(UINT msec=100); //Call from OnNotify to see if I was clicked: bool Clicked(LPARAM lParam) {return ((((NMHDR*)lParam)->code==NM_CLICK) && (((NMHDR*)lParam)->hwndFrom==m_hWnd));} void Cancel(); protected: HCURSOR Cursor; CAnimateCtrl AC; CFont Font; CFont UFont; // Underlined Font virtual void PostNcDestroy() {/*Don't delete this*/} // CMsgWnd is intended to be used on the stack, not heap, so don't auto-delete. virtual BOOL PreCreateWindow(CREATESTRUCT& cs); // Generated message map functions //{{AFX_MSG(CMsgWnd) afx_msg void OnPaint(); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP() DECLARE_DYNAMIC(CMsgWnd); private: bool LButtonDown; // Keeps track of the mouse for Click Messages. bool MouseOver; // true if the mouse is over the window. UINT ShowTime; // Milliseconds the window is shown stationary CRect Rect; // Current window in screen coordinates CSize Size; // Size when fully drawn char UDLR; // Direction to scroll ('U'=Up 'D'=Down 'L'=Left 'R'=Right) }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif //ndef MsgWndh