I need to capture particular windows of 3rd party process. I can find main window handle as Process.MainWindowHandle, but what I can use to list other windows?
I am using C# / .NET
The following functions are used to enumerate processes. Retrieves the process identifier for each process object in the system. Retrieves information about the first process encountered in a system snapshot.
Process Enumeration. All users have read access to the list of processes in the system and there are a number of different functions that enumerate the active processes. The function you should use will depend on factors such as desired platform support.
Documentation of Windows (dunno its accuracy) says that EnumWindows only enumerates top level windows. If you wish to enumerate child windows, you need to use EnumChildWindows function where you have to pass handle of parent window
Use the Win32 API EnumWindows (and if you want EnumChildWindows) Then check which process each window belongs to by using the Win32 API GetWindowThreadProcessId
.NET (C#): Getting child windows when you only have a process handle or PID?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With