Introduction to WIN32 Development (25): monitoring clipboard

Source: Internet
Author: User
Tags win32

Since Guo and Rong son leave Peach Island, the island is relatively quiet recently, there is a "front door cold horse sparse" feeling. So, old evil took out "nine yin Canon" serious reading, while using Thunder download classic drama "Hanvuda" night before bedtime, old evil always is good at the ancient Saints learn.

We know that the Thunderbolt has a function of monitoring the Clipboard, if you find that you copy the contents of the Clipboard contains the following Thunderbolt download address format pop-up new Download Task window.

Maybe we also want to join in the application of this XX function, in fact, it is not difficult, really, I use the personality of the old urchin to ensure that the function is gray often simple.

We need to finish two steps.

1, call the Addclipboardformatlistener function, specify which window is qualified to capture the Clipboard content update message.

2, processing wm_clipboardupdate messages, when the contents of the Clipboard changed, the message handler will receive this message notification.

I believe that you must have thought of the realization of the idea. Oh, I have always been very confident of the understanding of everyone, so, sometimes I deliberately do not say so understand. In fact, we learn programming, can not be any problem to rely on other people to help solve the problem depends on their own to solve the road.

Today old Evil does not use C + + to do this example, with what? VB, oh, in fact can also, just a lot of conceited people do not look at VB, very sad; Or don't, or the old urchin will curse. or in C #, one of its syntax conforms to the C style, and secondly it can also invoke the Win32 API.

It is estimated that some people will wonder, write Win32 program is not to use C + +? Why use C #? Oh, very simple, because I am old evil, originally I practiced the matchless martial arts is "heterodoxy", not to mention, these days, people are not the mainstream for the glorious. Today old evil also want "glorious" a back, lest Rong son said I old, Kung fu not.

Moreover, I consulted the relevant lawyers, the law does not stipulate that the WIN32 procedures must be used in C + +, and WinForm is essentially Win32, and others WinForm can do Win64 it.

Because today's task is very simple, so I could not help to take out the best skill-bragging, yes, bragging good ah, life is rarely a few back blowing.

Before processing wm_clipboardupdate messages, be sure to call the Addclipboardformatlistener function, which is the prototype:

*  C + +
/BOOL winapi Addclipboardformatlistener (  
  _in_  hwnd hwnd  
);

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.