Is there a way to detect and store the location and size of all open windows, as well as their state (Minimized, Maximized etc)
I've never developed anything that gets information from the actual operating system in this way. Does it require a call to a Windows API and involve unmanaged code?
If this is not clear please comment and I will try to elaborate.
Call EnumWindows to loop through all the windows, then call GetWindowPlacement to get out the information. It will require PInvoke to Windows API, but it's not that difficult, just can find all the information at the PInvoke site.
Btw, here's a codeproject article for finding a specific window and getting/setting the show state of it, might be a good starting point (the code is in VB.Net, but you could probably just use one of the online VB.Net to C# converters if you don't know VB.Net)
Yes, you will begin with EnumWindows: http://msdn.microsoft.com/en-us/library/ms633497.aspx
See the Window Functions list for methods to gain access to the information you want: http://msdn.microsoft.com/en-us/library/ff468919.aspx
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