|
|
@ -30,19 +30,6 @@ int WINAPI WinMain (HINSTANCE hThisInstance, |
|
|
|
LPSTR lpszArgument, |
|
|
|
int nCmdShow) |
|
|
|
{ |
|
|
|
// Do screenshot from cmdline
|
|
|
|
LPWSTR *szArgList; |
|
|
|
int argCount; |
|
|
|
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount); |
|
|
|
if (szArgList != NULL && argCount >= 1) { |
|
|
|
if (wcscmp(L"single", szArgList[1])==0) { |
|
|
|
doScreenshot(); |
|
|
|
LocalFree(szArgList); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
LocalFree(szArgList); |
|
|
|
|
|
|
|
// kill other already running instances
|
|
|
|
HWND existingApp = FindWindow(0, szClassName); |
|
|
|
if (existingApp) |
|
|
@ -89,6 +76,20 @@ int WINAPI WinMain (HINSTANCE hThisInstance, |
|
|
|
hThisInstance, /* Program Instance handler */ |
|
|
|
NULL /* No Window Creation data */ |
|
|
|
); |
|
|
|
|
|
|
|
// Do screenshot from cmdline
|
|
|
|
LPWSTR *szArgList; |
|
|
|
int argCount; |
|
|
|
szArgList = CommandLineToArgvW(GetCommandLine(), &argCount); |
|
|
|
if (szArgList != NULL && argCount >= 2) { |
|
|
|
if (wcscmp(L"single", szArgList[1])==0) { |
|
|
|
doScreenshot(); |
|
|
|
LocalFree(szArgList); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
LocalFree(szArgList); |
|
|
|
|
|
|
|
/*Initialize the NOTIFYICONDATA structure only once*/ |
|
|
|
InitNotifyIconData(); |
|
|
|
|
|
|
|