Sign in to follow this  
Followers 0
momitty

Get Clipboard when not text? How?

13 posts in this topic

I am using AutoIt to capture my copy history. So I can say copy "this", then "that", then click on a button and paste "this" back even though "that" is really in the clipboard.

Works okay as long as I'm working with straight-up text but if I step into a graphics program I lose the image information or Word processor I lose the rich text.

I'm just wondering... is there another way through a DLL or something besides using ClipGet and ClipPut ??

Also, is there a quick way to put focus back on the window that had focus previous to clicking on your app? When I click on my little clipboard manager it steals focus.

Share this post


Link to post
Share on other sites



Okay, that wasn't in the version I had on my computer. Looks like it will do what I need but I'm running into two problems.

First, it crashes my program a lot when I try to capture the clip board.

Second, how do I automatically detect the type of item on the clipboard. I don't really care what format it is, I just want the bits and bytes.

Thanks for the help in pointing me in the right direction!

Share this post


Link to post
Share on other sites

_ClipBoard_IsFormatAvailable()

_ClipBoard_GetData()

_ClipBoard_CountFormats()

_ClipBoard_EnumFormats()

_ClipBoard_FormatStr()

Those all seem to want a format argument of a format. Trouble is I don't know what format to look for. It seems like if I try to grab things off the clipboard that are images and I try format 1 it crashes. If I try grabbing 1 and it's really 2 then it crashes.

Share this post


Link to post
Share on other sites

Trouble is I don't know what format to look for.

Doesn't _ClipBoard_EnumFormats tell you what formats are in the clipboard.

Share this post


Link to post
Share on other sites

I see in the CHM file there was an example on how to enumerate through. Only problem now... I have like 9 kinds and i dunno what to do with them. For example, I'm copying out of Paint Shop Pro and 9 things show up and only 2 of them are PSP stuff. This is the list i get...

Clipboard formats ..: 9

Clipboard format 1 .: DataObject

Clipboard format 2 .: Jasc Paint Shop Pro 6.0 Clipboard Format

Clipboard format 3 .: Jasc Paint Shop Pro 7.0 Clipboard Format

Clipboard format 4 .: DIB

Clipboard format 5 .: Metafile Picture

Clipboard format 6 .: Bitmap

Clipboard format 7 .: Ole Private Data

Clipboard format 8 .: Enhanced Metafile

Clipboard format 9 .: DIB V5

Share this post


Link to post
Share on other sites

I'm guessing that data is available in multiple formats. Just select one format with _ClipBoard_GetData, maybe one of the Paint Shop formats?

Share this post


Link to post
Share on other sites

I think I'm in over my head! :)

I thought maybe it would be just copying a chunk of data and then being able to move it back to the clipboard later. I can put the data back... but if there's 9 formats how do I know what to put it back as? In the case of PSP fine... but what if it's copying from a program I've never encountered before.

Share this post


Link to post
Share on other sites

but what if it's copying from a program I've never encountered before.

I guess you then need to enumerate the formats and see if there are any that you can use. It looks like DIB and BMP are most likely to be available.

Share this post


Link to post
Share on other sites

Is there a way to determine what format a program would expect?

Let's say I copy something from Excel and then want to paste it into Outlook. What does Outlook want it as? Or then I want to open GIMP and paste something into some freeware icon editor. What would the icon editor expect?

I don't fully understand how the clipboard works. I thought each program would probably decide if it could read the data on the clipboard or not.

Share this post


Link to post
Share on other sites

Is there a way to determine what format a program would expect?

I'm don't know enough about how clipboard works to answer that

Let's say I copy something from Excel and then want to paste it into Outlook. What does Outlook want it as?

Both being MS apps you wouldn't expect any problems with any of the enumerated formats

Or then I want to open GIMP and paste something into some freeware icon editor. What would the icon editor expect?

I'm guessing BMP or DIB

I thought each program would probably decide if it could read the data on the clipboard or not.

I think your right, perhaps someone who knows more can post an answer

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Hello, just read about your problem...Maybe this helps a bit...Press start,run and type clipbrd

Then press ok and see the normal clipboard in action, try copying files, images and if it helps you let me know!

Old thread i suppose...

Edited by AoRaToS

s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

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