// LinkText.h #if !defined(HEADER_LINK_TEXT_H) #define HEADER_LINK_TEXT_H #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 ///////////////////////////////////////////////////////////////////////////// // CLinkText class CLinkText : public CStatic { public: CLinkText(); virtual ~CLinkText(){} void SetURL(CString strURL); CString GetURL() const{return m_url;} void SetColor(COLORREF colLink,COLORREF colHover = -1); COLORREF GetLinkColor()const{return m_colLink;} COLORREF GetHoverColor()const{return m_colHover;} // ClassWizard は仮想関数のオーバーライドを生成します。 //{{AFX_VIRTUAL(CLinkText) public: virtual BOOL PreTranslateMessage(MSG* pMsg); protected: virtual void PreSubclassWindow(); //}}AFX_VIRTUAL protected: HINSTANCE GotoURL(LPCTSTR url,int swcmd); LONG GetRegKey(HKEY key,LPCTSTR subkey,LPTSTR retdata); void PositionWindow(); protected: BOOL m_bOver; COLORREF m_colLink; COLORREF m_colHover; CString m_url; CFont m_font; CToolTipCtrl m_toolTip; protected: //{{AFX_MSG(CLinkText) afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor); afx_msg void OnMouseMove(UINT nFlags, CPoint point); //}}AFX_MSG afx_msg void OnClicked(){GotoURL(m_url,SW_SHOW);} DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio は前行の直前に追加の宣言を挿入します。 #endif // !defined(HEADER_LINK_TEXT_H)