Jump to content

Print Sscreen How Can I


Recommended Posts

Here's something I wrote that uses Lazycats DLL's which you can hack to suit your needs:

#region  --  OnScreenShot()
;******************************************************************************
Func OnScreenShot()
    GUISetCursor(15, 1)
    $StatusBarText1 = " Please wait, grabbing screen shot...."
    GUICtrlSetData($StatusBarLabel1, $StatusBarText1)
    $StatusBarText3 = " Please wait, grabbing screen shot...."
    GUICtrlSetData($StatusBarLabel3, $StatusBarText3)
    Local $Cwin1 = WinGetHandle(""); gets the handle of the active window
    Local $Cwin2 = WinGetPos($Cwin1); gets active window dimensions
    Local $Quality = -1; -1 to save as BMP or use number between 0 - 100 to save as JPG quality
    If $Quality = -1 Then
        Local $SaveAs = ".bmp"
    Else
        Local $SaveAs = ".jpg"
    EndIf
    Local $CaptureDirectory = @ScriptDir & "\Screenshots\"; directory uses to store screen caps
    Local $CaptureFile = @YEAR & "-" & @MON & "-" & @MDAY & "_" & @HOUR & @MIN & "-" & @SEC & $SaveAs
    DllCall(@ScriptDir & "\Tools\captdll.dll", "int", "CaptureRegion", "str", $CaptureDirectory & $CaptureFile, "int", $Cwin2[0], "int", $Cwin2[1], "int", $Cwin2[2], "int", $Cwin2[3], "int", $Quality)
    If @error Then MsgBox(262160, "ERROR", "The screen was not captured", 4)
    $StatusBarText1 = " Ready"
    GUICtrlSetData($StatusBarLabel1, $StatusBarText1)
    $StatusBarText3 = " Ready"
    GUICtrlSetData($StatusBarLabel3, $StatusBarText3)
    GUISetCursor(2, 0)
EndFunc
;******************************************************************************
#endregion
Link to comment
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
 Share

  • Recently Browsing   0 members

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