体育信息管理系统
源代码在线查看: p.cpp
// P.cpp : implementation file
//
#include "stdafx.h"
#include "ooo.h"
#include "P.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CP
CP::CP()
{
}
CP::~CP()
{m_bmp.DeleteObject();
}
BEGIN_MESSAGE_MAP(CP, CWnd)
//{{AFX_MSG_MAP(CP)
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CP message handlers
BOOL CP::Create(UINT AA)
{ m_bmp.LoadBitmap(AA);
BITMAP bmp;
GetObject(m_bmp.GetSafeHandle(), sizeof(BITMAP), &bmp);
CString strClass = AfxRegisterWndClass(NULL);
if(strClass.GetLength() == 0) return FALSE;
int nScreenWidth = GetSystemMetrics(SM_CXFULLSCREEN);
int nScreenHeight = GetSystemMetrics(SM_CYFULLSCREEN);
if(CWnd::CreateEx(0, strClass, TEXT(""),
WS_VISIBLE | WS_POPUP,
(nScreenWidth - bmp.bmWidth) / 2, (nScreenHeight - bmp.bmHeight) / 2,
bmp.bmWidth, bmp.bmHeight,
NULL, NULL) == FALSE) return FALSE;
ShowWindow(SW_SHOW);
UpdateWindow();
SetWindowPos(&CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
return TRUE;
}
void CP::OnPaint()
{
CPaintDC dc(this); // device context for painting
CDC memDC;
memDC.CreateCompatibleDC(&dc);
CBitmap* poldBitmap = memDC.SelectObject(&m_bmp);
CRect rc;
GetClientRect(rc);
dc.BitBlt(0, 0, rc.Width(), rc.Height(), &memDC, 0, 0, SRCCOPY);
memDC.SelectObject(poldBitmap);
}