Hi folks, I'm having problems with a screenshot capture script.
Let me explain.
Everyday I (and my colleagues at work) need to take some screenshots from a web-page. These screenshots are used to compile a report. Normally, I (and others) used to log in into the website and took screenshots of desired graphics and tables. This is tediuos and time consuming. To easy this task I made a script using autoit that basically logs into the website (user and password) and using some clicks, stroke send, coordinates, it is able to generate the graphics and save them to some folders into our network (this script saves arouund 50 pics. It works like a sharm.
In order to make things easier, I tried to schedule this script (compiled to a Screnpics.exe file) using task scheduler from windows. We already use this (task scheduler) to run some vbs scripts, some vba excel scripts and so on. The computer used for this tasks is a windows 7 desktop computer. Due to security policies, the computer locks after some time. All this tasks run in the locked computer.
My script screenpics.exe runs also from this locked computer. When the computer is unlocked, it does everything as expected. But, when it is locked, all the "pics" are BLACK. As I understand, it runs ok, but, as the "windows" are innactive, it prints what it "sees": a black rectangular.
Some details: The web-page with hold the information I need, it only works in Firefox and, because of this it couldn`t be managed by vba or some "getobject" like commands. In fact, it has some flash things that make it impossible to control programatically. So my script is based on mouse move to coordinates, mouse click, screen capture and so one.
So, I read many posts trying to figure out a way to overcome this, but... nothing came to mind. My first idea was try to unlock windows. Theses lead me to some posts with no solution. This is worse because I'm not a computer admin, so procedures that need to replace/change the register are not an option.
If someone has any idea, I'll be gratefull.
#include <ScreenCapture.au3> Local $hBmp ; Capture full screen $hBmp = _ScreenCapture_Capture("") _ScreenCapture_SaveImage("C:\Software\autoitscripts\scripts\images\prp\ocr\"&"ocr_01.PNG",$hBmp) Sleep(1000) _ScreenCapture_Capture("C:\Software\autoitscripts\scripts\images\prp\ocr\"&"ocr_02.PNG") Sleep(1000) ShellExecute("C:\Software\autoitscripts\scripts\images\prp\ocr\"&"ocr_01.PNG") Sleep(1000) ShellExecute("C:\Software\autoitscripts\scripts\images\prp\ocr\"&"ocr_02.PNG") Hi All,
This is my first post and I have checked the forum. If this question has been asked and answered I apologise.
The code above is intended to save the whole screen to a directory; it doesn't work.
I have downloaded and copied and renamed the files referenced in https://www.autoitscript.com/forum/topic/192254-33143-fixes/ to my includes directory.
Clearly there is some step that I am missing; do I need to download and register a dll?
I know that I am using two different methods above but neither works for me.
If I set the transparency with WinSetTrans, screenshot can't be made.
This is Windows 7 related.
Win 10 works fine
Run the attached file
#include <ScreenCapture.au3> ;GUI1 $gui1 = GUICreate("gui1", 200, 200, 200, 200) GUICtrlCreateLabel("GUI 1 LABEL", 50, 50 ) GUISetState() ;GUI 2 with transparency is completely ignored by _ScreenCapture_Capture $gui2 = GUICreate("gui1", 200, 200, 200, 200, -1, -1, $gui1) GUICtrlCreateLabel("GUI 2 LABEL", 100, 100 ) GUISetState() WinSetTrans($gui2, "", 150) Sleep(2000) _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg", 200, 200, 405, 410) ShellExecute(@MyDocumentsDir & "\GDIPlus_Image1.jpg") As you can see, the semi transparent window will not be visible in the screenshot.
I noticed that a couple of screen recording tools are acting the same. (But there are those that do work)
I tried different ways on getting the screenshot and none worked.
Printscreen does work.
Is there a way to solve this without using Printscreen?
I would like to get a region of the screen but avoiding having to save to a file first.
I believe it is a lack of knowledge on my part but the GUICtrlSetImage function does not allow you to define an image without being a file.
How to do this:
;.... $Pic3 = GUICtrlCreatePic("", 8, 64, 84, 84, -1, _ $WS_EX_STATICEDGE) ;para ter borda em baixo relevo ;.... _ScreenCapture_Capture(@ScriptDir & "\areatemp.jpg", 10, 10, 200, 200) GUICtrlSetImage($Pic3, @ScriptDir & "\areatemp.jpg") ;....
Screenshot program that can upload/FTP to website/storage with hotkey.
Features GUI to display programmable keys.
Set the hotkeys with this function to use, and display hotkeys.
; hotkey_set() Parameters: ; ----------------------------------------------------------- ; $aHotkey - The array hotkeys are stored in. This function sets the values of this array[hotkey_id][$hotkey_data] ; $dHotkey_id - The enum for this hotkey index ; $sHotkey_description - The label displayed to the user to represent function of hotkey ; $sHotkey_name - The hotkey it'self. Whatever name string you want to give the key ; $dHotkey_key - The _IsPressed keycode ; Keycodes AT: https://www.autoitscript.com/autoit3/docs/libfunctions/_IsPressed.htm ; $dHotkey_shift - Shift flag 0 or 1 Default off ; $dHotkey_ctrl - Ctrl flag 0 or 1 Default off ; $dHotkey_alt - Alt flag 0 or 1 Default off Func hotkey_set(ByRef $aHotkey, $dHotkey_id, $sHotkey_description, $sHotkey_name, $dHotkey_key, $dHotkey_shift = 0, $dHotkey_ctrl = 0, $dHotkey_alt = 0) $aHotkey[$dHotkey_id][$eHotkey_data_key_description] = $sHotkey_description $aHotkey[$dHotkey_id][$eHotkey_data_key_name] = $sHotkey_name $aHotkey[$dHotkey_id][$eHotkey_data_key] = $dHotkey_key $aHotkey[$dHotkey_id][$eHotkey_data_shift] = $dHotkey_shift $aHotkey[$dHotkey_id][$eHotkey_data_ctrl] = $dHotkey_ctrl $aHotkey[$dHotkey_id][$eHotkey_data_alt] = $dHotkey_alt EndFunc ;==>hotkey_set ; You can set your hotkeys here ; Please visit the hotkey_set() function for parameter information hotkey_set($aHotkey, $eHotkey_screenshot_ftp, "Selected Window to FTP", "F12", "7B", 0, 1, 0); F12 hotkey_set($aHotkey, $eHotkey_screenshot_disk, "Selected Window to Disk", "S", "53", 1, 1, 1); S hotkey_set($aHotkey, $eHotkey_clipboard_send, "Send Clipboard keystrokes", "F10", "79", 1, 1, 1); F10
Configure settings dialog:
Screenshot Filename and Screenshot Counter, are used to create simple unique filenames that can cycle. Copy URL to clipboard option. - For linking your screenshots. The screenshot file type is for local copy only. App always uses .JPG for FTP right now, but I could add FTP screenshot file type specification.
Any suggestions? Did I break anything, what did I miss?
Package uses TTS.au3 by Beege:
- TTS.au3 - by Beege