private void StartOrStopFlashTaskBar(bool isFlash) { Application.Current.Dispatcher.Invoke((Action) delegate { if (isFlash) { //var isTrue = FlashWindowHelper.FlashWindowEx(this, FlashType.FLASHW_TIMERNOFG); //if (isTrue == false) //{ // //如果窗口未激活,那么就停止闪烁,高亮 // FlashWindowHelper.FlashWindowEx(this, FlashType.FLASHW_TIMER); //} FlashWindowHelper.FlashWindowEx(this, FlashType.FLASHW_TIMER); } else { FlashWindowHelper.StopFlashingWindow(this); } }); }
protected override void OnActivated(EventArgs e) { FlashWindowHelper.StopFlashingWindow(this); base.OnActivated(e); }