StartForm.cpp
资源名称:CAD2006.rar [点击查看]
上传用户:ckg1000
上传日期:2013-01-26
资源大小:630k
文件大小:1k
源码类别:
CAD
开发平台:
Visual C++
- // StartForm.cpp : implementation file
- //
- #include "stdafx.h"
- #include "CAD2006.h"
- #include "StartForm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CStartForm
- IMPLEMENT_DYNCREATE(CStartForm, CWnd)
- CStartForm::CStartForm()
- {
- }
- CStartForm::~CStartForm()
- {
- }
- BEGIN_MESSAGE_MAP(CStartForm, CWnd)
- //{{AFX_MSG_MAP(CStartForm)
- ON_WM_PAINT()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CStartForm message handlers
- void CStartForm::Create(UINT nID)
- {
- m_wndBitmap.LoadBitmap(nID);
- m_wndBitmap.GetBitmap(&Bitmap);
- int x = (::GetSystemMetrics(SM_CXSCREEN) - Bitmap.bmHeight)/ 2 -60;
- int y = (::GetSystemMetrics(SM_CYSCREEN) - Bitmap.bmWidth)/ 2 +60;
- CRect rect(x,y,x + Bitmap.bmWidth,y + Bitmap.bmHeight);
- CreateEx(0,::AfxRegisterWndClass(0),"",WS_BORDER | WS_POPUP | WS_VISIBLE,rect,NULL,NULL);
- }
- void CStartForm::OnPaint()
- {
- CPaintDC dc(this); // device context for painting
- CDC pCDC;
- pCDC.CreateCompatibleDC(&dc);
- pCDC.SelectObject(&m_wndBitmap);
- dc.BitBlt(0,0,Bitmap.bmWidth,Bitmap.bmHeight,&pCDC,0,0,SRCCOPY);
- // TODO: Add your message handler code here
- // Do not call CWnd::OnPaint() for painting messages
- }