VC++学习笔记(四)

MessageBox Button Combination IDs:
MB_ABORTRETRYIGNORE Abort,Retry,Ignore
MB_OK   OK
MB_OKCANCEL  OK,Cancel
MB_RETRYCANCEL  Retry,Cancel
MB_YESNO  Yes,No
MB_YESNOCANCEL  Yes,No,Cancel

MessageBox Icon IDs:
MB_ICONINFORMATION Informational icon
MB_ICONQUESTION  Question mark icon
MB_ICONSTOP  Stop sign icon
MB_ICONEXCLAMATION Exclamation mark icion

MessageBox return value IDs:
IDABORT  Abort
IDRETRY  Retry
IDIGNORE Ignore
IDYES  Yes
IDNO  No
IDOK  OK
IDCANCEL Cancel

Common Dialog Classes:
CFileDialog  File selection
CFontDialog  Font selection
CColorDialog  Color selection
CPageSetupDialog Page setup for printing
CPrintDialog  Printing
CFindReplaceDialog Find and Replace

定制CFileDialog:可以通过对于属性m_ofn的设置,对其进行定制:
typedef struct tagOFN{
DWORD  lStructSize;
HWND  hwndOwner;
HINSTANCE hInstance;
LPCTSTR  lpstrFilter;
LPTSTR  lpstrCustomFilter;
DWORD  nMaxCustFilter;
DWORD  nFIlterIndex;
LPTSTR  lpstrFile;
DWORD  nMaxFile;
LPTSTR  lpstrFileTitle;
DWORD  nMaxFileTitle;
LPCTSTR  lpstrInitialDir;
LPCTSTR  lpstrTitle;
DWORD  Flags;
WORD  nFileOffset;
WORD  nFileExtension;
LPCTSTR  lpstrDefExt;
DWORD  lCustData;
LPOFNHOOKPROC lpfnHook;
LPCTSTR  lpTemplateName;
}OPENFILENAME;

The Pen Class:
CDC dc(this);
CPen lPen(PS_SOLID,1,RGB(0,0,0));
dc.SelectObject(&lPen);

The Brush Class:
CBrush lPatterBrush(HS_BDIAGONAL,RGB(0,0,255));
使用bitmap作为背景
CBitmap m_bmpBitmap;
m_bmpBitmap.LoadBitmap(IDB_MYBITMAP);
CBrush lBitmapBursh(&m_bmpBitmap);

The Bitmap Class:
在程序中添加图片的方法:
1.使用资源文件的id添加
2.使用ActiveX方式显示.
3.使用api
HBITMAP hBitmap=(HBITMAP)::LoadImage(AfxGetInstanceHandle(),m_sFileName,IMAGE_BITMAP,0,0,LR_LOADROMFILE|LR_CREATEIBSECTION);
m_bmpBitmap.Attach(hBitmap);//m_bmpBitmap是CBitmap型

一个DC是CDC类的四个子类:CpaintDC,CClientDC,CWindowDC和CMetaFileDC之一的一个实例.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值