22 m_bMsgHandled = FALSE;
44 CWindowImpl<CHyperlinkImage, CStatic>::SubclassWindow(hWnd);
45 ModifyStyle(0, SS_NOTIFY);
73 m_strURL = url.c_str();
86 return((LPCTSTR)m_strURL);
101 m_strMenuText = text.c_str();
114 return((LPCTSTR)m_strMenuText);
123 void CHyperlinkImage::OnContextMenu(CWindow wnd, CPoint point)
127 CMenuHandle pContextMenu = menu.GetSubMenu(0);
138 TrackPopupMenu(pContextMenu.m_hMenu, TPM_LEFTALIGN, pt.x, pt.y, 0, m_hWnd, 0);
142 void CHyperlinkImage::OnRButtonDown(UINT nFlags, CPoint point)
144 OnContextMenu(m_hWnd, point);
147 LRESULT CHyperlinkImage::OnLink(WORD , WORD , HWND , BOOL& bHandled)
150 if ( ! m_strURL.IsEmpty())
151 ::ShellExecute( m_hWnd, _T(
"open"), m_strURL, NULL, NULL, SW_SHOWNORMAL );
CHyperlinkImage() noexcept
void SubclassStatic(HWND hWnd)
Subclass a Static TExt control window.
#define IDR_HYPERLINKIMAGE_POPUP
virtual ~CHyperlinkImage()
void SetURL(std::basic_string< TCHAR > url)
Load a new target URL
void SetMenuText(std::basic_string< TCHAR > text)
Load text to be displayed in the context menu item.
std::basic_string< TCHAR > GetURL() const
Default: "".
#define IDM_HYPERLINKIMAGE_LINK
void UnSubclassStatic()
Un-subclass the window.
std::basic_string< TCHAR > GetMenuText() const
Default: "".