public void Open_File(string path)
{
FirstFrame = 0;
IntPtr hToolStrip = win32API.FindWindowEx(hWnd, IntPtr.Zero, null, "toolStrip1");
if (hToolStrip == IntPtr.Zero)
{
return;
}
int p_processid;
win32API.GetWindowThreadProcessId(hWnd, out p_processid);
//click open
int x = 28, y = 10;
win32API.PostMessage(hToolStrip, win32API.WM_LBUTTONDOWN, 0, (y << 16) + x);
win32API.PostMessage(hToolStrip, win32API.WM_LBUTTONUP, 0, (y << 16) + x);
Thread.Sleep(1000);
win32API.EnumWindows(new win32API.EnumWindowsProc(EnumWindowsFunc), p_processid);
IntPtr hOpen = hWindow;
// find folder
IntPtr hTemp = GetWindowChildBFSByIndex(hOpen, 2);
IntPtr hEdit = GetWindowChildDFSByDepth(hTemp, 2);
win32API.SendMessage(hEdit, win32API.WM_SETTEXT, IntPtr.Zero, path);
// button ok
IntPtr hOpenButton = GetWindowChildBFSByIndex(hOpen, 5);
win32API.SendMessage(hOpenButton, win32API.BM_CLICK, 0, 0);
}