Using c# I'm trying to set the size and position of a Windows Explorer window I'm starting up with my program. I've looked a little bit into SetWindowPos but I don't think that works too good for Windows Explorer. I've come across this bit of code and I think it will do what I need but I don't know how to use it.
SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
string filename;
ArrayList windows = new ArrayList();
foreach (SHDocVw.InternetExplorer ie in shellWindows)
{
filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
if (filename.Equals("explorer"))
{
ie.WindowSetHeight += Ie_WindowSetHeight;
Console.WriteLine(ie.HWND.ToString());
}
Console.ReadLine();
}
Correct me if I'm wrong, but this code snipped loops through all of the windows in SHDocVw.ShellWindows and prints the HWND of all of the "explorer", which is to say all of the windows explorer windows to the console. Upon looking into the different parts of ie.
I come across "WindowSetHeight","WindowSetWidth","WindowSetTop" and 'WindowSetResizeable". Just judging by the names these sound like exactly what I would like to use, but when I tried to set the value of them it says they need to be followed by either +=
or -=
and I can't make sense of where to go from there. Any help would be greatly appreciated