Results 1 to 8 of 8

Thread: Clipboard

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089

    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?

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    You can store the data in Variables and then put it back in the clipboard.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    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.

  4. #4
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    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.

  5. #5
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986

    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.

  6. #6
    Guest
    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

  7. #7
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    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.

  8. #8
    Guest
    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
  •  



Click Here to Expand Forum to Full Width