Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

[VB2010] FlashWindowEx don't works...

$
0
0
In the NativeMethods. vb class:

Code:

    Friend Declare Function FlashWindowEx Lib "User32" (ByVal fwInfo As FLASHWINFO) As Boolean
In a Module:

Code:

    Public Structure FLASHWINFO
        Public cbSize As Integer
        Public hwnd As IntPtr
        Public dwFlags As UInteger
        Public uCount As UInteger
        Public dwTimeout As UInteger
    End Structure

In a Form sub:

Code:

        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 Try

I get only dozens of "No Flash..." messages :confused: .... where is the error?

Ty :)

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>