Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Detect Changes to Clipboard

Posted on 1998-11-24
3
Medium Priority
?
482 Views
Last Modified: 2013-11-25
How do I, using VB4-16, detect changes to the clipboard content?  I want my application to sit in the background and be 'notified' if the user copies some text to the clipboard.  If they do, then I know how to read it and check for certain content.

Right now I am reading the text contents of the clipboard every 2 seconds, but it seems a waste of processor time, if Windows can notify me of changes.

Thanks,
Rob
0
Comment
Question by:RobCG
3 Comments
 
LVL 2

Expert Comment

by:trillo
ID: 1446689
Unfortunately you can'n. VB processed the most used windows messages and transforms them into "Events". To catch new messages you should install what is called a WindowsHook, which can't be done in VB. I would start searching for a OCX component.
0
 
LVL 4

Accepted Solution

by:
anzen earned 450 total points
ID: 1446690
Get the "free" MsgHook control from Mabry (You can get it from some shareware sites) and intercept the messages You need.
0
 

Author Comment

by:RobCG
ID: 1446691
Thanks to anzen and trillo.  I found and installed msghook and found an example of a clipboard viewer somewhere else that used msghook for detecting clipboard changes.  I now have exactly what I needed.

I still think it would be technically possible without msghook, because if I remember correctly, I saw an example of receiving drag/drop (from file manager) messages without any addon programs (vbx/ocx).  I think it checked messages then did doevents() over and over.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question