2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Windows.Forms;
9 using System.Runtime.InteropServices;
10 using System.Diagnostics;
12 namespace SeciControls
27 public String
LinkMessage {
get {
return linkStart.Text; } set { linkStart.Text = value; } }
46 linkStart.Visible =
false;
56 _proc.EnableRaisingEvents =
true;
60 WinApi.LockWindowUpdate(WinApi.GetDesktopWindow());
63 System.Threading.Thread.Sleep(100);
69 WinApi.LockWindowUpdate(IntPtr.Zero);
79 Seci.Helpers.MessageLogger.WriteMessage(
"CommandLineHost", err.Message);
86 Process[] procs = Process.GetProcesses();
88 foreach (Process proc
in procs)
92 if (proc.Id ==
_proc.Id)
94 if ((hWnd = proc.MainWindowHandle) != IntPtr.Zero)
113 int borderWidth = SystemInformation.Border3DSize.Width;
114 int borderHeight = SystemInformation.Border3DSize.Height;
115 int captionHeight = SystemInformation.CaptionHeight;
116 Size frameborder = SystemInformation.FrameBorderSize;
118 WinApi.MoveWindow(
_windowHandle, -frameborder.Width, -frameborder.Height - captionHeight, temp.Width - temp.X, temp.Height - temp.Y,
true);
120 if (frameborder.Width == 8)
123 this.Width = temp.Width - temp.X - frameborder.Width - 3 * borderWidth;
124 this.Height = temp.Height - temp.Y - captionHeight - frameborder.Height - 3 * borderHeight;
129 this.Width = temp.Width - temp.X - frameborder.Width;
130 this.Height = temp.Height - temp.Y - captionHeight - frameborder.Height;
133 this.MinimumSize = this.Size;
134 this.MaximumSize = this.Size;
141 int numItems = WinApi.GetMenuItemCount(hMenu);
143 for (
int i = numItems - 1; i >= 0; --i)
151 _proc =
new Process();
152 _proc.StartInfo =
new ProcessStartInfo(filepath, args);
153 _proc.StartInfo.Domain = AppDomain.CurrentDomain.FriendlyName;
154 _proc.StartInfo.ErrorDialogParentHandle = this.Handle;
155 _proc.StartInfo.UseShellExecute =
true;
156 _proc.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
195 linkStart.Visible = visible;
198 #region IDisposable Members
200 void IDisposable.Dispose()
203 GC.SuppressFinalize(
this);
206 protected override void Dispose(
bool disposing)
218 components.Dispose();
221 base.Dispose(disposing);
void proc_Exited(object sender, EventArgs e)
System.ComponentModel.IContainer components
Required designer variable.
void InitializeComponent()
Required method for Designer support - do not modify the contents of this method with the code editor...
static int SetForegroundWindow(IntPtr hWnd)
EventHandler OnProcessStartedViaLink
override void Dispose(bool disposing)
delegate void updateLinkVisibilityDelegate(Boolean visible)
void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
void linkVisibility(bool visible)
void Initialise(String filepath, String args)
void IDisposable. Dispose()
void createProcess(String filepath, String args)