Thread: readling listbox in another app

  1. #1
    Registered User
    Join Date
    Aug 2002
    Posts
    170

    Question readling listbox in another app

    This is kind of a repost. I wanted to go ahead and register.

    Thanks to the help I have received so far, I now am using FindWindow and FindwindowEx to get my listbox. The problem now is when I try and send a message it fails an IsWindow assert.

    I decided to bypass the Cwnd::SendMessage which does the assert and went with ::SendMessage which takes the hwnd asa parameter. This works, (doesn't give me an error) but does not return any usefull info.

    Code:
    HWND ChildWnd,Wnd;
    
    Cwnd *pParentWnd = FindWindow("Afx:40000:b...", NULL);
    ChildWnd=FindWindowEx( pParentWnd->m_hWnd,Null,"#32770",NULL);
    Wnd=FindWindowEx( ChildWnd, NULL, "ListBox", NULL);
    
    pDC->TextOut(1,1,(CString)::SendMessage(Wnd,LB_GETTEXT,0,0));
    This just prints a block character.

    Any further help would be greatly appreciated.
    Best Regards,

    Bonkey

  2. #2
    Registered User
    Join Date
    Jun 2002
    Posts
    267
    you should probably ask this on the Windows board

  3. #3
    Registered User
    Join Date
    Aug 2002
    Posts
    170
    Will do. I didn't look that far down. Thanks.
    Best Regards,

    Bonkey

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to cast a ListBox item to an int for a switch statment?
    By Swaine777 in forum C++ Programming
    Replies: 8
    Last Post: 09-26-2004, 08:52 PM
  2. best program to start
    By gooddevil in forum Networking/Device Communication
    Replies: 4
    Last Post: 05-28-2004, 05:56 PM
  3. Windows form App: listbox
    By hslee16 in forum Windows Programming
    Replies: 3
    Last Post: 04-27-2004, 06:12 AM
  4. read a listbox in another app
    By bonkey in forum Windows Programming
    Replies: 5
    Last Post: 08-14-2002, 02:49 PM
  5. I need to read a Listbox in another app
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 08-14-2002, 09:39 AM