Click through the mouse to achieve the background click, applicable to any window! [Background Mouse] [Snow and snow]

Source: Internet
Author: User

Maybe you are attracted by this title!
I haven't posted a post for a long time. I want to seduce everyone's appetite. Of course, some people have already guessed the principle!
Now, I want to learn the principles, or I will be bored!
 
Many games currently do not support Background messaging and mouse. It is really not easy to implement. If you do not know what to inject dll and what to hook, you can simply find a different path.
 
Let's talk about the principles below (the following playbooks can be used in an unrealistic way, and I will not hide them. I can't help myself with my conscience when I see so many replies)
 
First, all the windows covered above the window to be clicked are changed from general mode to stick mode.

SetWindowPos temp,-1, 0, 0, 0, 0, 1 Or 2 'top

Then it becomes the mouse penetrating mode of the layered window.

  1. Ret = GetWindowLong (temp, GWL_EXSTYLE)
  2. Ret = ret Or WS_EX_TRANSPARENT Or WS_EX_LAYERED
  3. SetWindowLong temp, GWL_EXSTYLE, ret
  4. SetLayeredWindowAttributes temp, 0,255, LWA_ALPHA

In this way, only the window you set will be displayed. The window covered above will only be visually displayed, so that you can click in the background!

Why should I stick it to the top?

A: If it is left unpinned, the selected window will be activated when you click it, and the window will be automatically prefixed. It will be boring if you change to the front-end.

Why do we need to pin it to the top and then layer it?

A: This is a test many times. If it is first layered and then topped, it cannot be implemented.

How do I obtain the handle covering the window above?

A: Get a layer. After the layer is layered, WindowFromPoint (X, Y) is ignored and transparent.

To sum up, the above is the main API used. The layered API can only comment on the video screen and dX screen. Because I really don't understand it, the video will turn black, the DX screen will be blurred. My solution is something someone once mentioned. It's okay to drag any point in the window out of the screen.

The following is a plug-in for you to practice. Maybe you will have a better idea and don't enjoy it alone!


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.