Hi,
I have been trying to wrap my head around how to control child windows in other applications. I have several examples of code from various sources and some of it works to control the main windows but im at a loss to figure out how to get control of the child windows.
The object is simply to close the child windows of a different application. I don't need to be able to close the main window.

I guess I just need an idea of how to call the commands to get the window and close it... any suggestions?

Maybe some examples.?

I would appreciate any help, and I have tried various approaches to this issue like using send keys, which are nice if i know exactly whats going to come up, but i need something that could police an application to close the child windows it produces.

Thanks for any help.

Assumming you have 2 applications, lets say A and B.
Application A has a main window and some children windows that can be opened or not.
From application B you want to be able to know if is opened, and to close, any child window of application A.
If my assumption is right, application A needs to be compiled as COM+ and expose some public properties and methods to be called from external applications, designed for those purpose. Maybe a wrapper is also needed.
Then application B needs to include a reference to application A wrapper, and create the application A object inside the application B. Then, using the public exposed methods and properties you should be able to close the desired windows.

For som example, you can take Excel. See http://msdn.microsoft.com/en-us/library/aa188489(v=office.10).aspx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.