C # WPF MVVM qq Password Butler project (7, the QQ login interface of the automatic input thinking analysis)

Source: Internet
Author: User

7-Analysis of the automatic input of QQ login interface

Before we begin to write the code, we have to study the QQ login interface. The QQ version number of the operation in this project is: 8.9.5 (22062)

Automatic input in C # development method has two: 1 is to get the input box control handle and then assign value, 2 is the input box control to simulate the keyboard input, like our hand hit Q number password into the program automatically help us fight the same.

So how do we get QQ input box handle? Need to use a tool: Spy + +, run Spy + + as:

About Spy + + software acquisition Methods I don't think I need to say more, search engines can download the spy.

In Spy + + This software we need to use only two features, I have already labeled,AB two places, in the B area Right-click can refresh the current desktop all program windows (this article is not required, in advance), as for A We are now starting to use.

Click A to open the Window Search window, hold down the icon with the left mouse button, move the mouse to the control that needs to get the handle to display the corresponding property information on the Search window.

The attentive classmate should be able to find that the input boxes, buttons and other controls on the WPF program cannot get to the handle, while the program on the WinForm can. It's also a C # thing. Borrow one answer: theWinForm program is the encapsulation of traditional Windows interface elements, drawn through GDI. WPF programs are completely new to the DX rendering drawing interface, and also out of reliance on traditional Windows controls

The simple thing is that WPF controls are not controls, but rather things that are drawn together with forms; The WinForm control is separate from the form. ( personal Understanding )

We go back to the point, study QQ Login Interface Why do you say this? First wait, have you ever thought, QQ login interface is to use what kind of technology realizes UI? Let's not rush to answer, just use Spy + + to try it out!

Obvious

The answer is: The QQ login interface is also the "control" form is drawn as a whole.

QQ Login Interface "Control" can not get to the handle, it seems now automatic input on Method 1 is not available, so we can only use Method 2.

So the question is, what are the criteria for using Method 2 (analog keyboard input)? Answer: Enter focus.

We need to position the input focus in the QQ number/password input box, how to locate? mouse, click the input box, OK.

At this time we need to use the " Analog mouse Operation " of the relevant technology, let the program move the mouse pointer to the QQ number input box, and then click on the input box. The problem comes, and don't talk about simulating mouse operation, how do we know the coordinates of the input box? No coordinates can not simulate the mouse to click the location of the input box ah. Don't worry, programming is omnipotent. First, we need to get a few messages to the QQ login window: 1 window handle, 2 coordinates, 3 window size. Then you can calculate the position of the input box, it is not very simple AH.

Comprehensive analysis, the QQ login interface automatic input steps should be as follows:

1, gets the login window handle;

2, get the window size;

3, get the window coordinates;

4, calculate the position of two input boxes;

5, simulate the mouse to select the input box to get input focus;

6, Analog keyboard input, QQ number, password input.

OK, this blog into the end, the next, will be the end of the project, the idea of analysis into code, learning how to use "Analog mouse operation", get window handle, analog keyboard input!

C # WPF MVVM qq Password Butler project (7, the QQ login interface of the automatic input thinking analysis)

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.