Jump to content
Sign in to follow this  
cypher175

Desktop Screen-Shot Capturing..?

Recommended Posts

cypher175

Is it possible at all to code a AutoIt App to Take Full Screen Shots of the Desktop every so many seconds, then save each one with a Time-Date Stamp & PC-Name & User-Name in its file name and then save it to a specified Directory..??

Ex.

Computer-Name___User-Name___2008_11_06___3-35-52-AM.JPG

Computer-Name___User-Name___2008_11_06___3-35-52-PM.JPG

Ect..

Share this post


Link to post
Share on other sites
Pain

Take a look at these functions in the helpfile:

_ScreenCapture_Capture()

AdlibEnable()

_Now() (or the time macros like @Year etc.)

@ComputerName

@UserName

Share this post


Link to post
Share on other sites
goldenix

Is there a reason to do this other than to spy on someone? Serious question here..

Yes there are many Serious reasons. 1 of them is if you need to give tech support to a newbie via msn who cant explain his problem, who cant give enough information, who cant even do a screen shot & dont know how to send me that f*kin screencap via msn....so i just make an exe that can do it for him.

But you cant send exe files via MSN , you need to rar or rename them. & if that newbie does not know how to unzip the exe or how to rename screencapture.xxx to screencapture.exe you will need to explain & if you are really really lucky he wiull understand .....

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.12.0

#ce ----------------------------------------------------------------------------

Sleep(3000)

#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <ScreenCapture.au3>
#include <WinAPI.au3>

Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $hBitmap, $hClone, $hImage, $iX, $iY

    ; Initialize GDI+ library
    _GDIPlus_Startup ()

    ; Capture 32 bit bitmap
    $hBitmap = _ScreenCapture_Capture ("")
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP ($hBitmap)

    ; Create 24 bit bitmap clone
    $iX = _GDIPlus_ImageGetWidth ($hImage)
    $iY = _GDIPlus_ImageGetHeight ($hImage)
    $hClone = _GDIPlus_BitmapCloneArea ($hImage, 0, 0, $iX, $iY, $GDIP_PXF24RGB)

    ; Save bitmap to file
    _GDIPlus_ImageSaveToFile ($hClone, 'testgui.png')

    ; Clean up resources
    _GDIPlus_ImageDispose ($hClone)
    _GDIPlus_ImageDispose ($hImage)
    _WinAPI_DeleteObject ($hBitmap)

    ; Shut down GDI+ library
    _GDIPlus_ShutDown ()

EndFunc   ;==>_MainoÝ÷ ØêðØj¹©b·'(Úè«­¢+ÙM±À ÌÀÀÀ¤((¥¹±Õ±ÐíMɹ
ÁÑÕɹÔÌÐì((ì
ÁÑÕÉÕ±°Íɸ)}Mɹ
ÁÑÕÉ})AEÕ±¥Ñä ÄÀÀ¤ìÌÀ¥ÌÅÕ±¥ÑäµÕÍÐÑݸÀµÀìÄÀÀ)}Mɹ
ÁÑÕÉ}
ÁÑÕÉ ÅÕ½ÐíͭѽÀ¹©ÁÅÕ½Ðì¤

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites
cypher175

sweet thanks,

One thing though that's preventing it from saving the Captures the way I want them to, is the _Now(3) Function, Because it outputs colons ":" in the name like (hh:mm:ss) and you cant save file names with those symbols in them on a Windows OS..

So is there any way to change the output so its like (hh_mm_ss_AM) instead..??

#NoTrayIcon
#include <Misc.au3>
#include <ScreenCapture.au3>
#include <Date.au3>
_Singleton(@scriptname)
While 1
If Not FileExists("C:\ScreenShots\"&@UserName) Then
    DirCreate("C:\ScreenShots\"&@UserName)
EndIf
_ScreenCapture_Capture("C:\ScreenShots\"&@UserName&"\"&@ComputerName&"__"&@UserName&"___"&@YEAR&"_"&@MON&"_"&@MDAY&"___"&_NowTime(3)&".jpg")
Sleep(3000)
 WEnd

Share this post


Link to post
Share on other sites
Pain

StringReplace / StringRegExp? or keep using the time macros @HOUR, @MIN and @SEC.

And btw you don't have to use DirCreate INSIDE that loop. Most likely the user won't delete the folder while the program is running if they didn't before.

Edited by Pain

Share this post


Link to post
Share on other sites
cypher175

StringReplace / StringRegExp? or keep using the time macros @HOUR, @MIN and @SEC.

And btw you don't have to use DirCreate INSIDE that loop. Most likely the user won't delete the folder while the program is running if they didn't before.

thanks for your help..

How would I use those StringReplace / StringRegExp? exactly to tweak the code to do what I am asking..??

Share this post


Link to post
Share on other sites
Pain

$string = _NowTime(3)
$string = StringReplace($string, ":", "_")
ConsoleWrite($string)

Share this post


Link to post
Share on other sites
cypher175

Would there be anyway to implement and idle detection feature into this at all..??

So ScreenShots are only taken when either the mouse is being moved or the keyboard is being used..??

and have it pause only after there has been no user activity for at least 30 Seconds..

and once user activity is detected automatically resume screen capture..

Thus preventing the app from taking unwanted or unneeded ScreenCaps..

Would something like this be possible at all..??

Share this post


Link to post
Share on other sites
youknowwho4eva

Just to chime in about why this would be needed. I believe I read this on hear about someone creating a program like this and sent his computer to the geek squad and saw how they went through all his files and pictures and such.


Giggity

Share this post


Link to post
Share on other sites
system24

spudw2k have made a script similar to that.

Link

Edited by system24

[center]It's a question of mind over matter, if I don't mind, it doesn't matter.[/center]

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
Sign in to follow this  

×