www.pudn.com > PtGame.rar > LookDlg.cpp


// LookDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "PtGame.h" 
#include "LookDlg.h" 
#include "PtGameDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CLookDlg dialog 
 
 
CLookDlg::CLookDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(CLookDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(CLookDlg) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
} 
 
 
void CLookDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CLookDlg) 
		// NOTE: the ClassWizard will add DDX and DDV calls here 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CLookDlg, CDialog) 
	//{{AFX_MSG_MAP(CLookDlg) 
	ON_COMMAND(IDM_EXITLOOK, OnExitlook) 
	ON_WM_PAINT() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CLookDlg message handlers 
 
void CLookDlg::OnExitlook()  
{ 
	// TODO: Add your command handler code here 
	CDialog::EndDialog(0); 
	 
} 
 
void CLookDlg::OnPaint()  
{ 
	//CPaintDC dc(this); // device context for painting 
	// TODO: Add your message handler code here 
	CDC *pDC=GetDC(); 
	CDC memdc; 
	memdc.CreateCompatibleDC(pDC); 
	memdc.SelectObject(lookbitmap); 
	pDC->BitBlt(0,0,500,350,&memdc,0,0,SRCCOPY); 
	// Do not call CDialog::OnPaint() for painting messages 
} 
 
BOOL CLookDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	// TODO: Add extra initialization here 
	picID=AfxGetApp()->GetProfileInt(_T("ÓÎÏ·²ÎÊý"),_T("gamepicture"),IDB_BITMAP3); 
	lookbitmap.LoadBitmap(picID); 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
}