Where can I get the lpClassNames for! So that I can use the following command:
hWin = FindWindow ("OutFrame", vbNullString)
I need them for Outlook Express and also for outlook 2000!!!
Neon
Printable View
Where can I get the lpClassNames for! So that I can use the following command:
hWin = FindWindow ("OutFrame", vbNullString)
I need them for Outlook Express and also for outlook 2000!!!
Neon
Use the attached file!
Just pass your cursor over the object you want to access to see it's class name and other information.
:cool:
You may also want to check out the GetClassName API function which will help you in getting the classname to a program.
Thanx you two for the replies to my answer!
But your Progg I used gave me a name but this doesn't seem to be the right one because if I open a Window, I can't close it again using the given name!
Secondly, I used the given Source code but there was always an error message saying that the function is not right or something like that!
So can someone give me the right name for Outlook 2000??
Neon
Add the following code to a Form with a Timer and 3 Labels.
Code: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
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Form_Load()
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
Dim hWnd_Window As Long
Dim sClassName As String * 255
Dim sWindowName As String * 255
Dim iLength As Integer
Dim PT As POINTAPI
GetCursorPos PT
hWnd_Window = WindowFromPoint(PT.x, PT.y)
iLength = GetClassName(hWnd_Window, sClassName, 255)
sClassName = Left(sClassName, InStr(1, sClassName, vbNullChar))
iLength = GetClassName(hWnd_Window, sWindowName, 255)
sWindowName = Left(sWindowName, InStr(1, sWindowName, vbNullChar))
Label1 = hWnd_Window 'Display the hWnd
Label2 = sClassName 'Display the class name
Label3 = sWindowName 'Display the window name
End Sub