Lua module for Windows that can flash the taskbar icon and/or window of the current console.
local taskbarflash = require('taskbarflash')
-- continuously flash the taskbar icon until the window is focused
taskbarflash()
To build taskbarflash, you'll need to install cmake
, some version of Visual Studio, and have a Lua .lib
file that can be found by cmake
(preferably built with the same compiler you're using to build this module).
- Run
cmake-gui
- Browse to the taskbarflash directory and also set the build directory (typically just add
/build
to the source directory path) - Click Configure
- Select the Generator and hit Finish
- Hit Generate and then Open Project to open the project in Visual Studio
- Build the project in Visual Studio as normal
Open a command line in the taskbarflash
directory and do the following:
mkdir build
cd build
cmake ..
cmake --build . --config Release
If needed, you can specify a generator by doing cmake -G "Visual Studio 14 2015 Win64" ..
instead of cmake ..
require('taskbarflash')
returns a callable table containing functions that allow for more precise control.
Flashes the Lua process' taskbar icon (but not window) nflashes
times every flashrate
milliseconds, or until the window is focused.
- When
nflashes
is0
, it will flash indefinitely until the window is focused. - When
flashrate
is0
, it will use the default cursor blink rate of the system.
Aliases: taskbarflash.tray
, taskbarflash.taskbar
Flashes the Lua process' window (but not taskbar icon) nflashes
times every flashrate
milliseconds, or until the window is focused.
- When
nflashes
is0
, it will flash indefinitely until the window is focused. - When
flashrate
is0
, it will use the default cursor blink rate of the system.
Aliases: taskbarflash.caption
Flashes the Lua process' window and taskbar icon nflashes
times every flashrate
milliseconds, or until the window is focused.
- When
nflashes
is0
, it will flash indefinitely until the window is focused. - When
flashrate
is0
, it will use the default cursor blink rate of the system.
local taskbarflash = require('taskbarflash')
taskbarflash() -- flash the taskbar icon indefinitely until the window is focused
taskbarflash(1) -- flash the taskbar icon once and then stop
taskbarflash(5, 100) -- flash the taskbar icon 5 times, once every 100 milliseconds
taskbarflash.tray() -- same as taskbarflash()
taskbarflash.taskbar() -- same as taskbarflash()
taskbarflash.window() -- flash the window indefinitely until it is focused
taskbarflash.window(5, 100) -- flash the window 5 times, once every 100 milliseconds
taskbarflash.caption() -- same as taskbarflash.window()
taskbarflash.all() -- flash both the window and the taskbar icon indefinitely until the window is focused
taskbarflash.all(5, 100) -- flash both the window and the taskbar icon 5 times, once every 100 milliseconds