Results 1 to 3 of 3

Thread: Get Window Class ?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187

    Get Window Class ?

    ... I need the backwards of FindWindow... I have the hwnd of a window and I want to know the window's class name... is there such a function?
    - Visual Basic 6.0
    - Windows XP Home

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Yup, GetClassName.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    More to the point...
    VB Code:
    1. Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, _
    2.                                                                           ByVal lpClassName As String, _
    3.                                                                           ByVal nMaxCount As Long) _
    4.                                                                           As Long
    5.  
    6. Private Sub Command1_Click()
    7. Dim s As String
    8.  
    9.     s = Space$(255)
    10.    
    11.     Call GetClassName(Command1.hwnd, s, Len(s))
    12.    
    13.     If InStr(1, s, vbNullChar) Then
    14.         s = Left$(s, InStr(1, s, vbNullChar) - 1)
    15.     End If
    16.    
    17.     MsgBox s
    18.    
    19. End Sub
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width