Home > Net >  Imitation QQ screenshots of automatic box for a solution
Imitation QQ screenshots of automatic box for a solution

Time:05-20

QQ screenshots of the automatic box, run into a bug, there has been no solution


I now do screenshots principle is as follows: when moving the mouse, according to the coordinates, get window handle, and then according to handle access form area size
But, because the most at the top of the desktop window handle, is itself the screenshots of the form, win32 API ChildWindowFromPointEx unable to filter a specific window handle (probably not found), but it can filter disable or hidden form, so the current form to set up the Enable=fase, but it can't trigger, MouseMove event, so let's add a mouse hook, this can be achieved with the same effect as QQ screenshots, the scheme of baidu has a source


But now the problem: the mouse hook on some Chinese computers appear problem, can't trigger when moving the mouse events, for example, because the form is disabled, cannot be closed forms (Alt + f4) and cannot operation form, lead to actual effect, is no reaction, getting stuck, because placed at the top of the form, the customer only to restart the computer to solve the


Later want to change the second scheme and don't want to use the mouse hook, so plan to capture, obtains a desktop under all forms of handle and area, and then in the MouseMove whether the coordinate points to area
But unable to get Z order window handle, unable to distinguish between before and after the cause may be selected area, a maximum form at the back of the little form

Two cannot solve problems
1. How to coordinate access to the desktop window handle, filter out the forms or the top of the form
2. When all access to the desktop window handle, can get Z order information

I used win32Api, the solution is not found, the following
GetDesktopWindow

GetWindow
GetNextWindow
GetTopWindow
GetParent
EnumWindows


ChildWindowFromPointEx
ScreenToClient

The IsWindowVisible
IsWindowEnabled

GetWindowRect

You need not the thinking of the mouse hook, recommend, thank you

CodePudding user response:

The following article recommended by CSDN intelligent, there is no reference value? He offer package in the executable file, can be run directly in the 64 win10, although the effect is not very satisfied, but also there is no mistake

CodePudding user response:

Try this GetPointWindow, if access to the son, the handle is up to the window handle,

CodePudding user response:

Refer to http://blog.sina.com.cn/s/blog_d9e258440101g2v2.html
  •  Tags:  
  • C#
  • Related