编程论坛
注册
登录
编程论坛
→
VC++/MFC
如何获取messagebox中显示的内容?用sdk
佳嘉
发布于 2012-03-31 17:25, 862 次点击
请问一下,有什么方法?可以获取messagebox对话框中显示的内容,我用findwindsow试过,但是有两个Static类的子窗口!谢谢
1 回复
#2
马甲1号
2012-04-01 14:42
程序代码:
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);
1