|
-
Sep 24th, 2000, 11:50 AM
#1
Thread Starter
Frenzied Member
I want to use the Clipboard in my App, but I don't want to use it for long, just transfer something. I don't want to loose all the Data that was on the Clipboard already.
Is there a good way of storing the clipboard data so I can put it back whaen I've finished?
-
Sep 24th, 2000, 12:26 PM
#2
Frenzied Member
You can store the data in Variables and then put it back in the clipboard.
-
Sep 24th, 2000, 12:35 PM
#3
Thread Starter
Frenzied Member
Sorry, I didn't make myself clear.
The problem is that you can only get data off the clipboard in Text format or bitmap format, Even if you use the API you still can't get at all the formats, and it's very difficult to know which format the clipboard data's in.
So I need a way to save it, or get the binary data out.
-
Sep 24th, 2000, 12:36 PM
#4
Frenzied Member
Hi Sam, I think you should use a variable of the variant type, so you're sure you can handle all sorts of data (a url or a 40 MB image)
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 24th, 2000, 12:42 PM
#5
Frenzied Member
Use a clipboard format recognized by Visual Basic, or a clipboard format which has been registered with Windows through the Windows RegisterClipboardFormat API function.
Have you used the RegisterClipboardFormat API? maybe that's your solution...
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 24th, 2000, 12:53 PM
#6
Here is how to tell which format the clipboard is in.
Code:
Private Sub Command1_Click()
Dim ClpFmt, Msg
On Error Resume Next
If Clipboard.GetFormat(vbCFText) Then ClpFmt = ClpFmt + 1
If Clipboard.GetFormat(vbCFBitmap) Then ClpFmt = ClpFmt + 2
If Clipboard.GetFormat(vbCFDIB) Then ClpFmt = ClpFmt + 4
Select Case ClpFmt
Case 1
Msg = "The Clipboard contains only text."
Case 2, 4, 6
Msg = "The Clipboard contains only a bitmap."
Case 3, 5, 7
Msg = "The Clipboard contains text and a bitmap."
Case Else
Msg = "There is nothing on the Clipboard."
End Select
MsgBox Msg
End Sub
-
Sep 24th, 2000, 01:01 PM
#7
Frenzied Member
Matthew, I think he wants to know if (for example) there are files on the clipboard (or are files not placed in the clipboard at copy and paste in Explorer).
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 24th, 2000, 01:33 PM
#8
The actual file is not placed on the clipboard, rather, it is a pointer to the path of the file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|