Sign in to follow this  
Followers 0
Mast3rpyr0

ScreenCap and save

18 posts in this topic

#1 ·  Posted (edited)

I made this for someone on RentACoder but they declined my bid so guess ill post it here.

PrnScr will take a screenshot and save it in C:\Program Files\ScreenCap with the date and time as the name. It will then add the complete path to the image to the clipboard.

Esc will close the program.

#Include <A3LClipBoard.au3>
#Include <A3LScreenCap.au3>

HotKeySet("{PRINTSCREEN}", "PicFunc")
HotKeySet("{ESC}", "ExitFunc")

SplashTextOn("ScreenCap", "Starting ScreenCap...", 200, 50)
Sleep(1000)
SplashOff()

While 1
WEnd
Func PicFunc()
    _Clip_Empty()
    $sFileName = @ProgramFilesDir & "\ScreenCap\Cap_" & @MON & @MDAY & @HOUR & @MIN & @SEC & ".bmp"
    _ScreenCap_Capture($sFileName)
    _Clip_SetData($sFileName)
    Sleep(100)
EndFunc

Func ExitFunc()
    Exit
EndFunc
Edited by Mast3rpyr0

Share this post


Link to post
Share on other sites



#Include <GUIConstants.au3>

???

Share this post


Link to post
Share on other sites

probably not needed but i put it in all my programs. or do you not know what tha means?

Definitly not needed here gecause you don't have a GUI therefore you have no GUI Constants to include. I never include that file (or any of the constants files) anyway. Just use the value of the constant.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Definitly not needed here gecause you don't have a GUI therefore you have no GUI Constants to include. I never include that file (or any of the constants files) anyway. Just use the value of the constant.

I never do any #includes unless I use like 3 UDFs/Variables from them.

Share this post


Link to post
Share on other sites

i get his error...

2005421836041698056_th.jpg

Please help...


Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

You have the A3Lib installed?

If not its the first sticky post in Example scripts.

yes i do... but ill reinstall now just to dubble check

Checked it still not working...

Edited by SalazarCheats

Ok im 14 with a spelling age of a 9 year old... that explanes all my spelling mistakes

Share this post


Link to post
Share on other sites

I get this error :whistle:

Return $aResult[0] <> 0 
Return $aResult^ ERROR

Share this post


Link to post
Share on other sites

I get this error :whistle:

Return $aResult[0] <> 0 
Return $aResult^ ERROR
Try with latest version of AutoIt, maybe that's the problem, or his version was an older version, because dllcall was different i noticed.

Anyways check out the 1 in my sign too.

Share this post


Link to post
Share on other sites

Mast3rpyr0 you code so cool, but it output .bmp, i wanna change output file to .jpg so it tat only change 1 line

$sFileName = @ProgramFilesDir & "\ScreenCap\Cap_" & @MON & @MDAY & @HOUR & @MIN & @SEC & ".bmp"

but when i press prtsc key, nothin happen. Help me plz, how to output .jpg ???

(Sori my ENG so bad :whistle:)

Share this post


Link to post
Share on other sites

AutoIt does not exit by default if Escape is pressed.

Not bad program, I think you should put in a DirCreate to create the folder (I had to create the folder manually for script to work). Also, don't hotkeyset the print screen key until after the splash has finished, that way there is no screen capture during startup.


My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

i can't output *.jpg, plz help!!!!!

in A3LScreenCap.au3 :

Func _ScreenCap_SaveImage($sFileName, $hBitmap, $fFreeBmp=True)

......

......

Switch $sExt

case "BMP"

$iX = _GDIP_ImageGetWidth ($hImage)

$iY = _GDIP_ImageGetHeight($hImage)

$hClone = _GDIP_BitmapCloneArea($hImage, 0, 0, $iX, $iY, $giA3LBMPFormat)

_GDIP_ImageDispose($hImage)

$hImage = $hClone

case "JPG", "JPEG"

$tParams = _GDIP_ParamInit(1)

$tData = DllStructCreate("int Quality")

DllStructSetData($tData, "Quality", $giA3LJPGQuality)

_GDIP_ParamAdd($tParams, $GDIP_EPGQUALITY , 1, $GDIP_EPTLONG, DllStructGetPtr($tData))

so tat mean just change .bmp ====> .jpg. but y script not working????

Edited by tonlo

Share this post


Link to post
Share on other sites

AutoIt does not exit by default if Escape is pressed.

Not bad program, I think you should put in a DirCreate to create the folder (I had to create the folder manually for script to work). Also, don't hotkeyset the print screen key until after the splash has finished, that way there is no screen capture during startup.

You could use a FileCopy() or FileMove() with the flag set to 9 which will overwrite existing and create the folder structure if required.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

Now This saves in JPG

Easy and any one can understand the code ......

;Gets Screen HackMan
SEND("{PRINTSCREEN}")
Run("mspaint.exe")
WinWaitActive("untitled - Paint")
WinSetState ( "untitled - Paint", "", @SW_MAXIMIZE )
Send("!EP")
Send("P")
WinWaitActive("untitled - Paint")
Send("!FA")
Send("!T")
Send("{DOWN}")
Send("{DOWN}")
Send("{ENTER}")
Send("!N")
$sFileName = @MON & @MDAY & @HOUR & @MIN & @SEC & ".jpg"
Send($sFileName)
Sleep(1000)
Send("{ENTER}")
Sleep(1000)
MsgBox(0,"HackMan","This Program Has been Done by Hackman ")
MsgBox(0,"HackMan","In Case if u wanna use this to some pgm pls give me credits  ")
EXIT

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  
Followers 0