In the NativeMethods. vb class:
In a Module:
In a Form sub:
I get only dozens of "No Flash..." messages :confused: .... where is the error?
Ty :)
Code:
Friend Declare Function FlashWindowEx Lib "User32" (ByVal fwInfo As FLASHWINFO) As BooleanCode:
Public Structure FLASHWINFO
Public cbSize As Integer
Public hwnd As IntPtr
Public dwFlags As UInteger
Public uCount As UInteger
Public dwTimeout As UInteger
End StructureCode:
Dim fwi As New FLASHWINFO
Try
With fwi
.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(fwi)
Debug.Print("Me.Handle: " & Me.Handle.ToString)
.hwnd = Me.Handle
.dwFlags = 3 'Both
.uCount = 20
.dwTimeout = 0 'Use the default cursor blink rate.
End With
Debug.Print("Now Flash?")
If Not NativeMethods.FlashWindowEx(fwi) Then
Debug.Print("No Flash...")
End If
Catch ex As Exception
Debug.Print("Flashing error: " & ex.ToString)
Finally
fwi = Nothing
End TryTy :)