Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash icon in taskbar 1

Status
Not open for further replies.

Phailak

Programmer
Apr 10, 2001
142
CA
Hail,

I built this app and I want its icon to flash in the task bar when a condition is true and the user may be on another window. Can this be done?

Phailak
 
Hey Phaila,

I'm not sure where you want the icon in the task bar.

If you just want the tab on the task bar to flash you can simply setfocus to the form when the condition is met.

<color=red>if blnCondition then Form1.SetFocus</color><br>

This will force the tab to flash (even if the taskbar is hidden)

If you want a icon to appear in the taskbar tray (where you have the clock) I could e-mail you the ocx

Ciao
Phathi
 
Here's an example of how to do this. You need a form with a timer. Set its interval to something suitable, say 500. When you minimize the window, its task bar icon will flash. When maximized, it won't.
[tt]
Option Explicit
Private Declare Function FlashWindow Lib &quot;user32&quot; (ByVal hwnd As Long, ByVal bInvert As Long) As Long

Private Sub Form_Resize()
Timer1.Enabled = (Me.WindowState = vbMinimized)
End Sub

Private Sub Timer1_Timer()
FlashWindow Me.hwnd, True
End Sub
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top