zoukankan      html  css  js  c++  java
  • Winform任务栏闪烁

     [DllImport("user32.dll")]
            public static extern bool FlashWindow(IntPtr hWnd, bool bInvert);

    调用

    FlashWindow(this.Handle, true)// true为闪烁

    窗体处于活动是调用 

       if (Form.ActiveForm != this)
                    {
                       

              FlashWindow(this.Handle, true)// true为闪烁

                    }

    另外的线程调用时

        if (Form.ActiveForm != this)
                    {
                        InvokeProxyMethod.ProxyMethod(this, this, "CallFlashWindow", null);
                    }

    using System;
    using System.Reflection;
    using System.Windows.Forms;

    namespace Utility
    {
    delegate object CallInvokeProxyMethod(Control invokeControl, object invokeObject, string method, object[] parameters);
    public static class InvokeProxyMethod
    {
    public static object ProxyMethod(Control invokeControl, object invokeObject, string method, object[] parameters)
    {
    if (invokeControl.InvokeRequired)
    {
    CallInvokeProxyMethod d = ProxyMethod;
    return invokeControl.Invoke(d, new object[] { invokeControl, invokeObject, method, parameters });
    }
    else
    {
    Type t = invokeObject.GetType();

    MethodInfo mi = t.GetMethod(method);//获取指定方法
    return mi.Invoke(invokeObject, parameters);//调用实例方法

    }
    }
    }
    }
  • 相关阅读:
    yum 本地 网络 openstack
    docker 负载均衡
    tomcat + nginx 负载均衡 动静分离 session会话配置
    K8S Ingress 之 traefik-ingress-controller
    CentOS7安装和配置rsync+inotify
    DAS,NAS,SAN在数据库存储上的应用
    inotify+rsync实现实时同步
    NFS网络文件系统
    CentOS7下rsync服务的基本详解和使用
    LVM--逻辑卷管理
  • 原文地址:https://www.cnblogs.com/jiebian/p/2364994.html
Copyright © 2011-2022 走看看