Added single instance lock and release error system
This commit is contained in:
parent
c3599ed150
commit
c63fd0ec88
@ -103,6 +103,7 @@ namespace nf {
|
||||
}
|
||||
|
||||
void Application::registerWindowClass() {
|
||||
if (!FindWindow(L"NFClass", NULL)) {
|
||||
m_wclassName = L"NFClass";
|
||||
WNDCLASS wclass = { };
|
||||
wclass.lpszClassName = m_wclassName;
|
||||
@ -112,6 +113,10 @@ namespace nf {
|
||||
wclass.lpfnWndProc = Application::WindowProc;
|
||||
RegisterClass(&wclass);
|
||||
}
|
||||
else {
|
||||
Error("Cannot run two NF applications at once.");
|
||||
}
|
||||
}
|
||||
|
||||
void Application::toggleFullscreen() {
|
||||
DWORD wndStyle = GetWindowLong(m_window, GWL_STYLE);
|
||||
|
@ -28,7 +28,8 @@ DebugBreak();
|
||||
#else
|
||||
#define DEBUGINIT
|
||||
#define Log(x)
|
||||
#define Error(x)
|
||||
#define Error(x) MessageBox(FindWindow(L"NFClass", NULL), toWide(x), L"NF Engine Error", MB_OK | MB_ICONERROR);\
|
||||
std::exit(-1)
|
||||
#endif
|
||||
|
||||
const wchar_t* toWide(const char* in);
|
||||
|
Reference in New Issue
Block a user