tomine Posted June 3, 2011 Share Posted June 3, 2011 Hello, I’m new on this so patience please. What I’m trying to do is to take screen captures of specific window to the clip board and then using another program (than Autoit) to modify it more. First I tried the !{Screen capture}, but it will need a focus to the window being under capture. So I made this: #include <ScreenCapture.au3> #Include <Clipboard.au3> _Main() Func _Main() Local $hGUI Local $hTEST ; Create GUI $hGUI = GUICreate("Screen Capture", 400, 300) GUISetState() Sleep(1000) ; Capture window $hTEST = _ScreenCapture_CaptureWnd ("", $hGUI) ;$hTEST = _ScreenCapture_CaptureWnd (@MyDocumentsDir & "\GDIPlus_Image.jpg", $hGUI) Sleep(1000) _ClipBoard_SetData($hTEST,$CF_BITMAP) _WinAPI_DeleteObject($hTEST) EndFunc ;==>_Main But it does not work I’m guessing it is not even close. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted June 3, 2011 Share Posted June 3, 2011 M23 wrote this little screen capture script, here, which is great and I'm sure you can modify it to your use.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
UEZ Posted June 3, 2011 Share Posted June 3, 2011 (edited) Try this: ;code by UEZ #include <Clipboard.au3> #include <ScreenCapture.au3> $err = False $hHBITMAP = _ScreenCapture_Capture("", 0, 0, 100, 100) If Not _ClipBoard_Open(0) Then $err = @error $err_txt = "_ClipBoard_Open failed!" EndIf If Not _ClipBoard_Empty() Then $err = @error $err_txt = "_ClipBoard_Empty failed!" EndIf If Not _ClipBoard_SetDataEx($hHBITMAP, $CF_BITMAP) Then $err = @error $err_txt = "_ClipBoard_SetDataEx failed!" EndIf _ClipBoard_Close() _WinAPI_DeleteObject($hHBITMAP) If Not $err Then MsgBox(0, "Information", "Image put to clipboard!", 10) Else MsgBox(0, "Error", "An error has occured: " & $err_txt, 10) EndIf Exit You can change ScreenCapture_Capture() to _ScreenCapture_CaptureWnd(), the result should be the same. For capturing an area of your desktop you can use this: Br, UEZ Edited June 3, 2011 by UEZ Velislav 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
tomine Posted June 6, 2011 Author Share Posted June 6, 2011 UEZ, That code worked perfectly! Thank you! Also thanks somdcomputerguy about giving more resources, those might come handy later on. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now