CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    148

    Content of Listview of External Application

    Hi all,

    I am trying to get the contents of the listview which is in external application (Not my application)

    Type of the window is "WindowsForms10.SysListView32.app7". [As per SPY++]

    I am making use of Active Accessibility with the Handle of the Listview window.

    Following is the code
    Code:
    object obj = new object();
    Guid guid = new Guid("{618736E0-3C3D-11CF-810C-00AA00389B71}");
    
    
    if (hListView != 0)
    {
    AccessibleObjectFromWindow((IntPtr)hListView, (uint)OBJID.WINDOW, ref guid, ref obj);
    
    //hListview is the handle to the Listview Window
    
                            IAccessible accessible = obj as IAccessible;
                            Object[] childs = new Object[accessible.accChildCount];
                            int obtained = 0;
                            AccessibleChildren(accessible, 0, accessible.accChildCount - 1, childs, out obtained);
    
    // The problem is that inside the for loop every child element I am getting is null.
    
                            for (int i = 0; i < obtained; i++)
                            {
                                IAccessible child = childs[i] as IAccessible;
                                Object[] accchilds = new Object[child.accChildCount];
                                int result = 0;
                                AccessibleChildren(child, 0, child.accChildCount - 1, accchilds, out result);
                                for (int j = 0; j < result; j++)
                                {
                                    IAccessible jchild = accchilds[j] as IAccessible;
                                }
                            }
                        }
    Thanks for any kind of help.

    Regards,
    shail2k4
    Last edited by shail2k4; July 7th, 2011 at 04:31 AM.

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Content of Listview of External Application

    Why are you going the GUID route, any specific reason for this?

    I'd recommend using the EnumChildWindows and FindWindowEx APIs here.

  3. #3
    Join Date
    Jun 2006
    Posts
    148

    Re: Content of Listview of External Application

    Quote Originally Posted by HanneSThEGreaT View Post
    Why are you going the GUID route, any specific reason for this?

    I'd recommend using the EnumChildWindows and FindWindowEx APIs here.
    I got the Handle of the Listview with the same API.

    But what next to get all the items of that listview.

    Already tried with the sendmessage and Virtual Memory allocation in the external process techniques but resulted into blank string.

    So i tried this.

    Please suggest me if i am wrong or any other suitable method.

    Thanks for any kind of help.

  4. #4
    Join Date
    Jun 2006
    Posts
    148

    Re: Content of Listview of External Application

    Isn't there any solution???

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

Featured