I want to be able to change the directory of an existing explorer window. Is there an api call to send a "navigate there" message to a window (perhaps with a handle to it)?
1 Answer
First, add a reference to the Microsoft Internet Control library. Then you can use the following code, assuming you already know the window handle for your explorer window:
var shellWindows = new SHDocVw.ShellWindows();
var myFolder = "C:\\temp"; // folder name you want to navigate to
var myHwnd = 0; // whatever window handle you're looking for
foreach (SHDocVw.InternetExplorer shellWindow in shellWindows)
{
if (shellWindow.HWND == myHwnd)
{
shellWindow.Navigate(myFolder);
break;
}
}
-
Seems promising, I'll try it tomorrow. Do you have any resources or documentation? Why should one search about InternetExplorer stuff whilst IE might be completely missing from the computer?– OdysCommented Apr 17, 2013 at 21:27