I have a process foo.exe that creates a process bar.exe with the CreateProcess function. I want (in foo.exe) to enumerate the controls of a window created in bar.exe and for that I (assume that I) need the window HWND.
I know all the window classes in bar.exe, and that bar.exe only creates one window for each class at a time, so I can use the class names to find the window I want.
But what function should I use to enumerate the windows in another process? I'm looking for something that take a process handle or PID (both returned by the CreateProcess function) and an EnumProc callback procedure. Should I find bar.exe's thread ID (it is a single-threaded application) and use that with the EnumThreadWindows function?