Browse Source

do screenshot from cmdline

main
Hendrik Langer 6 years ago
parent
commit
67afa5db3f
  1. BIN
      windows-snapshot-tool/bin/freeze.exe
  2. 13
      windows-snapshot-tool/src/main.cpp

BIN
windows-snapshot-tool/bin/freeze.exe

Binary file not shown.

13
windows-snapshot-tool/src/main.cpp

@ -30,6 +30,17 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
LPSTR lpszArgument, LPSTR lpszArgument,
int nCmdShow) 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); HWND existingApp = FindWindow(0, szClassName);
if (existingApp) if (existingApp)
@ -256,7 +267,7 @@ void doScreenshot()
WCHAR path[12]; WCHAR path[12];
getRaspiStorage(path); getRaspiStorage(path);
if (wcslen(path) != 3) { 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"); CaptureImage(Hwnd, L"screenshot.png");
} else { } else {
WCHAR filename[128]; WCHAR filename[128];

Loading…
Cancel
Save