Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find window title

Status
Not open for further replies.

Serban

Programmer
Joined
Sep 25, 2001
Messages
36
Location
RO
Hi!

How can I find the window title if I have hWnd.

Thanks

Mircea Serban
 
This should work...

Code:
Private Declare Function GetWindowText Lib "user32" Alias _
    "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, _
    ByVal cch As Long) As Long


Private Function GetWindowName(ByVal hWindow As Long) As String
    Dim strTitle As String * 80
    Dim lngLength As Long
    lngLength = GetWindowText(hWindow, strTitle, Len(strTitle))
    If lngLength Then
      GetWindowName = strTitle
    Else
      GetWindowName = ""
    End If
End Function

HTH, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
that is just what im looking for too TY v much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top