【发布时间】:2016-01-24 16:18:01
【问题描述】:
使用 Delphi 10 Seattle,我尝试使用以下代码使应用程序的 Windows 任务栏按钮闪烁:
procedure TForm1.Button1Click(Sender: TObject);
begin
FlashWindow(Application.Handle, True);
end;
或:
procedure TForm1.Button1Click(Sender: TObject);
var
Flash: FLASHWINFO;
begin
FillChar(Flash, SizeOf(Flash), 0);
Flash.cbSize := SizeOf(Flash);
Flash.hwnd := Application.Handle;
Flash.dwFlags := FLASHW_ALL or FLASHW_TIMER;
Flash.dwTimeout := 1000;
FlashWindowEx(Flash);
end;
或:
procedure TForm1.Button1Click(Sender: TObject);
var
Flash: FLASHWINFO;
begin
FillChar(Flash, SizeOf(Flash), 0);
Flash.cbSize := SizeOf(Flash);
Flash.hwnd := Application.Handle;
Flash.uCount := 5;
Flash.dwTimeOut := 2000;
Flash.dwFlags := FLASHW_ALL;
FlashWindowEx(Flash);
end;
操作系统:Windows 7 x64 SP1
很遗憾,这不起作用:任务栏按钮根本不闪烁。
我怎样才能做到这一点?
【问题讨论】:
标签: delphi delphi-10-seattle taskbar