Jump to content

Recommended Posts

Posted (edited)

Hi!

I want to do something like:

#include <ScreenCapture.au3>
#include <Misc.au3>

Local $hDLL = DllOpen("user32.dll")
Global $running = 1

Func Quit()
    $running = 0
EndFunc

HotKeySet("{ESC}","Quit")

MsgBox(0, "Running screen-capper!", "All fine captain!", 5)

While $running
    If _IsPressed("0D", $hDLL) Then
        Sleep(800)
        _ScreenCapture_Capture(@MyDocumentsDir & "\Tutorial_screens\Tutorial_Image_" & @MON & "_" & @MDAY & "_" & @HOUR & @MIN & @SEC & ".jpg")
        While _IsPressed("0D", $hDLL)
            Sleep(250)
        WEnd
    EndIf
WEnd
DllClose($hDLL)
exit 0 

It works as i want it to work (takes a screenshot whenever i press enter key. But maybe is there some better/less resource hungry approach to this? It should take a screenshot when i press enter, but mentioned Enter must also work "normally". I tried registering it as a hotkey, but then it didnt worked "normaly".

And you may ask "Why Enter key?". Well, i want to do some tutorials with pictures and after some analysis above method will make my work much more natural and pleasurable.

Edited by misioooo

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
  • Recently Browsing   0 members

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