[StructLayout(LayoutKind.Sequential)]
public struct FLASHWINFO
{
public UInt32 cbSize;
public IntPtr hwnd;
public UInt32 dwFlags;
public UInt32 uCount;
public UInt32 dwTimeout;
}

public class PInvoke
{
[DllImport("user32.dll")]
public static extern Int16 FlashWindowEx(ref FLASHWINFO pwfi);

//Stop flashing. The system restores the window to its original state.
public const UInt32 FLASHW_STOP = 0;
//Flash the window caption.
public const UInt32 FLASHW_CAPTION = 1;
//Flash the taskbar button.
public const UInt32 FLASHW_TRAY = 2;
//Flash both the window caption and taskbar button.
//This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags.
public const UInt32 FLASHW_ALL = 3;
//Flash continuously, until the FLASHW_STOP flag is set.
public const UInt32 FLASHW_TIMER = 4;
//Flash continuously until the window comes to the foreground.
public const UInt32 FLASHW_TIMERNOFG = 12;

}

//最小化的时候闪烁

//this.WindowState == WindowState.Minimized

FLASHWINFO finfo = new FLASHWINFO();
finfo.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(finfo);
finfo.hwnd = new WindowInteropHelper(this).Handle;
finfo.uCount = 600;
finfo.dwTimeout = 400;
finfo.dwFlags = PInvoke.FLASHW_TRAY | PInvoke.FLASHW_TIMER | PInvoke.FLASHW_TIMERNOFG;
PInvoke.FlashWindowEx(ref finfo);

wpf 任务栏闪烁的更多相关文章

  1. WPF 任务栏背景闪烁提醒

    原文:WPF 任务栏图标闪烁提醒   public static class FlashWindow { [DllImport("user32.dll")] [return: Ma ...

  2. WPF 任务栏颜色 - 简书

    原文:WPF 任务栏颜色 - 简书 先看看效果,这种效果可以用来做进度条或者消息通知闪烁.   image.png   image.png   image.png   image.png 有一个好消息 ...

  3. FlashWindowEx实现窗口在任务栏闪烁/变化颜色

    原文:FlashWindowEx实现窗口在任务栏闪烁/变化颜色 效果类似QQ收到新的会话消息任务栏颜色变化 附2小段代码: [System.Runtime.InteropServices.DllImp ...

  4. WPF 任务栏图标闪烁提醒

    using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServi ...

  5. wpf动画同步闪烁

    public class BlinkAnimation : Animatable { /// <summary> /// 单例,保持所有闪烁的动画同步 /// </summary&g ...

  6. C#闪动任务栏的方法

    用FlashWindowEx可以实现窗口的闪烁,结构如下: /// <summary> /// 闪烁窗口 /// </summary> /// <param name=& ...

  7. 怎么关闭wps热点?永久关闭wps右下角弹窗的方法!

    wps热点总是开机或者开启WPS后在任务栏闪烁,影响心情,百度了一下找到的方法也过时了.我的是WIN10系统 所以自己摸索了一下,找到了解决办法.其实还是用空白文件替换wps热点的.exe文件,只是这 ...

  8. 微信小程序开发过程问题总汇

    之前在开发一个控车小程序,把过程中稍微需要搜索的问题做了记录. 1. 关键词:本地资源图片无法通过WXSS获取 描述:做小程序开发的时候,如果你需要使用图片作为背景,也就是想使用background- ...

  9. ElementLayer support not implemented for native rendering. Layer ID:

    在 arcgis runtime for wpf 添加标注闪烁动画时(实现方法参考:http://blog.csdn.net/arcgisserver_book/article/details/805 ...

随机推荐

  1. truncate有外键约束的表,报ORA-02266处理。

    问题描述:当父表有子表的外键约束时,无法直接truncate父表.报ORA-02266: unique/primary keys in table referenced by enabled fore ...

  2. 基于KO+bootstrap+MVC的分页控件

    JS: /// <reference path="../knockout-3.2.0.js" /> var ViewModel = function (data) { ...

  3. Apache Shiro 使用手册(三)Shiro 授权

    授权即访问控制,它将判断用户在应用程序中对资源是否拥有相应的访问权限. 如,判断一个用户有查看页面的权限,编辑数据的权限,拥有某一按钮的权限,以及是否拥有打印的权限等等. 一.授权的三要素 授权有着三 ...

  4. a+=b 是什么意思?

    a+=b或者-=,*=等等就是相当于a=a+b;简写而已,没什么特殊含义此外还有a++/a--相当于a=a+1/a=a-1

  5. C Primer Plus(第五版)12

    第 12 章 存储类, 链接和内存管理 在本章中你将学习下列内容 . 关键字: auto, extern, static, register, const, volatile, restricted. ...

  6. HTML 滚动标签<marquee>

    主要参数: behavior  移动方式 scroll        循环移动 slide         只移动一个回合 alternate   来回移动 direction 移动方向 left r ...

  7. PL/SQL 查找1-100之间的素数

    --实现查找1-100之间的素数 declare v_no ; --标记是第几个素数 v_number number; --表示1-100之间的数 v_num number; begin .. loo ...

  8. 执行powershell脚本

    打开powershell运行窗口: powershell.exe C:\Users\Administrator\Desktop\a.ps1 -a $a. -a $a :  vbs脚本路径(如 C:\h ...

  9. MVC4.0中项目发布遇到IE11时session存入URL中,导致记不住密码的问题

    ///MVC4.0中项目发布遇到IE11时session存入URL中,导致记不住密码的问题,在webconfig中配置<system.web><authentication mode ...

  10. 我要崩溃了,要解出这么一段js代码背后的东西,这真是一坨啊,别被高度欺骗了,他还有宽度!!!!!试着按下方向右键

    一坨js代码: function s_gi(un, pg, ss) { var c = "s.version='H.26';s.an=s_an;s.logDebug=function(m){ ...