diff --git a/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.Designer.cs b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.Designer.cs index 766cb6326..84c223132 100644 --- a/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.Designer.cs +++ b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.Designer.cs @@ -22,11 +22,11 @@ private void InitializeComponent() this.timerRefresh = new System.Windows.Forms.Timer(this.components); this.btnAbort = new ShareX.HelpersLib.NoFocusBorderButton(); this.pInfo = new System.Windows.Forms.Panel(); + this.btnPause = new ShareX.HelpersLib.NoFocusBorderButton(); this.cmsMain = new System.Windows.Forms.ContextMenuStrip(this.components); this.tsmiStart = new System.Windows.Forms.ToolStripMenuItem(); this.tsmiAbort = new System.Windows.Forms.ToolStripMenuItem(); this.niTray = new System.Windows.Forms.NotifyIcon(this.components); - this.btnPause = new ShareX.HelpersLib.NoFocusBorderButton(); this.pInfo.SuspendLayout(); this.cmsMain.SuspendLayout(); this.SuspendLayout(); @@ -41,6 +41,7 @@ private void InitializeComponent() // resources.ApplyResources(this.lblTimer, "lblTimer"); this.lblTimer.Name = "lblTimer"; + this.lblTimer.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lblTimer_MouseDown); // // timerRefresh // @@ -61,6 +62,12 @@ private void InitializeComponent() this.pInfo.Controls.Add(this.lblTimer); this.pInfo.Name = "pInfo"; // + // btnPause + // + resources.ApplyResources(this.btnPause, "btnPause"); + this.btnPause.Name = "btnPause"; + this.btnPause.MouseClick += new System.Windows.Forms.MouseEventHandler(this.btnPause_MouseClick); + // // cmsMain // this.cmsMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -89,12 +96,6 @@ private void InitializeComponent() resources.ApplyResources(this.niTray, "niTray"); this.niTray.MouseClick += new System.Windows.Forms.MouseEventHandler(this.btnStart_MouseClick); // - // btnPause - // - resources.ApplyResources(this.btnPause, "btnPause"); - this.btnPause.Name = "btnPause"; - this.btnPause.MouseClick += new System.Windows.Forms.MouseEventHandler(this.btnPause_MouseClick); - // // ScreenRecordForm // resources.ApplyResources(this, "$this"); diff --git a/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.cs b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.cs index 1720b8ca7..edcf0724b 100644 --- a/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.cs @@ -60,6 +60,14 @@ private set public float Duration { get; set; } = 0; public bool AskConfirmationOnAbort { get; set; } = false; + public Rectangle RecordRectangle + { + get + { + return new Rectangle(Location.X + 1, Location.Y + 1, borderRectangle.Width - 2, borderRectangle.Height - 2); + } + } + private Color borderColor = Color.Red; private Rectangle borderRectangle; private Rectangle borderRectangle0Based; @@ -262,6 +270,15 @@ private void btnAbort_MouseClick(object sender, MouseEventArgs e) } } + private void lblTimer_MouseDown(object sender, MouseEventArgs e) + { + if (e.Button == MouseButtons.Left && Status == ScreenRecordingStatus.Paused) + { + NativeMethods.ReleaseCapture(); + NativeMethods.SendMessage(Handle, (uint)WindowsMessages.NCLBUTTONDOWN, (IntPtr)WindowHitTestRegions.HTCAPTION, IntPtr.Zero); + } + } + public void StartStopRecording(bool pause = false) { if (Status == ScreenRecordingStatus.Aborted) diff --git a/ShareX/ScreenRecordManager.cs b/ShareX/ScreenRecordManager.cs index 768bf9711..f16e1a9c8 100644 --- a/ShareX/ScreenRecordManager.cs +++ b/ShareX/ScreenRecordManager.cs @@ -255,6 +255,8 @@ private static void StartRecording(ScreenRecordOutput outputType, TaskSettings t FileHelpers.RenameFile(path, concatPath); } + captureRectangle = recordForm.RecordRectangle; + ScreenRecordingOptions options = new ScreenRecordingOptions() { IsRecording = true,