Determining order of windows opened

Through the windows API I can get the list of all windows which are currently open but it seems that the IntPtr's don't come back in any specific order. I was wondering if there is a way to get the windows in the order in which they were opened. For instance if I open 2 IE windows followed by a notepad window, when I retrieve the list of windows I would like the 2 IE windows to be before the notepad window. I am doing this in C#.

Answers


Handle values are obfuscated pointers, you cannot rely on their value at all. And they get recycled.

The long distance shot is GetWindowThreadProcessId() to get the ID of the thread that owns the window. OpenThread() to get a handle to it. GetThreadTimes() to find out when that thread was created. CloseHandle() to clean up. The result is however but a guesstimate, do avoid wanting to ask such a question. Visit pinvoke.net for the declarations.


Need Your Help

Set MKMapView region to center on two annotations

objective-c mkmapview mkannotation

I'm looking for some help with finishing some code on setting the region on a MKMapView based on the current location annotation and an annotation I have set.

What is the name of cookie-like creature on git homepage logo

git cookies image

For years I suffered from a question of what is the name of creature, that looks like a cookie, and located at git homepage header logo. And are there any pictures of same creature? :)

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.