• Welcome to Valhalla Legends Archive.
 

(VB Intermediate) Flashing a Window Caption

Started by Grok, March 10, 2003, 11:07 AM

Previous topic - Next topic

Grok

Here's another tidbit I wrote a few months ago.

'----------- put these in public module:
Public Const FLASHW_STOP = 0
Public Const FLASHW_CAPTION = &H1
Public Const FLASHW_TRAY = &H2
Public Const FLASHW_ALL = (FLASHW_CAPTION + FLASHW_TRAY)
Public Const FLASHW_TIMER = &H4
Public Const FLASHW_TIMERNOFG = &HC

Public Type FLASHWINFO
    cbSize As Long
    hWnd As Long
    dwFlags As Long
    uCount As Long
    dwTimeout As Long
End Type

'-------------------------------------------------------------------
'FlashWin procedure flashes the given window a number of times at some rate.
'-------------------------------------------------------------------
Private Function FlashWin(ByVal pWnd As Long, ByVal pCount As Long, ByVal pTimeout As Long) As Long
    
    Dim pFW As FLASHWINFO
    
    pFW.cbSize = Len(pFW)
    pFW.dwFlags = FLASHW_ALL
    pFW.dwTimeout = pTimeout
    pFW.hWnd = pWnd
    pFW.uCount = pCount
    FlashWin = FlashWindowEx(pFW)
    
End Function

Usage:

lRet = FlashWin(hWnd,10,500)