首页 Windows 窗口 – 如何使任务栏闪烁我的应用程序像Messenger当新消息到达时?

窗口 – 如何使任务栏闪烁我的应用程序像Messenger当新消息到达时?

在.NET或本机DLL中是否有API调用,当我与某人聊天时,我可以用来创建与Windows Live Messenger类似的行为? FlashWindowEx是要走的路。见 here for MSDN documentation [DllImport(user32.dll)][return: MarshalAs(UnmanagedType.Bool)]static extern bool

在.NET或本机DLL中是否有API调用,当我与某人聊天时,我可以用来创建与Windows Live Messenger类似的行为?

FlashWindowEx是要走的路。见
here for MSDN documentation

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool FlashWindowEx(ref FLASHWINFO pwfi);

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

public const UInt32 FLASHW_ALL = 3;

调用功能:

FLASHWINFO fInfo = new FLASHWINFO();

fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
fInfo.hwnd = hWnd;
fInfo.dwFlags = FLASHW_ALL;
fInfo.uCount = UInt32.MaxValue;
fInfo.dwTimeout = 0;

FlashWindowEx(ref fInfo);

这是从Pinvoke.net无端插上

本文来自网络,不代表青岛站长网立场。转载请注明出处: https://www.0532zz.com/html/zhonghe/fwq/windows/20200703/4466.html
上一篇
下一篇

作者: dawei

【声明】:青岛站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

为您推荐

返回顶部