Home How to set the folder for an embedded Shell activeX control in winforms
 If I was just automating the shell directly as opposed it embedding it, it would look something like this : string curDir = Directory.GetCurrentDirectory(); Shell32.Shell shell = new Shell32.Shell(); shell.Explore(curDir);  However, my goal is to embed it into my windows form. This is what I have so far: So, I have added a COM reference to Microsoft Shell Controls and Automation (Shell32.dll) I have added a COM control in the winforms toolbar via choose items to the Microsoft Shell Folder View Router I have dragged the control to my form so I have access to it in a variable called axShellFolderViewOC1 My code so far looks like this : using System; using System.Windows.Forms; using System.IO; using Shell32; using AxShell32; namespace winforms { public partial class Form1 : Form { public Form1() { InitializeComponent(); string curDir = Directory.GetCurrentDirectory(); var comObject= axShellFolderViewOC1.GetOcx(); var comInterface = comObject as //what goes here? //pseudo code comInterface.Explore(curDir); } } }