Overview of SysLink Controls The SysLink control provides a convenient way to embed hypertext links in a window. A SysLink control is a window that renders ed-up text and launches appropriate applications when the user clicks an embedded link. The control enables you to specify link attributes, such as the URL, through up in the initialization string or by sending LM_SETITEM messages. Multiple links are supported within one control. These links can be accessed by a zero-based index. The SysLink control is defined in the ComCtl32.dll version 6 and requires a manifest that specifies that version 6 of the dynamic-link library (DLL) should be used if it is available. See Using Windows XP Visual Styles for examples of how to create and use manifests.
class CHyperLink : public CStatic
{
public:
CHyperLink();
virtual ~CHyperLink();
void SetURL(CString strURL);
CString GetURL() const;
void SetColors(COLORREF crLinkColor, COLORREF crVisitedColor,
COLORREF crHoverColor = -1);
COLORREF GetLinkColor() const;
COLORREF GetVisitedColor() const;
COLORREF GetHoverColor() const;
void SetVisited(BOOL bVisited = TRUE);
BOOL GetVisited() const;
void SetLinkCursor(HCURSOR hCursor);
HCURSOR GetLinkCursor() const;
void SetUnderline(BOOL bUnderline = TRUE);
BOOL GetUnderline() const;
void SetAutoSize(BOOL bAutoSize = TRUE);
BOOL GetAutoSize() const; // ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CHyperLink)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL// Implementation
protected:
HINSTANCE GotoURL(LPCTSTR url, int showcmd);
void ReportError(int nError);
LONG GetRegKey(HKEY key, LPCTSTR subkey, LPTSTR retdata);
void PositionWindow();
void SetDefaultCursor();// Protected attributes
protected:
COLORREF m_crLinkColor, m_crVisitedColor; // Hyperlink Colors
COLORREF m_crHoverColor; // Hover Color
BOOL m_bOverControl; // cursor over control?
BOOL m_bVisited; // Has it been visited?
BOOL m_bUnderline; // underline hyperlink?
BOOL m_bAdjustToFit; // Adjust window size to fit text?
CString m_strURL; // hyperlink URL
CFont m_Font; // Underline font if necessary
HCURSOR m_hLinkCursor; // Cursor for hyperlink
CToolTipCtrl m_ToolTip; // The tooltip // Generated message map functions
protected:
//{{AFX_MSG(CHyperLink)
afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDestroy();
//}}AFX_MSG
afx_msg void OnClicked();
DECLARE_MESSAGE_MAP()
};
http://www.vckbase.com/document/viewdoc/?id=904
在里边这个示例中有。