Solved

Detect Changes to Clipboard

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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 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…

861 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now