diff --git a/windows-snapshot-tool/bin/freeze.exe b/windows-snapshot-tool/bin/freeze.exe index d386f61..d8a731c 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 e2a935c..b7a5550 100644 --- a/windows-snapshot-tool/src/main.cpp +++ b/windows-snapshot-tool/src/main.cpp @@ -30,6 +30,17 @@ int WINAPI WinMain (HINSTANCE hThisInstance, LPSTR lpszArgument, int nCmdShow) { + 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); HWND existingApp = FindWindow(0, szClassName); if (existingApp) @@ -256,7 +267,7 @@ void doScreenshot() WCHAR path[12]; getRaspiStorage(path); if (wcslen(path) != 3) { - MessageBox(Hwnd, L"Couldn't find Raspberry USB-Storage\nSaving in current directory!", L"Failure", MB_OK); + if (Hwnd != NULL) MessageBox(Hwnd, L"Couldn't find Raspberry USB-Storage\nSaving in current directory!", L"Failure", MB_OK); CaptureImage(Hwnd, L"screenshot.png"); } else { WCHAR filename[128];