Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

C# FindWindow() - Get multiple windows.

$
0
0

Hi all,

I'm looking to get an array of windows with a certain class name, so it appears that FindWindow() is just what I'm looking for. The problem is I'm not quite sure of how to get multiple windows with it. A small background follows.

I've been using Process.GetProcessesByName("test") to get a list of processes which have the right window name, but I've had to change the window name in each instance of the test program for the purpose of identification. The next step is therefor for me to move to another method. The alternative I know of is Process.GetProcesses(), followed by a loop to find the processes by class name (which I think I can do). Unfortunately this won't work as I want my application to be 32-bit and I can't access 64-bit applications from my 32-bit application. On top of that, it seems wasteful to run that loop when I could be directly finding the processes I'm looking for.

So, anyone have any ideas as to how I could generate a function which will find the windows with the class name until there are none left?

Thanks


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>