📄 光盘安装向导.cpp
字号:
// 光盘安装向导.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "光盘安装向导.h"
#include "光盘安装向导Dlg.h"
#include "XInfoTip.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyApp
BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
//{{AFX_MSG_MAP(CMyApp)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CMyApp construction
CMyApp::CMyApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMyApp object
CMyApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMyApp initialization
BOOL CMyApp::InitInstance()
{
// 创建互斥体对象
HANDLE hMutex=CreateMutex(NULL, FALSE, "Mutex");
// 如果本程序已有实例在运行,则GetLastError()返回ERROR_ALREADY_EXISTS
if(GetLastError()==ERROR_ALREADY_EXISTS)
{
CloseHandle(hMutex); //关闭互斥体对象句柄
//获取桌面窗口的一个子窗口。
HWND hWndPrev=::GetWindow(::GetDesktopWindow(),GW_CHILD);
// 枚举当前窗口,查找本程序已运行的实例
while(::IsWindow(hWndPrev))
{
//判断窗口是否有预先设置的属性"MutexDlg",
//如有,则是要本程序已运行实例的窗口,并将它激活。
if(::GetProp(hWndPrev,"MutexDlg"))
{
//如果主窗口已最小化,则恢复其大小。
if (::IsIconic(hWndPrev))
::ShowWindow(hWndPrev,SW_RESTORE);
//激活应用程序的主窗口
::SetForegroundWindow(hWndPrev);
return FALSE; //退出本实例
}
//继续寻找下一个窗口。
hWndPrev = ::GetWindow(hWndPrev,GW_HWNDNEXT);
}
AfxMessageBox("已有一个实例在运行,但找不到它的主窗口!",MB_OK|MB_ICONINFORMATION,NULL);
return FALSE; //退出本实例
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CMyDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -