Wang

Wang

  • NA
  • 1
  • 0

how to open a folder in a designated location

Nov 24 2006 12:14 AM

I saved the windowstate of the other application, such as a folder.
 when I reopen it, I use the following code:
////////////////////////////////////////////////////////////////////
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "explorer.exe";
p.StartArgument  = "c:"
p.Start();

Application.DoEvents();

SetWindowPos(new HandleRef(null, p.MainWindowHandle), new HandleRef(null, IntPtr.Zero), 10, 10, 0, 0, 0x15);
//////////////////////////////////////////////////////////////////////

but when it run to "Application.DoEvents();", the p exited, then p cann't get MainWindowHandle.
so the method failed.

any other method?