473,545 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can I control other process UI and input some data ?

Hi

How can I control other process UI and input some data value like input edit
box or click button controls ?

Is there some good sample code and tool to help me ?

Thank you .
Oct 15 '08 #1
2 1130
"Kid" <Ki*@discussion s.microsoft.com wrote in message
news:CC******** *************** ***********@mic rosoft.com...
Hi

How can I control other process UI and input some data value like input
edit
box or click button controls ?

Is there some good sample code and tool to help me ?

Thank you .
There is no all-purpose solution but many things can be done by sending
standard windows messages to HWNDs in the other process. First use the
Spy++ tool to find the IDs of the controls you are interested in. In your
program, find the HWNDs of these controls by using FindWindow and
EnumChildWindow s. As you enumerate the child windows use GetClassName and
GetWindowLong with GWL_ID to recognize and store the child HWNDs you need.

You can input text to an edit control with SendMessage(... WM_SETTEXT...).
You can click controls by sending the same message to the parent dialog that
the control sends, such as WM_COMMAND with BN_CLICKED.

--
Scott McPhillips [VC++ MVP]

Oct 15 '08 #2
"Kid" <Ki*@discussion s.microsoft.com wrote in message
news:CC******** *************** ***********@mic rosoft.com...
Hi

How can I control other process UI and input some data value like input
edit
box or click button controls ?

Is there some good sample code and tool to help me ?

Thank you .
The most reliable way is if the other process is in the foreground, you can
simulate keystrokes/mouse events using SendInput().

-- David

Oct 16 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
4863
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE) p.stdin.write("hostname\n") however, it doesn't seem to work. I think the cmd.exe is catching it.
7
6180
by: Dave | last post by:
I have two forms, Form1 and Form2. From Form2, how do I reference the value in a control on Form1? Or perhaps a more specific question: Form1 contains a textbox with the value of 10. This form is hidden. Form2 is active and a user enters a value of 2 into a blank text box. How can I add this value to the textbox in Form1 so that when...
0
2462
by: Raven Jones | last post by:
Heya all, I'm working on a web-based application (using ASP.NET and C# on .NET 1.1.4322, supporting only IE6 for Windows) that allows for file uploads. Screen real estate is at a premium, so I want to set its style to "display: none;" and interact only with the standard file upload dialog (which can be summoned by firing the click() method...
9
2718
by: Charts | last post by:
I use VS2005 to build a asp.net 2.0 project. I want to be able to click a button on the page and have a dialog window appear where I can navigate the folders to get hold of a file path to load data from the file to a SQL Server database. I imported System.Data.Forms which gives me access to the FolderBrowseDialog control. The first problem is...
14
14612
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control so I get the ObjectDataSource. No problem ..... ObjectDataSource src = .... //is ok i have it
2
5053
by: =?Utf-8?B?SXJmYW4=?= | last post by:
Hello, It may be a repeated question but I don't find the solution to the situation that I encounter in it. My application is monitoring another application that is built in VB6. The application monitors all the textboxes and other input & display controls on that application. The data from the textboxes and listboxes are retrived fine....
2
13255
by: Martin M. Pedersen | last post by:
Hi, I have a program where I read a lot of user data. How can I handle the case where the user press control-d ? Is it possible to disable control-d or re-open the cin ? I have made a small example which hopefully shows my problem. Regards Martin
0
1269
by: SteveBark | last post by:
Can anyone point me in the right direction as to what control structure I should put in place for the following requirement. I have an Access Server which I have 30 modems connected to. I need to utilise these modems to dial out and collect data from remote devices. The plan is to write a perl script that will process a list of devices to...
3
5245
by: Allen Chen [MSFT] | last post by:
Hi Richard, Quote from Richard================================================== However I also want to be able to remove the panes. I have tried to include this, but find that when I first add the pane the remove event does not get handled, though thereafter it is handled without problems....
0
7398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7805
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7752
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5969
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3449
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.