如何获取messagebox中显示的内容?用sdk
请问一下,有什么方法?可以获取messagebox对话框中显示的内容,我用findwindsow试过,但是有两个Static类的子窗口!谢谢
程序代码:
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) { TCHAR szBuf[4096]; GetClassName(hwnd, szBuf, sizeof(szBuf)); string str = szBuf; if(!("#32770")) { HWND hSubWnd = GetDlgItem(hwnd, 0xffff); if(hSubWnd) { int len = GetWindowText(hSubWnd, szBuf, sizeof(szBuf)); cout << "Found it:" <<szBuf <<endl; } } return TRUE; }
call EnumWindows(EnumWindowsProc, NULL);