Results 1 to 3 of 3

Thread: Flashing Title in Taskbar?

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    London, ON
    Posts
    40
    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?
    Visual Basic 6 Professional Edition
    Captain Pinko

    also:
    Turbo Pascal, Turing, QBasic

  2. #2
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    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

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Add a Timer (tmrTimer), and a CommandButton (cmdFlash) to a new form. Add this code:
    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
    Make sure that the timer is disabled, then run.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width