关于WM_GETTEXT的应用

HWND hw = ::FindWindow(NULL,"Form1");
HWND hw2 = ::FindWindowEx(hw,NULL,NULL,NULL);

int len = ::SendMessage(hw2, WM_GETTEXTLENGTH, 0, 0);
char* buffer = new char[len+1];
int n = ::SendMessage(hw2,WM_GETTEXT,len+1,(LPARAM)buffer);
MessageBox(buffer);

 

posted @ 2016-11-30 16:21  Hexa33  阅读(3888)  评论(0编辑  收藏  举报