Making a form flash when minimised

Winston

Junior Contributor
Joined
Jan 25, 2003
Messages
266
Location
Sydney, Australia
Hey guys does any of you know how to make a form flash

like how wen u get a new message in msn the window is flashing in the taskbar

i would like to know how to do this in vb.net


thanks
 
Ok i've made a sample for .NET , this code i made and it's not a vb6 code:) , the timer i have set to 700 in this case.
Visual Basic:
    Private Declare Function FlashWindow Lib "user32" _
      (ByVal hwnd As Integer, _
       ByVal bInvert As Boolean) As Long

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Call FlashWindow(Me.Handle.ToInt32, True)
    End Sub

    Protected Overrides Sub OnResize(ByVal e As System.EventArgs)
        If Me.WindowState = FormWindowState.Minimized Then
            Timer1.Enabled = True
        Else
            Timer1.Enabled = False
        End If
    End Sub
enjoy:)
 
For the record, I *hate* when windows flash. I turned the option off in XP because it annoyed me. The only time I find it acceptable is on a LONG-running process to alert me that it's done or when I've set a breakpoint in VS.NET and it hits but a form is on top (then the IDE flashes so that I can tell it's on the breakpoint and not still running).

That's just my opinion - maybe you've got a good reason to want to flash.

-Nerseus
 
Nerseus said:
For the record, I *hate* when windows flash. I turned the option off in XP because it annoyed me. The only time I find it acceptable is on a LONG-running process to alert me that it's done or when I've set a breakpoint in VS.NET and it hits but a form is on top (then the IDE flashes so that I can tell it's on the breakpoint and not still running).

That's just my opinion - maybe you've got a good reason to want to flash.

-Nerseus

i see what u mean, my program is a task schedular

and the reminders are shown exactly like the MSN method, so yeah, once a alert pops up i cant just show a window in the taskbar without telling the user there is one coz not much average users notice something new has just popped up
 
Back
Top