8 个解决方案
#1
一闪一闪能做到,
#2
用timer控件,先设置 [System.Runtime.InteropServices.DllImport("user32")]
public static extern bool FlashWindow(IntPtr hWnd, bool bInvert);
FlashWindow(this.Handle, true); //一闪闪
FlashWindow(this.Handle, false); //保持高亮橘黄色
public static extern bool FlashWindow(IntPtr hWnd, bool bInvert);
FlashWindow(this.Handle, true); //一闪闪
FlashWindow(this.Handle, false); //保持高亮橘黄色
#3
不行的,楼上的,要不你给试试,谢谢
#4
一闪 可以 但常亮 不行捏
#5
如果窗体最小化着
FlashWindow(this.Handle, false);
这样就常亮了
FlashWindow(this.Handle, false);
这样就常亮了
#6
闪动并停留需要使用这个函数:
public static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
代码如下:
[DllImport("user32.dll")]
public static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
public enum falshType:uint
{
FLASHW_STOP = 0, //停止闪烁
FALSHW_CAPTION = 1, //只闪烁标题
FLASHW_TRAY = 2, //只闪烁任务栏
FLASHW_ALL = 3, //标题和任务栏同时闪烁
FLASHW_PARAM1 = 4,
FLASHW_PARAM2 = 12,
FLASHW_TIMER = FLASHW_TRAY | FLASHW_PARAM1, //无条件闪烁任务栏直到发送停止标志,停止后高亮
FLASHW_TIMERNOFG = FLASHW_TRAY | FLASHW_PARAM2 //未激活时闪烁任务栏直到发送停止标志或者窗体被激活,停止后高亮
}
public static bool flashTaskBar(IntPtr hWnd, falshType type)
{
FLASHWINFO fInfo = new FLASHWINFO();
fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
fInfo.hwnd = hWnd;//要闪烁的窗口的句柄,该窗口可以是打开的或最小化的
fInfo.dwFlags = (uint)type;//闪烁的类型
fInfo.uCount = UInt32.MaxValue;//闪烁窗口的次数
fInfo.dwTimeout = 0; //窗口闪烁的频度,毫秒为单位;若该值为0,则为默认图标的闪烁频度
return FlashWindowEx(ref fInfo);
}
下面的调用:未激活时闪烁任务栏直到发送停止标志或者窗体被激活,停止后高亮
flashTaskBar(this.Handle, falshType.FLASHW_TIMERNOFG);
下面的调用:停止闪烁,停止后如果未激活窗口,窗口高亮
flashTaskBar(this.Handle, falshType.FLASHW_STOP);
public static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
代码如下:
[DllImport("user32.dll")]
public static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
public enum falshType:uint
{
FLASHW_STOP = 0, //停止闪烁
FALSHW_CAPTION = 1, //只闪烁标题
FLASHW_TRAY = 2, //只闪烁任务栏
FLASHW_ALL = 3, //标题和任务栏同时闪烁
FLASHW_PARAM1 = 4,
FLASHW_PARAM2 = 12,
FLASHW_TIMER = FLASHW_TRAY | FLASHW_PARAM1, //无条件闪烁任务栏直到发送停止标志,停止后高亮
FLASHW_TIMERNOFG = FLASHW_TRAY | FLASHW_PARAM2 //未激活时闪烁任务栏直到发送停止标志或者窗体被激活,停止后高亮
}
public static bool flashTaskBar(IntPtr hWnd, falshType type)
{
FLASHWINFO fInfo = new FLASHWINFO();
fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
fInfo.hwnd = hWnd;//要闪烁的窗口的句柄,该窗口可以是打开的或最小化的
fInfo.dwFlags = (uint)type;//闪烁的类型
fInfo.uCount = UInt32.MaxValue;//闪烁窗口的次数
fInfo.dwTimeout = 0; //窗口闪烁的频度,毫秒为单位;若该值为0,则为默认图标的闪烁频度
return FlashWindowEx(ref fInfo);
}
下面的调用:未激活时闪烁任务栏直到发送停止标志或者窗体被激活,停止后高亮
flashTaskBar(this.Handle, falshType.FLASHW_TIMERNOFG);
下面的调用:停止闪烁,停止后如果未激活窗口,窗口高亮
flashTaskBar(this.Handle, falshType.FLASHW_STOP);
#7
FLASHWINFO是什么?
#8
public struct FLASHWINFO
{
public UInt32 cbSize;
public IntPtr hwnd;
public UInt32 dwFlags;
public UInt32 uCount;
public UInt32 dwTimeout;
}
{
public UInt32 cbSize;
public IntPtr hwnd;
public UInt32 dwFlags;
public UInt32 uCount;
public UInt32 dwTimeout;
}
#1
一闪一闪能做到,
#2
用timer控件,先设置 [System.Runtime.InteropServices.DllImport("user32")]
public static extern bool FlashWindow(IntPtr hWnd, bool bInvert);
FlashWindow(this.Handle, true); //一闪闪
FlashWindow(this.Handle, false); //保持高亮橘黄色
public static extern bool FlashWindow(IntPtr hWnd, bool bInvert);
FlashWindow(this.Handle, true); //一闪闪
FlashWindow(this.Handle, false); //保持高亮橘黄色
#3
不行的,楼上的,要不你给试试,谢谢
#4
一闪 可以 但常亮 不行捏
#5
如果窗体最小化着
FlashWindow(this.Handle, false);
这样就常亮了
FlashWindow(this.Handle, false);
这样就常亮了
#6
闪动并停留需要使用这个函数:
public static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
代码如下:
[DllImport("user32.dll")]
public static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
public enum falshType:uint
{
FLASHW_STOP = 0, //停止闪烁
FALSHW_CAPTION = 1, //只闪烁标题
FLASHW_TRAY = 2, //只闪烁任务栏
FLASHW_ALL = 3, //标题和任务栏同时闪烁
FLASHW_PARAM1 = 4,
FLASHW_PARAM2 = 12,
FLASHW_TIMER = FLASHW_TRAY | FLASHW_PARAM1, //无条件闪烁任务栏直到发送停止标志,停止后高亮
FLASHW_TIMERNOFG = FLASHW_TRAY | FLASHW_PARAM2 //未激活时闪烁任务栏直到发送停止标志或者窗体被激活,停止后高亮
}
public static bool flashTaskBar(IntPtr hWnd, falshType type)
{
FLASHWINFO fInfo = new FLASHWINFO();
fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
fInfo.hwnd = hWnd;//要闪烁的窗口的句柄,该窗口可以是打开的或最小化的
fInfo.dwFlags = (uint)type;//闪烁的类型
fInfo.uCount = UInt32.MaxValue;//闪烁窗口的次数
fInfo.dwTimeout = 0; //窗口闪烁的频度,毫秒为单位;若该值为0,则为默认图标的闪烁频度
return FlashWindowEx(ref fInfo);
}
下面的调用:未激活时闪烁任务栏直到发送停止标志或者窗体被激活,停止后高亮
flashTaskBar(this.Handle, falshType.FLASHW_TIMERNOFG);
下面的调用:停止闪烁,停止后如果未激活窗口,窗口高亮
flashTaskBar(this.Handle, falshType.FLASHW_STOP);
public static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
代码如下:
[DllImport("user32.dll")]
public static extern bool FlashWindowEx(ref FLASHWINFO pwfi);
public enum falshType:uint
{
FLASHW_STOP = 0, //停止闪烁
FALSHW_CAPTION = 1, //只闪烁标题
FLASHW_TRAY = 2, //只闪烁任务栏
FLASHW_ALL = 3, //标题和任务栏同时闪烁
FLASHW_PARAM1 = 4,
FLASHW_PARAM2 = 12,
FLASHW_TIMER = FLASHW_TRAY | FLASHW_PARAM1, //无条件闪烁任务栏直到发送停止标志,停止后高亮
FLASHW_TIMERNOFG = FLASHW_TRAY | FLASHW_PARAM2 //未激活时闪烁任务栏直到发送停止标志或者窗体被激活,停止后高亮
}
public static bool flashTaskBar(IntPtr hWnd, falshType type)
{
FLASHWINFO fInfo = new FLASHWINFO();
fInfo.cbSize = Convert.ToUInt32(Marshal.SizeOf(fInfo));
fInfo.hwnd = hWnd;//要闪烁的窗口的句柄,该窗口可以是打开的或最小化的
fInfo.dwFlags = (uint)type;//闪烁的类型
fInfo.uCount = UInt32.MaxValue;//闪烁窗口的次数
fInfo.dwTimeout = 0; //窗口闪烁的频度,毫秒为单位;若该值为0,则为默认图标的闪烁频度
return FlashWindowEx(ref fInfo);
}
下面的调用:未激活时闪烁任务栏直到发送停止标志或者窗体被激活,停止后高亮
flashTaskBar(this.Handle, falshType.FLASHW_TIMERNOFG);
下面的调用:停止闪烁,停止后如果未激活窗口,窗口高亮
flashTaskBar(this.Handle, falshType.FLASHW_STOP);
#7
FLASHWINFO是什么?
#8
public struct FLASHWINFO
{
public UInt32 cbSize;
public IntPtr hwnd;
public UInt32 dwFlags;
public UInt32 uCount;
public UInt32 dwTimeout;
}
{
public UInt32 cbSize;
public IntPtr hwnd;
public UInt32 dwFlags;
public UInt32 uCount;
public UInt32 dwTimeout;
}