Results 1 to 12 of 12

Thread: Find a combobox from another application in nested form.

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    13

    Find a combobox from another application in nested form.

    Please help I have been through this back and forth and I can't seem to figure out where it went wrong.

    Can someone figure this out? I want to extract the Static.string from another application.

    Code:
            'Get handle of all sibling child windows that have the same parent(Top-level window).
            Dim Parent_hWnd As Int32
            Dim cwnd As Int32
            Dim dwnd As Int32
            Dim ewnd As Int32
            Dim fwnd As Int32
            Dim gwnd As Int32
            Dim iwnd As Int32
            Dim jwnd As Int32
            Dim kwnd As Int32
    
            Parent_hWnd = apiFindWindowEx(HWND_DESKTOP, 0, Nothing, "Remote Management Agent Facility")
            If Parent_hWnd = 0 Then
                'This is another possibility.
                Parent_hWnd = apiFindWindowEx(HWND_DESKTOP, 0, Nothing, "Remote Management")
                If Parent_hWnd = 0 Then
                    'This is an attempt to find the registered class.
                    Parent_hWnd = apiFindWindowEx(HWND_DESKTOP, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
                End If
            End If
            '10x Steps
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            cwnd = apiFindWindowEx(Parent_hWnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
    
            dwnd = apiFindWindowEx(cwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            ewnd = apiFindWindowEx(dwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            fwnd = apiFindWindowEx(ewnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            '2x Steps
            gwnd = apiFindWindowEx(fwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            gwnd = apiFindWindowEx(fwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            '4x Steps
            iwnd = apiFindWindowEx(gwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            iwnd = apiFindWindowEx(gwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            iwnd = apiFindWindowEx(gwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            iwnd = apiFindWindowEx(gwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            '2x Steps
            jwnd = apiFindWindowEx(iwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            jwnd = apiFindWindowEx(iwnd, 0, "WindowsForms10.Window.8.app.0.378734a", Nothing)
            'FOUND YOU!
            kwnd = apiFindWindowEx(jwnd, 0, "WindowsForms10.STATIC.app.0.378734a", Nothing)
    
            System.Threading.Thread.Sleep(1) 'Give a chance to see the new handle
            Dim s As New StringBuilder(256)
            GetWindowText(kwnd, s, s.Capacity)
            Return s.ToString()
    Attached Images Attached Images  

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