Automatically taking screenshots of program window

Sergey Kornilov picture Sergey Kornilov · Jan 20, 2011 · Viewed 19.8k times · Source

I'm looking for a software that combines macro recording with screenshot taking capabilities.

We have a software manual with a number of screenshots. When new version of software is released we need to update most of screenshots and we have to do it manually. Now we started translating manual to several languages and number of screenshots to take have increased ten fold. We'd like to automate this process.

There will be a recorded macro or something that clicks button within our software and takes screenshots of the program window. Better yet, we can specify the name of each screenshot individually though it's less important.

Does such a thing exist?

Answer

PabloG picture PabloG · Jan 31, 2011

I use AutoIt plus captdll.dll for all my Windows GUI automation tasks.

Example:

Run("Notepad.exe", @WindowsDir, @SW_MAXIMIZE)   ; Open NOTEPAD
Sleep(1000)
Send("Just a Test")   ; Send some text to notepad

; Save the screen to test.jpg  
$anPos = WinGetClientSize("")
$nLeft = 0
$nTop = 0
$nRight = $anPos[0]
$nBottom = $anPos[1]

$sFileName = "test.jpg"
DllCall("captdll.dll", "int:cdecl", "CaptureScreen", "str", $sFileName, "int", 85)

This way you can automate the entire screenshot capturing process:

  • start your application with Run
  • select each of your menu options with Send
  • complete each screen's data also with Send
  • capture with DllCall("captdll.dll" ....)

You can also add conditional logic, loop, etc.