home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 13
/
mediashare_13.zip
/
mediashare_13
/
ZIPPED
/
PROGRAM
/
WTJ9403.ZIP
/
WILDASS
/
SOURCE
/
INTRODLG.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-07-27
|
2KB
|
82 lines
// introdlg.cpp
//
// class behaviour of the intro dialog
//
// update: 1.00 27-Jul-93 tw
#include <afxwin.h>
#include <afxext.h>
#include <ctl3d.h>
#include "resource.h"
#include "introdlg.h"
BEGIN_MESSAGE_MAP( CIntroDialog, CDialog )
ON_WM_PAINT()
ON_WM_SYSCOLORCHANGE()
END_MESSAGE_MAP()
CIntroDialog::CIntroDialog()
{
VERIFY( Create( IDD_INTRO ));
AfxGetApp()->DoWaitCursor( 1 );
}
CIntroDialog::~CIntroDialog()
{
AfxGetApp()->DoWaitCursor( 0 );
}
BOOL
CIntroDialog::OnInitDialog()
{
// general intialization
CDialog::OnInitDialog();
// center the intro window to the desktop
CenterWindow();
// load the bitmap for the intro dialog
m_bmIntro.LoadBitmap( IDB_INTRO );
return TRUE;
}
void
CIntroDialog::OnPaint()
{
CPaintDC dc( this );
CDC dcMemory;
VERIFY( dcMemory.CreateCompatibleDC( &dc ));
VERIFY( dcMemory.SelectObject( &m_bmIntro ));
// get the place to BitBlit to
CWnd * pWnd = GetDlgItem( IDC_POSBITMAP );
CRect rectWnd;
pWnd->GetWindowRect( rectWnd );
// center the bitmap to the frame.
// the bitmap is 48 pixels in size ...
int cxOffset = (rectWnd.Width()-48) / 2;
int cyOffset = (rectWnd.Height()-48) / 2;
rectWnd.OffsetRect( CPoint( cxOffset, cyOffset ));
ScreenToClient( rectWnd );
// put the bitmap onto the dialog
VERIFY( dc.BitBlt( rectWnd.left, rectWnd.top,
rectWnd.Width(), rectWnd.Height(),
&dcMemory, 0, 0, SRCCOPY ));
}
void
CIntroDialog::OnSysColorChange()
{
// ctl3d business ...
Ctl3dColorChange();
}