FlashWindowEx API function

  • Thread starter Sakharam Phapale
  • Start date
S

Sakharam Phapale

Hi All,

Following example not working in .NET which works in VB6.



Private Const FLASHW_STOP As Integer = 0

Private Const FLASHW_CAPTION As Integer = &H1

Private Const FLASHW_TRAY As Integer = &H2

Private Const FLASHW_ALL As Integer = (FLASHW_CAPTION Or FLASHW_TRAY)

Private Const FLASHW_TIMER As Integer = &H4

Private Const FLASHW_TIMERNOFG As Integer = &HC

Private FLASHW_FLAGS As Integer

Private Structure FLASHWINFO

Dim cbSize As Integer

Dim hwnd As IntPtr

Dim dwFlags As Integer

Dim uCount As Integer

Dim dwTimeout As Integer

End Structure

Private Declare Function FlashWindowEx Lib "user32" (ByVal pflashwininfo As
FLASHWINFO) As Integer



Private Sub FlashBegin()

Dim fwi As FLASHWINFO

With fwi

..cbSize = Marshal.SizeOf(fwi)

..hwnd = Me.Handle

..dwFlags = FLASHW_FLAGS Or FLASHW_TIMER

..dwTimeout = 0

..uCount = 0

End With

intRetVal = FlashWindowEx(fwi)

End Sub



Can anyone tell me where is the mistake.

No error occured during the procedure call.



Thanks

Regards

Sakharam Phapale
 
S

Sakharam Phapale

Hi All

My mistake was, I passed structure to the API function ByVal .
It should be ByRef.
Now it's working.

Thanks & Regards

Sakharam Phapale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top