VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



'Find a window knowing it's caption using FindWindow API

by Karthikeyan (187 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 23rd January 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

'Find a window knowing it's caption using FindWindow API

API Declarations


Private Declare Function FlashWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal bInvert As Long) As Long
Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Rate 'Find a window knowing it's caption using FindWindow API



'http://www.geocities.com/marskarthik
'http://marskarthik.virtualave.net
'Email: [email protected]
Private Sub Form_Load()
Dim dwnd As Long
Dim rval As Long
Dim i As Integer
'Find a window having caption VBFinished
dwnd = FindWindow(vbNullString, "VBFinished")
If dwnd Then 'If Found
For i = 1 To 10 ' Flash the found window 5 times
rval = FlashWindow(dwnd, 1) 'Flash window
Sleep 300 'Delay
Next
rval = FlashWindow(dwnd, 0) 'Bring to normal
End If
End Sub

Download this snippet    Add to My Saved Code

'Find a window knowing it's caption using FindWindow API Comments

No comments have been posted about 'Find a window knowing it's caption using FindWindow API. Why not be the first to post a comment about 'Find a window knowing it's caption using FindWindow API.

Post your comment

Subject:
Message:
0/1000 characters