Results 1 to 6 of 6

Thread: How to clear the Clipboard using VB?

  1. #1
    Join Date
    May 2009
    Posts
    258

    How to clear the Clipboard using VB?

    Hello friends,
    I am facing a problem while clearing the clipboard using the Visual Basic. I also don't know what are the formats that are supported by the clipboard. I have tried to search in the Web but I didn't find any suitable solution. So thought that posting you guys would help me.!! Please tell me how to clear the Clipboard using the VB? Also please explain me the formats that are supported by the clipboard.!!

  2. #2
    Join Date
    Mar 2008
    Posts
    672

    Re: About the Clipboard

    Since you don't know about the formats that are supported by the clipboards, I think that you should know more about it before looking at the code for clearing the clipboard. The clipboard is the main module for exchanging data in Windows. It is a common area for storing descriptors data by which applications access to exchange formatted data. The clipboard can contain different formats data with corresponding data descriptors, all representing the same data but in different formats.

  3. #3
    Join Date
    Mar 2008
    Posts
    349

    Re: Formats supported by the clipboards

    Windows provides several predefined data formats for exchanging data. The following list describes the most common formats :
    • BITMAP - Specifies a device-dependent bitmap and also specifies a DIB Device Independent Bitmap.
    • DIF - Specifies that the data is in format DIF Software Arts
    • OEMTEXT - Specifies a string in the table
    • OEM character *
    • METAFILEPICT - Specifies an image structure metafile

    Windows supports two text formats: TEXT and OEMTEXT.

  4. #4
    Join Date
    Aug 2006
    Posts
    235

    Re: How to clear the Clipboard using VB?

    There are also some things that you will have to keep in mind. The data in the clipboard can be any size. The size of memory allocated to the clipboard is determined by the application copy to the clipboard, and one that receives Data from the Clipboard. You can also receive a message error if an application does not allocate enough memory. As said earlier by the 'Warner' Windows supports two text formats: TEXT and OEMTEXT. TEXT is default format used by the clipboard, is OEMTEXT format used for non-Windows applications.
    3.2 (northwood)
    2gig ram
    ATI AIW X800xt 256mb
    Gigabyte GA-8knxp 875p Chipset
    Optiwrite 8X DVD Burner
    Win XP PRO Sp2 (Works Perfectly)
    2 SATA Raptor 74gig Raid 0
    2 7200 IDE 320gig HD

  5. #5
    Join Date
    Aug 2006
    Posts
    227

    Re: How to clear the Clipboard using VB?

    The following sample of the coding would be useful for clearing the clipboard in VB :
    Code:
    Option Explicit 
      Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long 
      Private Declare Function CloseClipboard Lib "user32" () As Long 
      Private Declare Function EmptyClipboard Lib "user32" () As Long 
    
      Public Sub ViderPP () 
      'Open the clipboard 
      OpenClipboard 0 & 
      'We empty the clipboard 
      EmptyClipboard 
      'Close the clipboard 
      CloseClipboard 
      End Sub
    I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame.

  6. #6
    Join Date
    Jul 2006
    Posts
    286

    Re: How to clear the Clipboard using VB?

    The My.Computer.Clipboard.Clear Method clears the Clipboard. Because the Clipboard is shared by other processes, clearing it may have an impact on those processes. You will have to use the Clear method, as follows :
    Code:
    My.Computer.Clipboard.Clear()
    IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....

Similar Threads

  1. Clipboard Error "Cannot Empty Clipboard!"
    By Deabelos in forum MS Office Support
    Replies: 7
    Last Post: 04-02-2013, 04:09 PM
  2. Add applescript to command + v to clear clipboard
    By Amy Adams in forum Operating Systems
    Replies: 6
    Last Post: 28-07-2010, 01:05 AM
  3. Replies: 2
    Last Post: 16-01-2010, 04:22 AM
  4. Clear Clipboard for Vista
    By Kurtz in forum Windows Software
    Replies: 3
    Last Post: 29-05-2009, 08:59 AM
  5. Clipboard Viewer
    By JamesJ in forum Vista Help
    Replies: 7
    Last Post: 13-05-2007, 07:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,710,841,616.23919 seconds with 16 queries