【VC开源代码栏目提醒】:网学会员鉴于大家对VC开源代码十分关注,论文会员在此为大家搜集整理了“West.cpp”一文,供大家参考学习
// West.cpp : Defines the class behaviors for the application.
//
//
// 大话西游经典系列
// 功能:透明动态位图显示及WAV资源播放
#include "stdafx.h"
#include "West.h"
#include "WestDlg.h"
#include "TransparentWnd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWest
BEGIN_MESSAGE_MAP(CWest, CWinApp)
//{{AFX_MSG_MAP(CWest)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWest construction
CWest::CWest()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CWest object
CWest theApp;
/////////////////////////////////////////////////////////////////////////////
// CWest initialization
BOOL CWest::InitInstance()
{
srand(time(NULL));
//一次只运行一个
程序实例,如果已运行则退出
if( FindWindow(NULL,"大话西游经典系列之--情感天地")) exit(0);
TransparentWnd* pFrame = new TransparentWnd;
m_pMainWnd = pFrame;
// create and load the frame with its resources
CRect rect(0, 0, 100, 100);
pFrame->CreateTransparent("大话西游经典系列之--情感天地", rect);//IDB_MASK, IDB_BACK);
pFrame->CenterWindow(); //初始显示窗体位置
pFrame->ShowWindow(SW_SHOW);
return TRUE;
}