From e35ae9d5a1b615af919fe1ce677fb276c8f91100 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 24 Jul 2018 13:32:32 +0200 Subject: [PATCH] repair screenshot tool --- windows-snapshot-tool/bin/freeze.exe | Bin 401237 -> 401237 bytes windows-snapshot-tool/src/main.cpp | 27 ++++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/windows-snapshot-tool/bin/freeze.exe b/windows-snapshot-tool/bin/freeze.exe index 2a027185edbf98ac7f585aa5b3afc08fc5d4df2f..49bd256d25d59ded757d6f572ce3c936d15b48c7 100755 GIT binary patch delta 796 zcmcb*PvYu6i3uG{PJ9!){Fs(BZoGAnLwi8sgTwa4i(0x=U1GXpWp_BcJ(qM-Wcz$C%Q zpuoTciamx$KuU`TS>yvy#1}>6FHocaMMMA?juyPgx-@|z*HAFKg#J$_~P3wU=hi)MM082LmNa1l76}Lv!ti$-6jZ89z+E!Kr9u12ksg4yc_h zixmxtv8E1pR>FdTPX!ok1*q!vup=F(x@F= 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();