I need to see the component type, meaning the name of the class that was programmed, of a clicked control in another process. I need the type so I can react to the clicked control and then do some Automation tasks. Right now I am doing the following: 1. I FindWindow() from Win32 to find the main window handle of the process. 2. Then, I get call EnumChildWindows(), also from Win32, and get the window handles of all the children of the main window handle. 3. Now it gets tricky. When I call GetClassName(), it returns WindowsForms10.STATIC.app [...] since the controls I am trying to read are custom.
How can I get the type of the clicked control using the window handles from EnumChildWindows() ? Is what I am trying to do even possible? I have been looking into using SendMessage() from Win32 to the process but it seems that there is no system defined message that could help.