Share this page 

Flash a Window Title barTag(s): WinAPI/Registry


[structure  s_flashinfo]
cbsize     unsignedlong
hwnd       unsignedlong
dwflags    unsignedlong
ucount     unsignedlong
dwtimeout  unsignedlong

[external function declaration]
FUNCTION boolean FlashWindowEx(REF s_flashinfo str_flashinfo) &
   LIBRARY "user32.dll"

[powerscript]
 CONSTANT unsignedlong FLASHW_STOP = 0    // Stop flashing
 CONSTANT unsignedlong FLASHW_CAPTION = 1 // Flash the window caption
 CONSTANT unsignedlong FLASHW_TRAY = 2    // Flash the taskbar button.
 // Flash both the window caption and taskbar button.
 CONSTANT unsignedlong FLASHW_ALL  = 3
 // Flash continuously, until the FLASHW_STOP flag is set.
 CONSTANT unsignedlong FLASHW_TIMER = 4
 // Flash continuously until the window comes to the foreground
 CONSTANT unsignedlong FLASHW_TIMERNOFG = 12

 ulong ll_win
 s_flashinfo lstr_flashinfo

 lstr_flashinfo.cbSize = 20
 lstr_flashinfo.hwnd = Handle(this)  // handle(parent) if from a control
 lstr_flashinfo.dwflags = FLASHW_ALL
 lstr_flashinfo.ucount = 10          // 10 times
 lstr_flashinfo.dwtimeout = 0  // speed in ms, 0 default blink cursor rate

FLASHWINDOWEX(LSTR_FLASHINFO)
The FlashWindowEx() API is only available on Win98 or WinNT/Win2000.

On Win95 or NT4, use this API instead. Call it in a loop or from a timer event to toggle the Window title bar.

[external function declaration]
FUNCTION boolean FlashWindow(ulong hndl boolean flash) &
   LIBRARY "user32.dll"