?? bmpwnd.cpp
字號:
// BmpWnd.cpp : implementation file
//
#include "stdafx.h"
#include "打字游戲.h"
#include "BmpWnd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern HBITMAP hBitmap[53];
/////////////////////////////////////////////////////////////////////////////
// CBmpWnd
CBmpWnd::CBmpWnd()
{
}
CBmpWnd::~CBmpWnd()
{
}
BEGIN_MESSAGE_MAP(CBmpWnd, CWnd)
//{{AFX_MSG_MAP(CBmpWnd)
ON_WM_ERASEBKGND()
ON_WM_PAINT()
ON_WM_SETFOCUS()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBmpWnd message handlers
BOOL CBmpWnd::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CBrush brush(RGB(0,0,0x66));
CRect rect;
GetClientRect(&rect);
pDC->FillRect(&rect,&brush);
return TRUE;
}
void CBmpWnd::OnPaint()
{
CPaintDC dc(this);
CBitmap bitmap,*oldBmp;
BITMAP bm;
UINT nWindowID=::GetWindowLong(this->m_hWnd,GWL_ID);
bitmap.Attach(hBitmap[nWindowID-IDB_AB]);
bitmap.GetObject(sizeof(BITMAP),&bm);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
oldBmp=dcMem.SelectObject(&bitmap);
dc.BitBlt(0,0,bm.bmWidth,bm.bmHeight,&dcMem,0,0,SRCCOPY);
dcMem.SelectObject(oldBmp);
bitmap.Detach();
}
void CBmpWnd::OnSetFocus(CWnd* pOldWnd)
{
CWnd::OnSetFocus(pOldWnd);
GetParent()->SetFocus();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -