Accessing a ListBox in another app - Programmers Heaven

Howdy, Stranger!

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

Categories

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.