Here is what I have so far. (just created a new app to test with).
Code:
void CReadlbView::OnDraw(CDC* pDC)
{
CReadlbDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
HWND ChildWnd,Wnd;
CWnd *pParentWnd = FindWindow( "Afx:400000:b:146e:6:35cf",NULL);
if(pParentWnd)
ChildWnd = FindWindowEx( pParentWnd->m_hWnd,NULL,"#32770",NULL);
else
pDC->TextOut(1,1,"Parent Window not found!");
if( ChildWnd )
Wnd = FindWindowEx( ChildWnd , NULL, "ListBox", NULL);
CListBox myWnd;
myWnd.FromHandle(Wnd);
// pDC->TextOut(1,1,myWnd.SendMessage(LB_GETTEXT));
pDC->TextOut(1,1,myWnd.GetCurSel());
}
However, the SendMessage fails because it fails the assert:
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_GETCURSEL, 0, 0); }