|
CWnd *trywnd=this->FindWindowEx(NULL,NULL,"#32770","try");
CWnd *edit=this->FindWindowEx(trywnd->m_hWnd,NULL,"Edit","");
if(edit->m_hWnd)
{
edit->SendMessage(WM_SETTEXT,0,(LPARAM)(LPCTSTR)("fanqing"));
}
上面代码我测试过了成功.
但是使用
edit->setwindowtext没有成功.证明了楼上的一句话SetWindowText cannot change the text of a control in another application. |
|