Solved

Detect Changes to Clipboard

Posted on 1998-11-24
3
479 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month4 days, 3 hours left to enroll

630 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