Valhalla Legends Forums Archive | General Programming | (VB Intermediate) Flashing a Window Caption

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

[code]'----------- 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[/code]

Usage:

[code]lRet = FlashWin(hWnd,10,500)[/code]
March 10, 2003, 5:07 PM

Search