sinstance.h
来自「决战帝王1.5武神降临对喜爱决战的玩家共享研究用」· C头文件 代码 · 共 56 行
H
56 行
/*
Module : SINSTANCE.H
Purpose: Defines the interface for an MFC wrapper class to do instance checking
Created: PJN / 29-07-1998
Copyright (c) 1998 - 2000 by PJ Naughter.
All rights reserved.
Copyright / Usage Details:
You are allowed to include the source code in any product (commercial, shareware, freeware or otherwise)
when your product is released in binary form. You are allowed to modify the source code in any way you want
except you cannot modify the copyright details at the top of each module. If you want to distribute source
code with your application, then you are only allowed to distribute versions released by the author. This is
to maintain a single distribution point for the source code.
*/
#ifndef __SINSTANCE_H__
#define __SINSTANCE_H__
#ifndef __AFXMT_H__
#include "afxmt.h"
#endif
class CInstanceChecker : public CObject
{
public:
//Constructors / Destructors
CInstanceChecker(const CString& sMutexName);
virtual ~CInstanceChecker();
//General functions
void ActivateChecker();
BOOL TrackFirstInstanceRunning();
BOOL PreviousInstanceRunning();
HWND ActivatePreviousInstance();
protected:
//Virtual methods
virtual CString GetMMFFilename();
virtual HWND GetWindowToTrack();
//Standard non-virtual methods
void ReleaseLock();
//Data
CMutex m_instanceDataMutex;
CMutex m_executeMutex;
CSingleLock* m_pExecuteLock;
};
#endif //__SINSTANCE_H__
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?