Jump to content

Screen Save Program


susserj
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

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.

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Good work man, works as intended here. :)

Spoiler

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.

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

Link to comment
Share on other sites

  • 3 years later...

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?

Link to comment
Share on other sites

  • Developers
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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...