delphi - Flash application's task bar button? -


with delphi 10 seattle, i've tried make application's windows taskbar button flash using code:

procedure tform1.button1click(sender: tobject); begin   flashwindow(application.handle, true);  end; 

or:

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; 

or:

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; 

os: windows 7 x64 sp1

unfortunately, not work: task bar button not flash @ all.

how can make work?

in .dpr file see following line:

application.mainformontaskbar := true; 

what means window associated taskbar button of main form. , not of application object. in code, pass application.mainformhandle flashwindow or flashwindowex.


Comments