Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Accessing a ListBox in another app

Hi,

is there a way to manipulate a ListBox in another app, if i have the window handle of the parent window and the name of the listbox?

I tried out some APIs but i it doesnt work.

Comments

  • chick80chick80 Posts: 349Member
    It's quite easy.
    Try something like this:

    [code]
    // Note: I suppose hWnd holds the target window handle.
    // You can retrieve it with FindWindow
    HWND hList;
    hList = GetWindow(hWnd, GW_CHILD);
    while (hList)
    {
    char classname[50];

    GetClassName(butt, classname, 50);
    if (strcmp(classname, WC_LISTVIEW))
    butt = GetWindow(butt, GW_HWNDNEXT);
    else
    break;
    }
    [/code]

    nICO

    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS


  • illuminatorilluminator Posts: 15Member
    Thx!! :)

    cu,

    illuminator
    (Novus ordo seclorum)

Sign In or Register to comment.