Beispiel #1
0
 public void Despawn(Dock dock)
 {
     this.Docks.Remove(dock);
     this.Next();
     if (this.OnDespawn != null)
         OnDespawn(dock);
 }
Beispiel #2
0
        public Component(Dock dock, HarborService harbor, string command, string args = "")
        {
            _harbor = harbor;
            _dock = dock;

            var psi = new ProcessStartInfo(command)
            {
                Arguments = args,
            };
            Process = Process.Start(psi);
            Process.EnableRaisingEvents = true;
            Process.Exited += (a,b) =>
            {
                _dock.Despawn(this);
            };
            Process.WaitForInputIdle();
            this.Position(0, 0, 0, 0);
            SetParent(Process.MainWindowHandle, _harbor.Handle);
            var style = GetWindowLong(Process.MainWindowHandle, GWL_STYLE);
            style = style & ~WS_CAPTION & ~WS_THICKFRAME & ~WS_EX_APPWINDOW & ~WS_EX_TOOLWINDOW;
            SetWindowLong(Process.MainWindowHandle, GWL_STYLE, style);
            SetWindowLong(Process.MainWindowHandle, -20, (GetWindowLong(Process.MainWindowHandle, -20) | WS_EX_TOOLWINDOW) & ~WS_EX_APPWINDOW);
        }
Beispiel #3
0
 public Dock Spawn()
 {
     Index = this.Docks.Count;
     var dock = new Dock(this);
     this.Docks.Add(dock);
     this.Render();
     return dock;
 }