#include <sinstance.h>
Public Member Functions | |
CInstanceChecker () | |
~CInstanceChecker () | |
BOOL | TrackFirstInstanceRunning () |
BOOL | PreviousInstanceRunning () |
HWND | ActivatePreviousInstance () |
Protected Member Functions | |
CString | MakeMMFFilename () |
Protected Attributes | |
CMutex | m_instanceDataMutex |
HANDLE | m_hPrevInstance |
Definition at line 22 of file sinstance.h.
CInstanceChecker::CInstanceChecker | ( | ) |
Definition at line 102 of file sinstance.cpp.
References _INSTANCE_DATA::hInstanceData, instanceData, m_hPrevInstance, and VERIFY.
CInstanceChecker::~CInstanceChecker | ( | ) |
HWND CInstanceChecker::ActivatePreviousInstance | ( | ) |
Activate the Previous Instance of our Application.
Definition at line 184 of file sinstance.cpp.
References FALSE, CWindowInstance::hMainWnd, m_hPrevInstance, m_instanceDataMutex, TRUE, and VERIFY.
Referenced by CMakeStickApp::InitInstance().
CString CInstanceChecker::MakeMMFFilename | ( | ) | [protected] |
Definition at line 169 of file sinstance.cpp.
References ASSERT.
Referenced by PreviousInstanceRunning(), and TrackFirstInstanceRunning().
BOOL CInstanceChecker::PreviousInstanceRunning | ( | ) |
Returns true if a previous instance of the App is running. Call this at the very start of InitInstance().
Definition at line 159 of file sinstance.cpp.
References ASSERT, FALSE, m_hPrevInstance, and MakeMMFFilename().
Referenced by CMakeStickApp::InitInstance(), CMakeStickDlg::OnInitDialog(), and TrackFirstInstanceRunning().
BOOL CInstanceChecker::TrackFirstInstanceRunning | ( | ) |
Track the first instance of our App. Call this after LoadFrame() in InitInstance(). Call PreviousInstanceRunning() first and only call this if it returns false.
Definition at line 126 of file sinstance.cpp.
References ASSERT, HANDLE(), _INSTANCE_DATA::hInstanceData, CWindowInstance::hMainWnd, instanceData, m_hPrevInstance, m_instanceDataMutex, MakeMMFFilename(), PreviousInstanceRunning(), TRUE, and VERIFY.
Referenced by CMakeStickDlg::OnInitDialog().
HANDLE CInstanceChecker::m_hPrevInstance [protected] |
Definition at line 37 of file sinstance.h.
Referenced by ActivatePreviousInstance(), CInstanceChecker(), PreviousInstanceRunning(), TrackFirstInstanceRunning(), and ~CInstanceChecker().
CMutex CInstanceChecker::m_instanceDataMutex [protected] |
Definition at line 36 of file sinstance.h.
Referenced by ActivatePreviousInstance(), and TrackFirstInstanceRunning().