Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

WindowDescription - Get a textual description of a window given its hWnd
[ All Languages » VB »  Windows]

Total Hit ( 1995)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Click here to copy the following block
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal _
  hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long
Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
  (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

' Return a text description of a given window
' (consists of hWnd and classname, optionally followed by caption)

Function WindowDescription(ByVal hWnd As Long) As String
  Dim buffer As String * 256
  Dim length As Long
  Dim text As String
  Dim classname As String
  
  length = GetWindowText(hWnd, buffer, Len(buffer))
  text = Left$(buffer, length)
  length = GetClassName(hWnd, buffer, Len(buffer))
  classname = Left$(buffer, length)
  
  WindowDescription = "[" & Right$("0000000" & Hex$(hWnd), _
    8) & "] " & classname
  If Len(text) Then
    WindowDescription = WindowDescription & " - """ & text & """"
  End If
End Function


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.