I’m working on a software for test automation. To get it working it need’s to ‘have a look’ on the desktop and all open windows. It needs to know which windows are open and what controls they consist of. So it has to do something similar to what Spy++ is doing (Spy++ from Visual Studio). Does anyone know how Spy ++ get’s all the information? Are there any Windows Methods one can call to retrieve information about open windows?
Share
You can use EnumWindows to get all top level windows. Within the
lpEnumFuncyou can call FindWindowEx to get child windows/controls of each top level window and then any other interesting function that gives you information you need, e.g. GetClassName, GetClassInfo, GetClientRect etc. etc. Take a look here for more