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

    [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);

  • 相关阅读:
    语音转写平台-非实时语音分割
    基于能量或过零率的实时语音分割--学习笔记
    web浏览器录音:web audio api
    python---webRTC~vad静音检测-学习笔记
    python import自己写的.py文件
    许愿墙JQ
    抽奖JQ
    制作时钟
    冒泡排序
    企业面试:作用域和函数提升的面试题
  • 原文地址:https://www.cnblogs.com/Logan626/p/5420701.html
Copyright © 2011-2022 走看看