|
-
Jan 30th, 2001, 07:41 AM
#1
Thread Starter
Junior Member
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
-
Jan 30th, 2001, 07:49 AM
#2
Fanatic Member
Use the attached file!
Just pass your cursor over the object you want to access to see it's class name and other information.
-
Jan 30th, 2001, 07:51 AM
#3
You may also want to check out the GetClassName API function which will help you in getting the classname to a program.
-
Jan 30th, 2001, 09:31 AM
#4
Thread Starter
Junior Member
Thanx
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
-
Jan 30th, 2001, 09:40 AM
#5
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
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
|