Jump to content
susserj

Screen Save Program

Recommended Posts

susserj

Hi

I created this program as a means to quickly save screen shots to assist in documenting various system settings.

The programs runs as a TSR.

If you press <ctr><f3> it prompts you for a file name before saving the screen.

If you press <ctr><f4> it saves a sequentially numbered screen shot.

I recenty enhanced the program to remember the last screen shot number recorded (this was because I frequently had to reboot between sessions).

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------

AutoIt Version: 3.3.6.1
Author: Joel Susser (susserj)
Last Modified: 10/22/2012

Purpose: Capture Screen and save files in directory
Instructions: Start Application
Press CTR F3 to save to a specific name
Press CTR F4 to save to a secquencial number (number gets reset when application is shutdown)

10/22/2012
Added functionality to remember last saved saved image file by reading counter file

Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <ScreenCapture.au3>

Global $Paused
Local $file = FileOpen("count.txt",0)
If $file = -1 Then
Global $count = 0
Else
$count = Number (FileReadline($file))
FileClose($file)
Endif

HotKeySet("^{F3}", "capture") ;Ctr F3
HotKeySet("^{F4}", "captureby_number") ;Ctr F4
;;;; Body of program would go here ;;;;

While 1
Sleep(100)
WEnd
;;;;;;;;

func capture()
$filename = InputBox("Filename", "Enter Filename","","",30,20)
$filename = $filename & ".jpg"
SplashTextOn("FileName", $filename, 120, 50, 0, 0, 0, "")
Sleep(1000)
;SplashOff()

; Capture full screen
;Print The screen and save it to a temporary file
Local $hBmp
_ScreenCapture_SetJPGQuality(60)
$hBmp = _ScreenCapture_Capture ("")

; Save bitmap to file
_ScreenCapture_SaveImage ($filename, $hBmp)
SplashOff()
endFunc

func captureby_number()
$count = $count + 1
$filename = string($count)
$filename = $filename & ".jpg"
;MsgBox(4096, "Filename", $filename, 1)
SplashTextOn("FileName", $filename, 120, 50, 0, 0, 0, "")
Sleep(1000)
;SplashOff()

; Capture full screen
;Print The screen and save it to a temporary file
Local $hBmp
; Capture full screen
_ScreenCapture_SetJPGQuality(60)
$hBmp = _ScreenCapture_Capture ("")

; Save bitmap to file
_ScreenCapture_SaveImage ($filename, $hBmp)
SplashOff()

;save the new counter in a file
Local $file= FileOpen("count.txt", 2)
filewrite($file, $count)
FileClose($file)
endFunc

screen_save.au3

Edited by susserj

Share this post


Link to post
Share on other sites
careca

Hello, seems like a good project.

But i got undefined functions on these:

_ScreenCapture_SetJPGQuality(60)

$hBmp = _ScreenCapture_Capture ("")

_ScreenCapture_SaveImage ($filename, $hBmp)

You got an empty include.

Are you using some UDF? point out the udf so we can test this.

why so much space between the codes?

greetings.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
susserj

Hi Wayfarer

Thanks for pointing out the difficulties.

Cut and paste didn't work exactly as I expected. It fixed the #include <ScreenCapture.au3> and added a bunch of extra lines.

Hopefully it we be better now.

Edited by susserj

Share this post


Link to post
Share on other sites
careca

Good work man, works as intended here. :)


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
SalamanderSoup

I would like the screen capture (using CTRL + F4) to happen automatically when the script runs.  Tried "Send('^{F4}')", but not go.  Any ideas?  I would like this screen shot to happen while the screen is locked.

If taking a screenshot while the screen is locked isn't possible, could I get some script for unlocking the screen?

Share this post


Link to post
Share on other sites
Jos
9 minutes ago, SalamanderSoup said:

 I would like this screen shot to happen while the screen is locked.

This will never happen unless somebody can performs magic.
There are many questions around screen captures to file etc in this forum and working solutions, so do some searching and reading to get yourself up to speed.

ps. unsure why you decided to post in a 4 year old thread, but it would be better to start your own topic in case it is not directly related to the thread.

Jos


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×