是否有.NET中的API调用或本机DLL,当我的聊天来自某人时,我可以使用它来创建与Windows Live Messenger类似的行为?
FlashWindowEx是要走的路.有关MSDN文档,请参见此处
[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无耻地插入的
HWND hHandle = FindWindow(NULL,"YourApplicationName"); FLASHWINFO pf; pf.cbSize = sizeof(FLASHWINFO); pf.hwnd = hHandle; pf.dwFlags = FLASHW_TIMER|FLASHW_TRAY; // (or FLASHW_ALL to flash and if it is not minimized) pf.uCount = 8; pf.dwTimeout = 75; FlashWindowEx(&pf);
被专家交流成员gtokas窃取。
FlashWindowEx。