📄 aboutdlg.cpp
字号:
// AboutDlg.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "AboutDlg.h"
#include ".\aboutdlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
CAboutDlg::CAboutDlg(CWnd *pParent) : CDialog(CAboutDlg::IDD, pParent)
{
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_WEBPAGE, m_linkTimewave);
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
END_MESSAGE_MAP()
BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// CHyperlink
IMPLEMENT_DYNAMIC(CHyperlink, CWnd)
CHyperlink::CHyperlink()
{
HINSTANCE hInst = AfxGetInstanceHandle();
UINT uiClassStyle = CS_DBLCLKS;
HCURSOR hCursor = ::LoadCursor (hInst, MAKEINTRESOURCE(IDC_HYPERTEXT));
HBRUSH hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
m_strClassName.Format (_T("Hyperlink") );
//(UINT)hInst, uiClassStyle, (UINT)hCursor, (UINT)hbrBackground);
//---------------------------------
// See if the class already exists:
//---------------------------------
WNDCLASS wndcls;
if (::GetClassInfo (hInst, m_strClassName, &wndcls))
{
//-----------------------------------------------
// Already registered, assert everything is good:
//-----------------------------------------------
ASSERT (wndcls.style == uiClassStyle);
}
else
{
//-------------------------------------------
// Otherwise we need to register a new class:
//-------------------------------------------
wndcls.style = uiClassStyle;
wndcls.lpfnWndProc = ::DefWindowProc;
wndcls.cbClsExtra = wndcls.cbWndExtra = 0;
wndcls.hInstance = hInst;
wndcls.hIcon = NULL;
wndcls.hCursor = hCursor;
wndcls.hbrBackground = hbrBackground;
wndcls.lpszMenuName = NULL;
wndcls.lpszClassName = m_strClassName;
if (!AfxRegisterClass (&wndcls))
{
AfxThrowResourceException();
return;
}
}
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT)); // zero out structure
lf.lfHeight = 14; // request a 12-pixel-height font
lf.lfUnderline = TRUE;
strcpy(lf.lfFaceName, "Arial"); // request a face name "Arial"
VERIFY(m_font.CreateFontIndirect(&lf)); // create the font
//LoadCursor();
}
CHyperlink::~CHyperlink()
{
m_font.DeleteObject();
}
BEGIN_MESSAGE_MAP(CHyperlink, CWnd)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
ON_WM_CREATE()
END_MESSAGE_MAP()
// CHyperlink message handlers
void CHyperlink::OnPaint()
{
CPaintDC dc(this); // device context for painting
CString sText;
CRect rect;
GetWindowText(sText);
GetClientRect(rect);
dc.SelectObject(m_font);
dc.SetTextColor(GetSysColor(COLOR_HIGHLIGHT));
dc.SetBkColor(GetSysColor(COLOR_3DFACE));
dc.SetBkMode(OPAQUE);
dc.DrawText(sText, rect, DT_CENTER);
// TODO: Add your message handler code here
// Do not call CWnd::OnPaint() for painting messages
}
void CHyperlink::OnLButtonDown(UINT nFlags, CPoint point)
{
CString sText;
GetWindowText(sText);
ShellExecute(::GetDesktopWindow(), _T("open"), sText, _T(""), NULL, SW_SHOWNORMAL);
CWnd::OnLButtonDown(nFlags, point);
}
BOOL CHyperlink::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
return CWnd::Create(m_strClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
BOOL CHyperlink::CreateEx(DWORD dwExStyle, LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, LPVOID lpParam)
{
// TODO: Add your specialized code here and/or call the base class
return CWnd::CreateEx(dwExStyle, m_strClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, lpParam);
}
int CHyperlink::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -