public static bool StopFlash(IntPtr handleToWindow) { FLASHWINFO flashwinfo1 = new FLASHWINFO(); flashwinfo1.cbSize = (uint)Marshal.SizeOf(flashwinfo1); flashwinfo1.hwnd = handleToWindow; flashwinfo1.dwFlags = 0; return(FlashWindow.FlashWindowEx(ref flashwinfo1) == 0); }
public static bool Flash(IntPtr handleToWindow) { FLASHWINFO flashwinfo1 = new FLASHWINFO(); flashwinfo1.cbSize = (uint)Marshal.SizeOf(flashwinfo1); flashwinfo1.hwnd = handleToWindow; flashwinfo1.dwFlags = 3; flashwinfo1.uCount = uint.MaxValue; flashwinfo1.dwTimeout = 0; return(FlashWindow.FlashWindowEx(ref flashwinfo1) == 0); }
private void RecordHelper_ProgressReport(object sender, ProgressReportEventArgs e) { if (InvokeRequired) { BeginInvoke(new EventHandler <ProgressReportEventArgs>(RecordHelper_ProgressReport), sender, e); } else { if (this.isRecording && !e.IsRecording) { // It is just stopped FlashWindow.StopFlash(this.Handle); if (chkPlayback.Checked && !isSkipPlaybackOnce) { playbackHelper.Play(this.lastFileName); } isSkipPlaybackOnce = false; btnRecord.Text = "Record"; isRecording = false; Output("Stop recording."); var recordedFile = new RecordedFile(lastFileName, e.Seconds, ConvertSecondToString(e.Seconds)); AddNewRecordedFile(recordedFile); } else { lblLength.Text = ConvertSecondToString(e.Seconds); } if (e.Exception != null) { Output(e.Exception); } } }
private bool StartRecording() { if (this.playbackHelper.IsPlaying) { playbackHelper.Stop(); } var fileName = GetFileName(); if (fileName == this.lastFileName) { Output("Click too fast"); return(false); } else { this.lastFileName = fileName; this.recordHelper.Start(lastFileName); FlashWindow.Flash(this.Handle); return(true); } }