Window应用程序闪烁橙色一样在任务栏上时,最小化 [英] Window application flash like orange on taskbar when minimize
问题描述
我有一个窗口的应用程序。当我尽量减少对任务栏窗口应用程序到另一个应用程序。我们从一个窗口应用程序哈瓦像发送消息的设施到另一个窗口应用程序
i have an window application. when i minimize the window application on taskbar to work on another application. we hava a facility like send message from one window application to another window application
所以我的第一场胜利的应用程序最小化,现在我打开我的另一个胜利应用程序,然后将消息发送到第一个应用程序,但首先是应用在任务栏上。
所以我要像当任何邮件捕获我的第一个应用程序功能,那么它会闪烁,例如Skype或任何使者。
so my first win application is minimize and now i open my another win application and then send message to first application but first application is on taskbar. so i want functionality like when any message capture my first application then it will blink like skype or any messenger.
我曾试图User32.dll中的FlashWindowEx的方法。但没有运气。我曾与选项尝试闪光不断,直到窗口出现在前台。但没有运气。
i had tried "FlashWindowEx" method of User32.dll. but no luck. i had tried with option "Flash continuously until the window comes to the foreground." but no luck.
请帮忙解决这个问题,例如:
Please help to solve this problem with example
感谢
推荐答案
我做的,如下图所示,请务必添加所需的引用,如图
I do it as shown below, being sure to add the required references as shown
using System.Runtime.InteropServices;
using Microsoft.Win32;
// To support flashing.
[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
//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 window comes to the foreground.
public const UInt32 FLASHW_TIMERNOFG = 12;
[StructLayout(LayoutKind.Sequential)]
public struct FLASHWINFO
{
public UInt32 cbSize;
public IntPtr hwnd;
public UInt32 dwFlags;
public UInt32 uCount;
public UInt32 dwTimeout;
}
// Do the flashing - this does not involve a raincoat.
public static bool FlashWindowEx(Form form)
{
IntPtr hWnd = form.Handle;
FLASHWINFO fInfo = new FLASHWINFO();
fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
fInfo.hwnd = hWnd;
fInfo.dwFlags = FLASHW_ALL | FLASHW_TIMERNOFG;
fInfo.uCount = UInt32.MaxValue;
fInfo.dwTimeout = 0;
return FlashWindowEx(ref fInfo);
}
这应该包含你所需要的一切。
This should contain everything you need.
我希望这有助于。
这篇关于Window应用程序闪烁橙色一样在任务栏上时,最小化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!