Jump to content
Sign in to follow this  
VicTT

Screenshot using mspaint

Recommended Posts

VicTT

Decided it's more visually pleasing to actually see the entire process unfold..All in "AutoIt native commands" ;)..

Global $root="E:\Screensaves\"
Func ScExit()
Exit
EndFunc
Func PrintScreen()
Send("{PRINTSCREEN}")
Run("C:\Windows\System32\mspaint.exe")
WinWaitActive("untitled - Paint")
Send("^v")
Send("!f")
Send("s")
Send($root&@HOUR&" "&@MIN&" "&@SEC&".jpg")
Send("{TAB}{DOWN 2}{ENTER}{TAB}{ENTER}")
Send("!{F4}")
EndFunc
HotKeySet("^!{F5}","PrintScreen")
HotKeySet("^!{F12}","ScExit")
while 1
wend

It can be easily modified to suit anyone's needs..


[quote]Together we might liveDivided we must fall[/quote]

Share this post


Link to post
Share on other sites
peethebee

Hi!

This is of course of possiblity, but in most cases, a dll solution is the better way (search for it in the forums).

But for learning from it, it is vey usefull.

Thanks for sharing it,

peethebee


vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Share this post


Link to post
Share on other sites
Michel Claveau

Hi !

The idea is interesting.

I took again the principle, in the code below. Note: needs MS-Word, AutoIt-Beta, and the file (document) "cecrans.doc" in C: \

Func ScExit()
    VW()
    Exit
EndFunc

Func PScreen()
    Send("!{PRINTSCREEN}")
    $w.Visible=True
    sleep(250)
    WinActivate("cecran2.doc")
    sleep(100)
    Send("{RIGHT}{DOWN}{ENTER}")
    Send("^v")
    Send("{RIGHT}{DOWN}{ENTER}{ENTER}")
    $w.Visible=False
EndFunc


Func VW()
    $w.Visible=True
    sleep(100)
EndFunc


$w=ObjCreate("Word.Application")
sleep(1000)
$w.Visible=False
$w.Documents.Open("C:\cecrans.doc")
sleep(250)
$w.Activedocument.SaveAs("C:\cecran2.doc")
sleep(100)

HotKeySet("^!{F5}","PScreen")
HotKeySet("^!{F12}","ScExit")
HotKeySet("^!{F11}","VW")

while 1
    sleep(50)
wend

Usage :

- Alt-Ctrl-F5 for capture-screen

- Alt-Ctrl-F11 for see the result, in Word

- Alt-Ctrl-F12 for exit

Target : capture multiple screen in MS-Word.

cecrans.doc

Edited by Michel Claveau

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  

×