Results 1 to 6 of 6

Thread: Is there an alternative to WM_DRAWCLIPBOARD for catching Cut,Copy and Paste ?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2013
    Posts
    658

    Is there an alternative to WM_DRAWCLIPBOARD for catching Cut,Copy and Paste ?

    Hi dear forum,

    Is there an alternative to SetClipboardViewer , subclassing the wiondow and then intercepting the WM_DRAWCLIPBOARD msg ?

    Is there a way by using the OLE clipboard instead of the Legacy clipboard ?

    Regards.

  2. #2
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,666

    Re: Is there an alternative to WM_DRAWCLIPBOARD for catching Cut,Copy and Paste ?


  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2013
    Posts
    658

    Re: Is there an alternative to WM_DRAWCLIPBOARD for catching Cut,Copy and Paste ?

    Quote Originally Posted by Eduardo- View Post
    Thanks Eduardo.

    Unfortunately, using AddClipboardFormatListener and then monitoring the WM_CLIPBOARDUPDATE message is next to useless as it doesn't differenciate between Copying, cutting or pasting data.

    Also, the message cannot be intercepted in order to abort\prevent the clipboard operation.

    Regards.

  4. #4
    PowerPoster
    Join Date
    Feb 2017
    Posts
    5,666

    Re: Is there an alternative to WM_DRAWCLIPBOARD for catching Cut,Copy and Paste ?

    I saw that there are three methods listed there:

    There are three ways of monitoring changes to the clipboard. The oldest method is to create a clipboard viewer window. Windows 2000 added the ability to query the clipboard sequence number, and Windows Vista added support for clipboard format listeners.
    I didn't test anyone, but all three are useless?

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Is there an alternative to WM_DRAWCLIPBOARD for catching Cut,Copy and Paste ?

    Quote Originally Posted by JAAFAR View Post
    Thanks Eduardo.

    Unfortunately, using AddClipboardFormatListener and then monitoring the WM_CLIPBOARDUPDATE message is next to useless as it doesn't differenciate between Copying, cutting or pasting data.

    Also, the message cannot be intercepted in order to abort\prevent the clipboard operation.

    Regards.
    I'm not that familiar with using the OLE clipboard, but are you saying that it can differentiate between copy, paste, & cutting, and preventing applications from accessing it?

    FYI: The OLE clipboard uses an IDataObject interface.
    Last edited by LaVolpe; Oct 19th, 2019 at 07:25 AM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2013
    Posts
    658

    Re: Is there an alternative to WM_DRAWCLIPBOARD for catching Cut,Copy and Paste ?

    Quote Originally Posted by LaVolpe View Post
    I'm not that familiar with using the OLE clipboard, but are you saying that it can differentiate between copy, paste, & cutting, and preventing applications from accessing it?

    FYI: The OLE clipboard uses an IDataObject interface.
    Hi,

    No. I am not saying it can or it can't as I don't even know how to use the oleclipboard... I just thought I would post this question in the forum in case anyone knows.

    The only thing I know is clearing the clipboard by passing a 0 instead of a pointer to the IDataObject:
    Code:
     Declare Function OleSetClipboard Lib "OLE32.DLL" _
        (ByVal theDataObject As Long) As Integer
        
    Sub Test()
        OleSetClipboard (0)
    End Sub
    Thanks.

Tags for this Thread

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