From the process address space of another app how would you get a handle to each window that it is using/displaying?
I know you can get a snapshot of all the current threads running within a process http://msdn.microsoft.com/en-us/library/ms686701(v=vs.85).aspx but I am wondering if there is a way, using the THREAD ID to then get a hwnd value that you can the test using IsWindow(hwnd), or logically if you can get a hwnd don’t you know you already have a value window? But I am wondering if this would work or if indeed it is a sensible approach?
Thanks.
You can use EnumThreadWindows to enumerate all nonchild windows associated with a thread, and then use EnumChildWindows to get all their child windows.
Alternatively, you can use EnumWindows to get all top-level windows on the desktop, and use GetWindowThreadProcessId to filter to only those associated with the process.