How to detect if the file manager is open...

CDBob2000

Member
Joined
May 23, 2006
Messages
8
Programming Experience
1-3
Hi All!

I am writing a program to update one of the many third party security program that I run to protect folks from the bad boys on the internet,,,

I knew that the internet explorer had to be closed then reopen before the program would grab the new setting... and I found the code to detect if IE is running so I can say close it when ready,, But along the way I found that the file manager has to be closed along with IE,,, then restarted,,

Upon digging I found that the file manager is opened under the dllhost.exe
but I can't seem to find any example on how to drill out what I need,,,

I found this line that will tell me if the dllhost is running
VB.NET:
Dim localByName As Process() = Process.GetProcessesByName("dllhost")

I'm playing with VB.net under the M$ visual studio 2005 pro,,,

how do I drill out the if the File manger is running and not another application under the dllhost.exe :confused:

If there is a better way I'll go for it,,,

-------------------------------------------------------------
The problem is the words that I'm searching with are so common I'm getting two billion hits on stuff that have no relationship to what i'm looking for..........

IE was a short one
VB.NET:
Friend Function Is_IE_running() As Boolean
Is_IE_running = False
Dim myProcesses() As Process
Dim myProcess As Process
Dim strdte As Date
myProcesses = Process.GetProcessesByName("IEXPLORE")
For Each myProcess In myProcesses
strdte = myProcess.StartTime
Is_IE_running = True
Next
If MDIParent.Options_Chk_IE_Warning.Checked = True Then
Is_IE_running = False
End If
End Function

Thanks...
 
Process class isn't reliable as I can see neither for Internet Explorer or File Explorer (guess you mean this by 'file manager'?). These processes belong to a collection called Shell windows. There existed functionality to access them with the old webbrowser, but I can't find it in new vb.net.
To use this Add Reference in COM page to 'Microsoft Internet Controls' (ShDocVw.dll), here is some sample code:
VB.NET:
Sub shw()
  Dim sb As New System.Text.StringBuilder
  Dim shWin As New SHDocVw.ShellWindows
  Dim ies As SHDocVw.InternetExplorer
  For Each ies In shWin
    sb.Append(IO.Path.GetFileName(ies.FullName))
    sb.Append(vbTab)
    sb.Append(ies.LocationName)
    sb.AppendLine()
  Next
  MsgBox(sb.ToString)
End Sub
and if you don't want to give additional info, just check count:
VB.NET:
Function Shell_open() As Boolean
  Dim shWin As New SHDocVw.ShellWindows
  Return (shWin.Count > 0)
End Function
 
Last edited:
Thanks!

Just what I needed a key word to play with...:D

whooo hooooooooooooo :)

Your example is even better cause it includes both the file manager and IE ..... in one deal...... I'll go with it for now till I find out different (that is if any thing else will show up in the count that doesn't needed to be closed)

and to answer your question yes it is the windows file manager the one you get when you go right click on start button and hit explore..
Not to many folks even know it is there.. I use it all the time and have for years.. to me that is the only and best way to get around in windows,,,,

I might even put the listbox in the program
Then I can say please close these running bla bla bla
to completed the updated...

This one below shows you in a list box what the names are.......

VB.NET:
'referenced from
'[SIZE=2][COLOR=#008000]http://support.microsoft.com/default.aspx?scid=kb;en-us;176792
[/COLOR][/SIZE]Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer
ListBox1.Items.Clear()
TextBox1.Text = CStr(SWs.Count)
For Each IE In SWs
ListBox1.Items.Add(IE.LocationName)
Next
End Sub
End Class

---------------------------------------------------------------------

Whoo hooooooooooo This put the icing on the cake now it is dress up time to complete the program...

Do you know where I can get a VB.net rainman:D
 
CDBob2000 said:
and to answer your question yes it is the windows file manager the one you get when you go right click on start button and hit explore..
Not to many folks even know it is there.. I use it all the time and have for years.. to me that is the only and best way to get around in windows,,,,

i've always referred to this as windows explorer or just explorer.. it is embodied in a program called explorer.exe and has a few tasks: the first instance of explorer started on any system is responsible for drawing the task bar and initializing the system tray. after that, subsequent copies that open merely show a file browser window. the difference between Open and Explore (on a folder or start button), im sure youknow, is that the folders button is pressed by default should you choose Explore.

personally, i tend to double click my computer (i run windows xp in classic mode) as im caught into the love of the rest of what the icon does - right click for management and properties etc. I do forget that explorer is available by right clicking the start button.. i often click start.. run and type c: instead

ahhh.. the number of ways to skin this cat; it's good HCI though, to have several routes through the problem domain :) thumbs up for microsoft.
 
LOL the good old shell game by M$ allot of folks wonder how they get took by the software vendors... They kill the explorer.exe then make there scumware changes then start it back up ..

LOL I have got into the habit of using the start button cause when you use the my computer you only get the one pane... If you hit the folder button at the top that is the view I like...

I run my XP with the look and feel of windows 98SE and I shut down the useless stuff and remove the shell game explorer protection that M$ has programmed in.. And I use FAT32 cause NTFS security cramps my style ..... The M$ backup and restore stuff is a joke why use that just make a image of your hard drive ..... .. And by shuting down all the useless stuff and protection and using FAT32 I can make a straight copy of my hard drive to another hard drive folder for backup.. ... Plus I can do what I want to the files without M$ protection going no you can't.........

I could go on and on but I have to go get my stepson from work.


Thanks again.......
 
Last edited:
I run my XP with the look and feel of windows 98SE and I shut down the useless stuff and remove the shell game explorer protection that M$ has programmed in.. And I use FAT32 cause NTFS security cramps my style ..... The M$ backup and restore stuff is a joke why use that just make a image of your hard drive ..... .. And by shuting down all the useless stuff and protection and using FAT32 I can make a straight copy of my hard drive to another hard drive folder for backup.. ... Plus I can do what I want to the files without M$ protection going no you can't.........
Oh, my, god....
 
Back
Top