• Get which process/window is actually visible in C#
    13 replies, posted
Hello, I have a list of all open windows, the ones in the windows taskbar. What I want to do is to remove the ones that are not visible from the list. What I mean is, if a window is hidden by another one, it should not be in my list. I've been searching google for the past two days without success... Any ideas? [editline]26th March 2011[/editline] I can get the location and size of each process, so getting the last time a process was used/idle time would work too...
What do you mean by "visible"? It has focus? Or it can be seen by the user?
[QUOTE=Ortzinator;28820224]What do you mean by "visible"? It has focus? Or it can be seen by the user?[/QUOTE] If it can be seen by user... If it's hidden by another window or not... [editline]26th March 2011[/editline] anyone?
As in a bigger window covering it or something?
[QUOTE=Quark:;28826349]As in a bigger window covering it or something?[/QUOTE] yes! [editline]27th March 2011[/editline] I take a screenshot of full screen, and I want to know which windows are visible in this screenshot...
Afaik every visible window has a title. Check if the window has a title?
[QUOTE=Dj-J3;28835936]Afaik every visible window has a title. Check if the window has a title?[/QUOTE] That's not what I mean, read carefully...
Do you mean you want to get a list of all processes that have created a window and then remove the ones that are minimized? If so, I guess that this could be achieved with the use of winapis.
Example: [img_thumb]http://sharpmindprojects.com/captures/rahiufls.png[/img_thumb] So, chrome, mozilla (3 windows), skype and steam are open, but only one window of mozilla and steam are visible...
Try checking which windows are minimized.
[QUOTE=Quark:;28837730]Try checking which windows are minimized.[/QUOTE] but what if they're not minimized? Just hidden...
You might wanna check this out: [url]http://www.codeproject.com/KB/dialog/FindWindow.aspx?msg=3262771[/url]
[QUOTE=NoFaTe;28838491]You might wanna check this out: [url]http://www.codeproject.com/KB/dialog/FindWindow.aspx?msg=3262771[/url][/QUOTE] just found that one myself. Thanks, though!
To be honest, I don't think it's possible. The only way I see you would have to do it is to compare the size and window locations of every window. Along with the Z index the window has. But I have no clue how to access the Z index.
Sorry, you need to Log In to post a reply to this thread.