Click here to Skip to main content
15,789,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

Suppose there is a Third Party Application . The Technology using which the Application is build is unknown , mostly unmanaged Application.

This Application has some textboxes , Buttons , Grids on it .

When accessed using Spy++ , only the outer handle of the Form is displayed . The textboxes ,buttons , Grids dont have separate handles and the entire FORM has only one handle.

Is there a Way to Intrusively get into the Process of the Application and understand the properties of these controls , so that we can get and set values to these controls..

1 solution

Yes, of course, but only if the controls in questions are true windows, in the sense of Windows API.

Not all controls are like that. Some controls in some libraries are not implemented as window objects. They are implemented in pure graphics, using, say, GDI+, DirectX, or some other access to graphics. In such approach, some host control (panel, window) is really a window object, but inner controls are based on accessing graphics and events of this host control. Sometimes, such approach to UI is called "lightweight". In a way, such "lightweight" control simply don't exist from the standpoint of Windows API; instead they are all represented by a single host control, all at once.

If you want to drill down to the control which are real Windows API window object, you need to use… Windows API. This single method would do the most of the job:[^].

As you can see, if you only have the HWND of some top-level window, you can dig out all child windows hierarchically placed in this main window.

Share this answer
Nikesh_k 7-Aug-13 14:12pm    
On observing further it was found that the Outer Handle of the Application belonged to class "AfxFrameOrView70" , which I feel is a Visual Basic application

The handles of controls within this form wasn't accessible.

Hence checking ways to get other controls of the form.
Sergey Alexandrovich Kryukov 7-Aug-13 16:33pm    
What do you mean by "wasn't accessible"? If you try to get children HWND from the window, what it returns? NULL pointer?
Nikesh_k 8-Aug-13 7:03am    
Yes , It returned only 4 handles . There were some 15 controls within the application.
Sergey Alexandrovich Kryukov 8-Aug-13 8:56am    
Did you do it recursively? Examined those 4 handles, two, and so on?
Nikesh_k 8-Aug-13 10:11am    
I used EnumChildWinows which gave me in total 4 handles.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900