Results 1 to 5 of 5

Thread: lpClassNames??

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    29

    Question

    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

  2. #2
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810
    Use the attached file!
    Just pass your cursor over the object you want to access to see it's class name and other information.
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  3. #3
    Guest
    You may also want to check out the GetClassName API function which will help you in getting the classname to a program.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    May 2000
    Posts
    29

    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

  5. #5
    Guest
    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
  •  



Click Here to Expand Forum to Full Width