FlashWindowEx

Posted Tue, Jan 11 2005 9:56 by bill

Yesterday Mitch posted how he was having trouble with FlashWindowEx API.  I thought I had written that code sometime ago, but I didn't find it on my system (although perhaps I need better searching software there ), but a quick search on google for me and FlashWindowEx, found this post by Mike showing my code   (don't you just love distributed storage systems )

One word of caution, I noticed that Mitch pointed to Pinvoke.net for source code for FlashWindowEx  There they have the size and count members of the FLASHWINFO structure as 16 bit, whereas I believe that the definition is as UINT which is generally the same in size as int which is 32 bit. Perhaps that's why Mitch was havign trouble with their code.

 

Imports Runtime.InteropServices


 Declare Function FlashWindowEx Lib "user32" (ByVal pfwi As FLASHWINFO) As Boolean


<StructLayout(LayoutKind.Sequential)> _ 
Class FLASHWINFO 
    Public Size As Int32 
    Public Hwnd As IntPtr 
    Public Flags As FlashWindowFlags 
    Public Count As Int32 
    Public TimeOut As Int32 

    Sub New(ByVal hwnd As IntPtr, ByVal flags As FlashWindowFlags, ByVal count As Int32) 
       Me.New(hwnd, flags, Count, 0) 
    End Sub 

    Sub New(ByVal hwnd As IntPtr, ByVal flags As FlashWindowFlags, ByVal count As Int32, ByVal timeout As Int32) 
       With Me 
          .Size = Marshal.SizeOf(GetType(FLASHWINFO)) 
          .Hwnd = hwnd 
          .Flags = flags 
          .Count = Count 
          .TimeOut = timeout 
       End With 
    End Sub
End Class

Enum FlashWindowFlags
    [Stop] = 0
    Caption = 1
    Tray = 2
    All = Caption Or Tray
    Timer = 4
    TimertillforeGround = &HC
End Enum

Filed under:

Comments

# Alerter Component - now with added Ex.

Tuesday, January 11, 2005 3:24 AM by TrackBack