diff --git a/windows-snapshot-tool/bin/freeze.exe b/windows-snapshot-tool/bin/freeze.exe index 2a02718..49bd256 100755 Binary files a/windows-snapshot-tool/bin/freeze.exe and b/windows-snapshot-tool/bin/freeze.exe differ diff --git a/windows-snapshot-tool/src/main.cpp b/windows-snapshot-tool/src/main.cpp index bb5214d..7645e83 100644 --- a/windows-snapshot-tool/src/main.cpp +++ b/windows-snapshot-tool/src/main.cpp @@ -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();