Valhalla Legends Archive

Programming => General Programming => Topic started by: Grok on March 10, 2003, 11:07 AM

Title: (VB Intermediate) Flashing a Window Caption
Post by: Grok on March 10, 2003, 11:07 AM
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)