1.引用
using System.Runtime.InteropServices;
2.在类在申明
[DllImport("user32.dll")]
public static extern bool FlashWindow(
IntPtr hWnd, // handle to window
bool bInvert // flash status
);
3.使用
IntPtr handle=this.Handle;
FlashWindow(handle,true);
调用winapi中的FlashWindow
最新推荐文章于 2021-12-28 16:36:35 发布
本文介绍如何通过C#调用.NETFramework中的DllImport属性来使用user32.dll中的FlashWindow函数,实现让指定窗口闪烁的效果。主要步骤包括:1. 引入System.Runtime.InteropServices命名空间;2. 在类中声明DllImport方法;3. 调用FlashWindow函数并传递窗口句柄。
2183

被折叠的 条评论
为什么被折叠?



