[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. SQL ServerOVER 子句,over开窗函数,SQL SERVER 开窗函数

    https://technet.microsoft.com/zh-cn/library/ms189461(v=sql.105).aspx http://www.cnblogs.com/85538649 ...

  2. Appium使用PageFactory初始化对象时报空指针错误

    自己的测试框架里面,每个app页面都要初始化appium field,所以想到使用一个静态的变量,后来初始化一个页面对象时总是报空指针. 在网上找了好多材料,看着没有什么区别.后来在github上面看 ...

  3. javascript createElement ttf

    var icon= document.createElement("a");icon.className="iconfont";icon.innerHTML=& ...

  4. 递归绑定将数据表中的数据按层级更新到 TreeView节点上

     private void bindTreeView1()         {             string sql = "select * from dm_category&quo ...

  5. mysql备份还原数据库

    1.备份数据库 mysqldump -u root -p test>/home/victor/test.sql 说明:如果提示找不到mysqldump命令,先用一条find命令查找mysqldu ...

  6. IT之人生感悟

    从实习到现在,一直在做程序开发,工作了也有1年了吧,日子也就这么浑浑噩噩的过去了,想想将要毕业那会,原本有想考研的打算,最后还是出于各方面考虑不了了之,相比考研族提早步入了社会,既然路是自己选的,那必 ...

  7. 在共享DLL中使用MFC

    使用VS2008,在项目属性中有一项MFC的使用,有三种设置: 1.使用标准Windows库 2.在共享DLL中使用MFC 3.在静态库中使用MFC          第一种顾名思义.        ...

  8. Django TemplateView

    主要功能是渲染模板,看官例: from django.views.generic.base import TemplateView from articles.models import Articl ...

  9. hibernate的延迟加载及其与session关闭的矛盾

    延迟加载就是并不是在读取的时候就把数据加载进来,而是等到使用时再加载. 那么Hibernate是怎么知道用户在什么时候使用数据了呢?又是如何加载数据呢? 其实很简单,它使用了代理机制.返回给用户的并不 ...

  10. RealtekRTL8111内建网卡-黑苹果之路

    真是服了这神一样的黑苹果.好不容易配好显卡,登陆appstore却报“无法验证您的设备或电脑”,查了一圈,又说要配网卡为en0的,有说要在clover中配FIXLAN的,最准确的是网卡必须是内建(Bu ...