Пример #1
0
 protected override void WndProc(ref Message m)
 {
     if (m.Msg == SettingsManager.WM_HOTKEY_MSG_ID && (int)m.WParam == SettingsManager.HotkeyIds[CaptureTypes.ScreenArea])
     {
         var f = new SelectableScreenshotArea();
     }
     if (m.Msg == SettingsManager.WM_HOTKEY_MSG_ID && (int)m.WParam == SettingsManager.HotkeyIds[CaptureTypes.ScreenFull])
     {
         Screenshot.CaptureFullScreen();
     }
     if (m.Msg == SettingsManager.WM_HOTKEY_MSG_ID && (int)m.WParam == SettingsManager.HotkeyIds[CaptureTypes.VideoArea])
     {
         if (!VideoRecorder1._isRecording)
         {
             VideoRecorder1.StartRec(CaptureTypes.VideoArea);
         }
         else
         {
             VideoRecorder1._isRecording = false;
         }
     }
     if (m.Msg == SettingsManager.WM_HOTKEY_MSG_ID && (int)m.WParam == SettingsManager.HotkeyIds[CaptureTypes.VideoFull])
     {
         if (!VideoRecorder1._isRecording)
         {
             VideoRecorder1.StartRec(CaptureTypes.VideoFull);
         }
         else
         {
             VideoRecorder1._isRecording = false;
         }
     }
     base.WndProc(ref m);
 }
Пример #2
0
 public MainWindow()
 {
     InitializeComponent();
     #region Localizing
     this.Button_Diagnostics.Text     = L18n.Get("MainWindow", "Button_Diagnostics");
     this.Button_Troubleshooting.Text = L18n.Get("MainWindow", "Button_Troubleshooting");
     this.Button_Settings.Text        = L18n.Get("MainWindow", "Button_Settings");
     this.Button_Other.Text           = L18n.Get("MainWindow", "Button_Other");
     this.Button_Exit.Text            = L18n.Get("MainWindow", "Button_Exit");
     #endregion
     #region TrayApp
     TrayApp.BalloonTipIcon  = ToolTipIcon.None;
     TrayApp.Icon            = Properties.Resources.TankiToolsIcon;
     TrayApp.Text            = "TankiTools";
     TrayApp.Visible         = true;
     TrayApp.BalloonTipTitle = "TankiTools";
     var menu = new ContextMenuStrip();
     menu.Items.Add("TankiTools", Properties.Resources.TankiToolsIcon.ToBitmap(), (o, ea) =>
     {
         if (this.WindowState == FormWindowState.Minimized)
         {
             this.WindowState = FormWindowState.Normal;
         }
         else
         {
             this.Show();
         }
     });
     menu.Items.Add(L18n.Get("TrayApp", "ItemSettings"), Properties.Resources.Settings_small, Button_Settings_Click);
     menu.Items.Add(L18n.Get("TrayApp", "ItemHistory"), Properties.Resources.Mediahistory_small, OpenMediaHistory);
     menu.Items.Add($"[{SettingsManager.screenshots_fullKeys}] {L18n.Get("TrayApp", "ItemScreenshotFull")}", null, (o, ea) => Screenshot.CaptureFullScreen());
     menu.Items.Add($"[{SettingsManager.screenshots_areaKeys}] {L18n.Get("TrayApp", "ItemScreenshotArea")}", null, (o, ea) => new SelectableScreenshotArea());
     menu.Items.Add($"[{SettingsManager.videos_fullKeys}] {L18n.Get("TrayApp", "ItemVideoFull")}", null, (o, ea) =>
     {
         if (!VideoRecorder1._isRecording)
         {
             VideoRecorder1.StartRec(CaptureTypes.VideoFull);
         }
         else
         {
             VideoRecorder1._isRecording = false;
         }
     });
     menu.Items.Add($"[{SettingsManager.videos_areaKeys}] {L18n.Get("TrayApp", "ItemVideoArea")}", null, (o, ea) =>
     {
         if (!VideoRecorder1._isRecording)
         {
             VideoRecorder1.StartRec(CaptureTypes.VideoArea);
         }
         else
         {
             VideoRecorder1._isRecording = false;
         }
     });
     menu.Items.Add(L18n.Get("TrayApp", "ItemExit"), Properties.Resources.Exit_small, (o, ea) =>
     {
         SettingsManager.UnsetGlobalHotkeys();
         Program.Shutdown();
     });
     TrayApp.ContextMenuStrip = menu;
     #endregion
     Util.Main = this;
 }