⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showdlg.cpp

📁 本压缩软件为《Visual C++6.0基础教程》(黑魔方系列)一书的源代码
💻 CPP
字号:
// ShowDlg.cpp : implementation file
//

#include "stdafx.h"
#include "ScreenFont.h"
#include "ShowDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CShowDlg dialog


CShowDlg::CShowDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CShowDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CShowDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CShowDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CShowDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CShowDlg, CDialog)
	//{{AFX_MSG_MAP(CShowDlg)
	ON_BN_CLICKED(IDOK, OnShow)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CShowDlg message handlers

void CShowDlg::OnShow() 
{
	// TODO: Add your control notification handler code here
	CWindowDC dc(NULL);
	CFont myFont;
	myFont.CreateFont ( 
		  110,                        // nHeight 字体高度
		  40,                         // nWidth  字体宽度
		  0,                         // nEscapement 显示角度
		  0,                         // nOrientation 字体角度
		  FW_NORMAL,                 // nWeight 字体磅值
		  FALSE,                     // bItalic 是否倾斜
		  FALSE,                     // bUnderline 是否斜体
		  0,                         // cStrikeOut 是否加删除线
		 DEFAULT_CHARSET, OUT_DEVICE_PRECIS, 
	CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, 
	DEFAULT_PITCH, "华文新魏");     //定义文字的大小
	CFont* oldFont = dc.SelectObject ( &myFont);
	dc.SetTextColor (RGB (255,105,255));
	dc.SetBkMode ( TRANSPARENT);     //背景模式为透明
    dc.TextOut(200,180,"屏幕上显示文字");
	dc.SelectObject ( oldFont);		

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -