void App_Startup(object sender, StartupEventArgs e) { if (e.Args == null || e.Args.Length < 1) { return; } Instance = this; if (e.Args[0].Equals("c"))//clip { this.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown; if (e.Args.Length > 1) { this.infoPath = e.Args[1]; } ClipWindow clipWindow = new ClipWindow(); System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(clipWindow); clipWindow.Show(); //clipWindow.Activate(); SetForegroundWindow(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle); } else if (e.Args[0].Equals("s"))//settings { if (e.Args.Length > 1) { this.ClipoffPath = e.Args[1]; } (new SettingWindow()).Show(); } else if (e.Args[0].Equals("a"))//about { } }
public void BeginClip() { ClipWindow clipWindow = new ClipWindow(); clipWindow.Topmost = true; System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(clipWindow); clipWindow.Show(); clipWindow.Activate(); }