Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [DllImport("user32.dll", SetLastError = true)]
- private static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
- [DllImport("user32.dll")]
- public static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int Y, int cx, int cy, int wFlags);
- [DllImport("user32.dll")]
- public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
- [DllImport("user32.dll")]
- public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
- Eventlogging = "Модуль Командная строка: инициализация запуска cmd";
- ValueCommandLine.StatusRunCmd = true;
- ProcessStartInfo Info = new ProcessStartInfo();
- Info.Arguments = "cd c:\";
- Info.FileName = "cmd.exe";
- Process p = new Process();
- p.StartInfo = Info;
- p.Start();
- MainForm.ValueCommandLine.ProcessCmdID = p.Id;
- Thread.Sleep(1000);
- IntPtr hostHandle = p.MainWindowHandle;
- ValueCommandLine.ProcessHandle = p.MainWindowHandle;
- SetParent(hostHandle, panel6.Handle);
- SetWindowPos(p.MainWindowHandle, 0, panel6.Location.X - 20, panel6.Location.Y - 68, panel6.Size.Width + 20, panel6.Size.Height + 40, 0x0040);
- private void panel6_Resize(object sender, EventArgs e)
- {
- SetWindowPos(ValueCommandLine.ProcessHandle, 0, panel6.Location.X - 20, panel6.Location.Y - 68, panel6.Size.Width + 20, panel6.Size.Height + 40, 0x0040);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement