?? mytext.cpp
字號:
// MyText.cpp : implementation file
//
#include "stdafx.h"
#include "計算器.h"
#include "MyText.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyText
CMyText::CMyText()
{
}
CMyText::~CMyText()
{
}
BEGIN_MESSAGE_MAP(CMyText, CStatic)
//{{AFX_MSG_MAP(CMyText)
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
ON_WM_MOUSEMOVE()
ON_WM_SETCURSOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyText message handlers
void CMyText::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
dc.SetBkMode(TRANSPARENT);
dc.TextOut(0,0,"一個模仿Windows計算器的小程序,");
dc.TextOut(0,25,"本程序不用作任何商業用途");
dc.TextOut(0,50,"本產品擁有權屬于");
dc.SetTextColor(0xff0000);
dc.TextOut(125,50,"“風雪工作組”");
dc.SetTextColor(0);
dc.TextOut(55,80,"版權所有,違者必究");
// Do not call CStatic::OnPaint() for painting messages
}
void CMyText::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(point.x>=125 && point.x<=230 && point.y>=50 && point.y<=65)
{
char IE[]="C:\\Program Files\\Internet Explorer\\Iexplore.exe";
char WinDir[128];
GetWindowsDirectory(WinDir,128);
IE[0]=WinDir[0];
ShellExecute(this->m_hWnd,"Open",IE,"http://www.fxstudio.xiloo.com/",NULL,SW_SHOW);
}
CStatic::OnLButtonDown(nFlags, point);
}
void CMyText::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CClientDC pDC(this);
pDC.SetBkMode(TRANSPARENT);
if(point.x>=125 && point.x<=230 && point.y>=50 && point.y<=65)
{
pDC.SetTextColor(0x00ff00);
m_hCursor=AfxGetApp()->LoadCursor(IDC_HAND);
}
else
{
pDC.SetTextColor(0xff0000);
m_hCursor=AfxGetApp()->LoadCursor(IDC_STANDARD);
}
pDC.TextOut(125,50,"“風雪工作組”");
CStatic::OnMouseMove(nFlags, point);
}
BOOL CMyText::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: Add your message handler code here and/or call default
::SetCursor(m_hCursor);
return TRUE;
//return CStatic::OnSetCursor(pWnd,nHitTest,message);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -