|
-
Sep 22nd, 2000, 07:18 AM
#1
Thread Starter
Junior Member
Hi,
I'm a beginer in VB, so i want to know what is exactly the classname and if it's always the same for each window (exemple : IE window have always the same classname)
Thanks
-
Sep 23rd, 2000, 12:10 AM
#2
The Classname always stays the same. Classname is another way to identify a window. Same as getting it's hwnd. Here is an example of how to get the classname:
Code:
Declare Function GetClassName Lib "user32.dll" _
Alias "GetClassNameA" (ByVal hWnd As Long, ByVal _
lpClassName As String, ByVal nMaxCount As Long) As Long
Private Sub Command1_Click()
' Display the name of the window class to which window Form1 belongs.
Dim classname As String ' receives the name of the class
Dim slength As Long ' length of the string retrieved
' Make room in the string to receive the information.
classname = Space(255) ' much more than enough room
' Get the name of the window class.
slength = GetClassName(Form1.hWnd, classname, 255)
' Extract the useful information from the string and display it.
classname = Left(classname, slength) ' remove empty space
Debug.Print "Form1's window class is: "; classname
End Sub
-
Sep 23rd, 2000, 12:13 PM
#3
The ClassName is the group of the specified Window. Here is an analogy: You and I belong to a "class" called Humans. Our computers, walkmans and TV's belong to a "class" called Machines.
-
Sep 24th, 2000, 07:31 AM
#4
Thread Starter
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|