\\\
Private Declare Auto Function FlashWindow Lib "user32.dll" ( _
ByVal Handle As IntPtr, _
ByVal bInvert As Boolean _
) As Int32
..
..
..
Public Sub Flash()
FlashWindow(Me.Handle, True)
End Sub
///
\\\
Private Declare Auto Function FlashWindow Lib "user32.dll" ( _
ByVal Handle As IntPtr, _
ByVal bInvert As Boolean _
) As Int32
.
.
.
Public Sub Flash()
FlashWindow(Me.Handle, True)
End Sub
///
1. Make sure that the following Imports statement is at the top of the
class file where you want to use an API:
Imports System.Runtime.InteropServices
2. Declare the DLL import:
<DllImport("user32.dll")> _
Private Shared Function FlashWindow(ByVal hwnd as IntPtr, ByVal
invert as Boolean) As Integer
End Function
3. Call the API using the target form's handle and TRUE. Assuming a Windows
Form class called "TargetForm":
Dim myTargetForm as New TargetForm
myTargetForm.Show ' shown modelessly
... other things happen...
FlashWindow(myTargetForm.Handle, True)
HTH,
Derrick
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.