Results 1 to 4 of 4

Thread: Blinking Window upon event?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Posts
    3

    Blinking Window upon event?

    Hello, all....

    I was wondering if there was a way to make the window blink (while in start menu, etc.) upon an event? I have seen it done with various messaging programs but was never able to duplicate it.

    Any help is greatly appreciated.

    'Till next time..
    --Sean Killeen
    Web Master, Web/Program Designer/Developer, content engineer
    InterFall Design -- http://www.InterFall.com
    "Where the Internet Flows"

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Try this code.

    Code:
    Option Explicit
    '//WIN32API Function
    Private Declare Function FlashWindowEx Lib "user32" (pfwi As FLASHWINFO) As Boolean
    
    '//WIN32API Constant
    Private Const FLASHW_STOP = 0                               'Stop flashing. The system restores the window to its original state.
    Private Const FLASHW_CAPTION = &H1                          'Flash the window caption.
    Private Const FLASHW_TRAY = &H2                             'Flash the taskbar button.
    Private Const FLASHW_ALL = (FLASHW_CAPTION Or FLASHW_TRAY)  'Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION Or FLASHW_TRAY flags.
    Private Const FLASHW_TIMER = &H4                            'Flash continuously, until the FLASHW_STOP flag is set.
    Private Const FLASHW_TIMERNOFG = &HC                        'Flash continuously until the window comes to the foreground.
    
    '//WIN32API Structure
    Private Type FLASHWINFO
        cbSize As Long
        hwnd As Long
        dwFlags As Long
        uCount As Long
        dwTimeout As Long
    End Type
    
    Private Sub Command1_Click()
        Dim FlashInfo As FLASHWINFO
        
        With FlashInfo
            .cbSize = Len(FlashInfo)
            .dwFlags = FLASHW_ALL Or FLASHW_TIMER
            .dwTimeout = 0
            .hwnd = Me.hwnd
            .uCount = 0
        End With
        
        FlashWindowEx FlashInfo
    End Sub

  3. #3

  4. #4
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    anoop007, FlashWindow will not continue flash the window. For that effeect, you need to put the code into a loop. Try the FlashWindowEx

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