Skip to content

Commit

Permalink
Prevent double instances
Browse files Browse the repository at this point in the history
  • Loading branch information
CasEbb committed Jan 29, 2018
1 parent 93e6d01 commit 63c5951
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions code/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ UINT juliana_run()

int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{
CreateMutex(NULL, FALSE, APPLICATION_NAME);
if (ERROR_ALREADY_EXISTS == GetLastError()) {
MessageBox(
NULL,
APPLICATION_NAME L" is al gestart.",
APPLICATION_NAME,
MB_OK | MB_ICONERROR
);
return 0;
}

juliana_init(hInstance);

nfc_init();
Expand Down
8 changes: 7 additions & 1 deletion misc/msvc/JulianaNFC.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27004.2006
VisualStudioVersion = 15.0.27004.2008
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JulianaNFC", "JulianaNFC.vcxproj", "{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
DefaultBuild|x64 = DefaultBuild|x64
DefaultBuild|x86 = DefaultBuild|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
Expand All @@ -17,6 +19,10 @@ Global
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.Debug|x64.Build.0 = Debug|x64
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.Debug|x86.ActiveCfg = Debug|Win32
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.Debug|x86.Build.0 = Debug|Win32
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.DefaultBuild|x64.ActiveCfg = Debug|x64
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.DefaultBuild|x64.Build.0 = Debug|x64
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.DefaultBuild|x86.ActiveCfg = Debug|Win32
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.DefaultBuild|x86.Build.0 = Debug|Win32
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.Release|x64.ActiveCfg = Release|x64
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.Release|x64.Build.0 = Release|x64
{71B2B17F-9C7B-4834-9751-C4FF5BBF0275}.Release|x86.ActiveCfg = Release|Win32
Expand Down

0 comments on commit 63c5951

Please sign in to comment.