C# 调用COM实现窗体闪烁
using System.Runtime.InteropServices; [DllImport("user32")] public static extern bool FlashWindow(IntPtr hwnd, bool bInvert); private void button_Click(object sender, EventArgs e) { try { for (int i = 0; i < 40; i++) { FlashWindow(this.Handle, true); System.Threading.Thread.Sleep(50); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
浙公网安备 33010602011771号