00001
00002
00003
00004
00005
00006 #include "stdafx.h"
00007 #include "UrlWnd.h"
00008 #include "resource.h"
00009
00010 #ifdef _DEBUG
00011 #define new DEBUG_NEW
00012 #undef THIS_FILE
00013 static char THIS_FILE[] = __FILE__;
00014 #endif
00015
00016 CUrlWnd::CUrlWnd()
00017 {
00018 }
00019
00020 CUrlWnd::~CUrlWnd()
00021 {
00022 }
00023
00024 BEGIN_MESSAGE_MAP(CUrlWnd, CStatic)
00025
00026 ON_WM_LBUTTONDOWN()
00027
00028 END_MESSAGE_MAP()
00029
00030 void CUrlWnd::Init()
00031 {
00032 SetClassLong (m_hWnd, GCL_HCURSOR, (LONG)LoadCursor (AfxGetInstanceHandle (), MAKEINTRESOURCE (IDC_HAND_)));
00033 GetWindowText (m_strUrl);
00034 }
00035
00036 void CUrlWnd::OnLButtonDown(UINT , CPoint )
00037 {
00038 if (strnicmp (m_strUrl, "mailto:", 7))
00039 fsOpenUrlInBrowser (m_strUrl);
00040 else
00041 ShellExecute (::GetDesktopWindow (), "open", m_strUrl, NULL, NULL, SW_SHOW);
00042 }
00043
00044 void CUrlWnd::SetUrl(LPCSTR pszUrl)
00045 {
00046 m_strUrl = pszUrl;
00047 }