rss search

next page next page close

Print Screen with Autoit

Print Screen with Autoit

; Press Esc to Print Screen and terminate script
#include <GDIPlus.au3>
#include <ClipBoard.au3>

Global $UnPaused
HotKeySet("1", "TogglePause")
HotKeySet("{ESC}", "Terminate")

While 1
    Sleep(100)
    ToolTip("Script is Paused",0,0)
WEnd

Func TogglePause()
    $UnPaused = NOT $UnPaused
    While $UnPaused
        ToolTip("Sending...",0,0)
        Send("z")
    WEnd
EndFunc

Func Terminate()

; Capture full screen
Send("{PRINTSCREEN}") ; Screen
;Send("!{PRINTSCREEN}") ; window

_Main()

ShellExecute(@ScriptDir & "\Image.jpg")
    Exit 0
EndFunc

Func _Main()
    Local $hBmp, $hImage

    If Not _ClipBoard_Open(0) Then _WinAPI_ShowError("_ClipBoard_Open failed")
    $hBmp = _ClipBoard_GetDataEx($CF_BITMAP)
    _GDIPlus_Startup()
    $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBmp)

    ; Save bitmap to file
    _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Image.jpg") ;$sNewName)

    _GDIPlus_BitmapDispose($hImage)
    _GDIPlus_Shutdown()
    _ClipBoard_Close()
EndFunc ;==>_Main

(Contains 1 attachments.)
Share this:
Share this page via Email Share this page via Stumble Upon Share this page via Digg this Share this page via Facebook Share this page via Twitter

Print Screen with Autoit

Share|Print Screen with Autoit ; Press Esc to Print Screen and terminate script #include...
article post

Devguru.in is Stephen Fry proof thanks to caching by WP Super Cache