Home > Software engineering >  How to operate the other Windows programs? Will you please by handle to its PostMessage?
How to operate the other Windows programs? Will you please by handle to its PostMessage?

Time:10-02

Want to use MFC to write a program to operate one another, and actions include: to input user name password input box, simulation of the mouse to click the login button, click through a series of export Excel data, after a successful login time 1 hour operation time,
Consult everybody a great god, and how to implement to handle its PostMessage can realize?
Could you recommend a related open source project?

CodePudding user response:

A corresponding window handle to send messages, or SendMessage PostMessage

A simulation of the mouse and keyboard operation, such as the program first moved to the specified location, and then simulated mouse clicks and keyboard input

CodePudding user response:



reference 1st floor paschen response:
a corresponding window handle to send messages, or SendMessage PostMessage

A simulation of the mouse and keyboard operation, such as the program first moved to the specified location, and then simulated mouse clicks and keyboard input


Can go into more detail about it?

CodePudding user response:

refer to the second floor annjoy303 response:


Quote: refer to 1st floor paschen response:

A corresponding window handle to send messages, or SendMessage PostMessage

A simulation of the mouse and keyboard operation, such as the program first moved to the specified location, and then simulated mouse clicks and keyboard input


Can go into more detail about it?


How are you going to detail, the function usage can look to the MSDN, a few words say again

CodePudding user response:

Clear tell you, cross-process communication there are a lot of ways,
In addition to the message delivery, have a clipboard mail slot socket pipes, etc., in addition to the message delivery, several other ways need make agreement

CodePudding user response:

Can encapsulate the news of the application, the premise is the application code is written by you

CodePudding user response:

SPY + + monitoring applications, manual operation, look at what you need if there is a corresponding message support operations

CodePudding user response:

If the program title is changeless,
HANDLE HANDLE=: : FindWindow (NULL, strCaption);
If (handle!=NULL)
: : PostMessage (handle, WM_TEST, 0, 0);

If the program title changed
Use Spy++ view window class name
HANDLE HANDLE=: : FindWindow (strClassName, NULL);
If (handle!=NULL)
: : PostMessage (handle, WM_TEST, 0, 0);
If the window class name is common, have to modify the window class name, vitamin c or c + + builder window class name instead see my blog, other to baidu,

CodePudding user response:

Is the use of the function of other programs, rather than to operate her UI.

CodePudding user response:

You can send me some information about transfer integer is, contributed to the news of the string argument can't process have boundaries

CodePudding user response:

FindWindow/FindWindowEx if you can get another process window () the child controls in the window, you can send messages to them SendMessage/SendMessageTimeout/PostMessage,
If not, you can use to simulate the keyboard and the mouse to click way keybd_event mouse_event/SendInput ();

CodePudding user response:

Something I do
The method of using injection
There are many online related information
For example, http://blog.csdn.net/fysy0000/article/details/6659986

CodePudding user response:

FindWindow find corresponding window handle, then PostMessage/SendMessage sends a message to insert data, such as
But for Windows programs is not a standard window, you need to other methods, such as injection,

CodePudding user response:

http://www.autohotkey.com
  • Related