首页 > 代码库 > 关于WM_GETTEXT的应用

关于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);

 

关于WM_GETTEXT的应用