2

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 1

1

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;
    }
}
1
  • 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?
    – Odys
    Commented Apr 17, 2013 at 21:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.