Solved

Detect Changes to Clipboard

Posted on 1998-11-24
3
472 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 150 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

829 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