|
|
@ -1,9 +1,6 @@ |
|
|
|
#include "resource.h" |
|
|
|
#include "LimitSingleInstance.h" |
|
|
|
|
|
|
|
|
|
|
|
CLimitSingleInstance g_SingleInstanceObj(TEXT("Global\\{38593226-AABB-1234-7592-D335AAB6F22A}")); |
|
|
|
|
|
|
|
/*variables*/ |
|
|
|
UINT WM_TASKBAR = 0; |
|
|
|
HWND Hwnd; |
|
|
@ -30,11 +27,11 @@ int WINAPI WinMain (HINSTANCE hThisInstance, |
|
|
|
LPSTR lpszArgument, |
|
|
|
int nCmdShow) |
|
|
|
{ |
|
|
|
if (g_SingleInstanceObj.IsAnotherInstanceRunning()) |
|
|
|
{ |
|
|
|
|
|
|
|
HWND existingApp = FindWindow(0, szClassName); |
|
|
|
if (existingApp) |
|
|
|
{ |
|
|
|
SendMessage(existingApp, WM_DESTROY, 0, 0); |
|
|
|
//return FALSE;
|
|
|
|
} |
|
|
|
|
|
|
|
/* This is the handle for our window */ |
|
|
|