VC++学习笔记(四)

王朝厨房·作者佚名  2007-01-04
窄屏简体版  字體: |||超大  

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之一的一个实例.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航