VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Get classname for some controls using GetClassName API

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

Get classname for some controls using GetClassName API

Rate Get classname for some controls using GetClassName API



Dim classlength As Long

Private Sub Check1_Click()
ClassName = Space(128)
classlength = GetClassName(Check1.hWnd, ClassName, 128)
ClassName = Left(ClassName, classlength)
MsgBox "Check1 class is: " & ClassName
End Sub

Private Sub Command1_Click()
ClassName = Space(128)
classlength = GetClassName(Command1.hWnd, ClassName, 128)
ClassName = Left(ClassName, classlength)
MsgBox "Command1 button class is: " & ClassName
End Sub

Private Sub Form_Load()
ClassName = Space(128)
classlength = GetClassName(Form1.hWnd, ClassName, 128)
ClassName = Left(ClassName, classlength)
MsgBox "Form1 window class is: " & ClassName
End Sub

Private Sub Option1_Click()
ClassName = Space(128)
classlength = GetClassName(Option1.hWnd, ClassName, 128)
ClassName = Left(ClassName, classlength)
MsgBox "Option1 class is: " & ClassName
End Sub

Download this snippet    Add to My Saved Code

Get classname for some controls using GetClassName API Comments

No comments have been posted about Get classname for some controls using GetClassName API. Why not be the first to post a comment about Get classname for some controls using GetClassName API.

Post your comment

Subject:
Message:
0/1000 characters