Sign in to follow this  
Followers 0
Remo1075

Clipboard

5 posts in this topic

#1 ·  Posted (edited)

I can't get my script to paste to the body of an e-mail (outlook) or to mspaint. Other applications like Word and Powerpoint seem to accept the contents of the clipboard just fine. I am currently using bmp format to maybe make things a bit easier but would chnage it to png in the end for e-mail and compression reasons.

$sBMP_Path = @DesktopDir & "\ScreenCapture.bmp"
        _ScreenCapture_Capture($sBMP_Path, $iX1, $iY1, $iX2, $iY2, False)

    _ClipBoard_Open(0)
        _ClipBoard_SetData($sBMP_Path,$CF_BITMAP)
        _ClipPutFile($sBMP_Path)
    _ClipBoard_Close()




;This also seems to work just as well, meaning it still won't paste to mspaint or to the body of an e-mail in Outlook. ( adds it as an attachment)
$sBMP_Path = @DesktopDir & "\ScreenCapture.bmp"
        _ScreenCapture_Capture($sBMP_Path, $iX1, $iY1, $iX2, $iY2, False)
                 _ClipPutFile($sBMP_Path)

Thanks for any insight

post-49149-12625254387093_thumb.jpg

Edited by Remo10

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

you can use forum search "clipboard paint" and something interesting will happen

For your paint

#Include <Clipboard.au3>
#Include <ScreenCapture.au3>
$a = _ScreenCapture_Capture() 
_ClipBoard_Open("")
_ClipBoard_Empty()
_ClipBoard_SetDataEx($a, $CF_BITMAP)
_ClipBoard_Close()
Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

you can use forum search "clipboard paint" and something interesting will happen

For your paint

#Include <Clipboard.au3>
#Include <ScreenCapture.au3>
$a = _ScreenCapture_Capture() 
_ClipBoard_Open("")
_ClipBoard_Empty()
_ClipBoard_SetDataEx($a, $CF_BITMAP)
_ClipBoard_Close()

As soon as I add co-ordinates to the _screencapture_capture() office clipboard does not capture it which is my whole point to use x y

#Include <Clipboard.au3>
#Include <ScreenCapture.au3>
$a = _ScreenCapture_Capture("c:\out.bmp", 0, 0, 796, 596)
_ClipBoard_Open("")
_ClipBoard_Empty()
_ClipBoard_SetDataEx($a, $CF_BITMAP)
_ClipBoard_Close()

This results in the following attached error from mspaint.

post-49149-12625292472083_thumb.jpg

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$a = _ScreenCapture_Capture("", 0, 0, 796, 596)

"" is important part to work ;)

Edit: from help file

If FileName is not blank this function will capture the screen and save it to file. If FileName is blank, this

function will capture the screen and return a HBITMAP handle to the bitmap image.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

OK, thanks alot, that did it. I actually read that bit but was concentrating too much on trying to output a hard copy of the file as well. Once again thanks for your help. ;)

Share this post


Link to post
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
Sign in to follow this  
Followers 0