private void OSXCapture_CaptureModeChanged(object sender, CaptureModeChangedEventArgs e) { switch (e.NewValue) { case Core.CaptureMode.Unknown: if (e.OldValue == Core.CaptureMode.Window) { var mw = new MessageWindow(Config.AppName, "Comming soon!"); mw.Show(); mw.Activate(); } SystemCursor.Show(); HideDragLayer(); ClearLayer(); break; case Core.CaptureMode.Drag: case Core.CaptureMode.Window: SystemCursor.Hide(); UpdateLayout(MousePosition, MousePosition); break; case Core.CaptureMode.FullScreen: break; } }
private static void ForceClose() { MouseHook.UnHook(); Keyboard.Hook.UnHook(); SystemCursor.Show(); Application.ExitThread(); }
public static void Close() { if (MouseHook != null) { MouseHook.UnHook(); Notify.Visible = false; SystemCursor.Show(); MouseHook = null; Notify = null; } Application.Exit(); }
private static void Initialize() { AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; AppDomain.CurrentDomain.ProcessExit += CurrentDomain_ProcessExit; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; Application.ThreadException += Application_ThreadException; Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Dispatcher.Init(); HotkeyManager.Init(); SystemCursor.Show(); LoadAssembly("SharpDX.dll"); LoadAssembly("SharpDX.Direct3D11.dll"); LoadAssembly("SharpDX.DXGI.dll"); ShutterPlayer = new SoundPlayer(Properties.Resources.shutter); OSXCapture = new OSXCapture(); foreach (var engine in OSXCapture.CaptureEngines) { engine.BeginCapture += ScreenCapture_BeginCapture; } MouseHook = new MouseHook(); MouseHook.Hook(); MouseHook.Filters.Add(OSXCapture); #if DEBUG HotkeyManager.Register("Force_Close", new Hotkey() { ModifierKey = VKeys.Alt, SubKeys = new[] { VKeys.Escape }, Action = new HotKeyEvent((s, e) => { Program.Close(); (e as HotkeyEventArgs).Handled = true; }) }); #endif }