Does anyone know how to make the title of a program flash in the taskbar like, for example, ICQ does whenever you recieve a new message, or the dial-up conection thing?
Printable View
Does anyone know how to make the title of a program flash in the taskbar like, for example, ICQ does whenever you recieve a new message, or the dial-up conection thing?
You can use the FlashWindow Api for this. You could combine it with a timer.
It accepts the hwnd of the form to flash, and bInvert (True (non-zero) to toggle the windows caption, and false to return to the original state) as parameters. The return value is True non-zero if the window was active before the call.
The declaration is as follows:
Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
Add a Timer (tmrTimer), and a CommandButton (cmdFlash) to a new form. Add this code:
Make sure that the timer is disabled, then run.Code:Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
Private Sub cmdFlash_Click()
FlashWindow Me.hwnd, 1
tmrFlash.Enabled = Not tmrFlash.Enabled
If tmrFlash.Enabled Then
cmdFlash.Caption = "&Stop"
Else
cmdFlash.Caption = "&Flash Window"
End If
End Sub
Private Sub tmrFlash_Timer()
FlashWindow frmFlash.hwnd, 1
End Sub