Article ID: 147815
Article Last Modified on 6/29/2004
FlashWindow(hWnd, bInvert)
hWnd - Identifies the window to be flashed. The window can be
either open or iconic.
bInvert - Specifies whether the window is to be flashed or
returned to its original state. The window is flashed
from one state to the other if the bInvert parameter is
nonzero. If the bInvert parameter is zero, the window
is returned to its original state (either active or
inactive).
Private Sub Form_GotFocus()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
Timer1.Interval = GetCaretBlinkTime()
Form2.Show
End Sub
Private Sub Timer1_Timer()
Success = FlashWindow(Form1.hwnd, 1)
End Sub
Private Sub Form_Click()
Form1.Timer1.Enabled = True
End Sub
'Depending on what operating system you are using determines the
'correct function declares and variables. This is an example of
'conditional compilation.
#If Win32 Then
Declare Function FlashWindow Lib "user32" ( _
ByVal hwnd As Long, _
ByVal bInvert As Long) As Long
Declare Function GetCaretBlinkTime Lib "user32" () As Long
Dim Success As Long
#Else
Declare Function FlashWindow Lib "User" ( _
ByVal hwnd As Integer, _
ByVal bInvert As Integer) As Integer
Declare Function GetCaretBlinkTime Lib "User" () As Integer
Dim Success As Integer
#End If
Keywords: kbhowto KB147815