Jump to content

ScreenCapture to Clipboard?


pintas
 Share

Recommended Posts

Hello everyone.

I'm trying to get take a screenshot of a specific region on the screen and put it in the clipboard, but without saving it to any file, just put it on the clipboard so i can simply ctrl+v (paste) it anywhere i want.

I've been reading ScreenCapture and _Clipboard_SetData, but nothing works.

Can anyone help me out with this please?

Thank you.

Link to comment
Share on other sites

Well, without seeing your code I don't know what exactly you were doing wrong. This code I found here works for me.

#Include <Clipboard.au3>
#Include <ScreenCapture.au3>
Opt('MustDeclareVars', 1)
Local $HBITMAP = _ScreenCapture_Capture()
_ClipBoard_Open("")
_ClipBoard_Empty()
_ClipBoard_SetDataEx($HBITMAP, $CF_BITMAP)
_ClipBoard_Close()

Perfect!

I just added the coordinates to select the part of the screen to _ScreenCapture_Capture and it's done.

Thank you so much Thanubis!

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...