Depending on what you are wanting to do, a
shell extension[
^] may be the best thing. This will integrate your code directly into Windows Explorer, and allow you to do things such as add a toolbar or a column to the file view.
If you just want to know what they are looking at, without changing the Windows Explorer experience, then this would not be a good way.
This may or may not be the best way, but check out
my answer[
^] to a similar question a few days ago. Windows Explorer and Internet Explorer are very similar in a lot of respects, this code will find the URL of all Windows Explorer and Internet Explorer windows. If the URL starts with
file://
then it is a Windows Explorer window.
As I said, there may be a better way, but since no one has answered yet, I thought I'd give you this.