[每日一码] 获取ACAD文本窗口内容
static void MyGroupTextFrame () {HWND hwnd = AcadGetTextFrameHandle();
WCHAR buf=L"";
WCHAR TotalBuf=L"";
if (hwnd) {
if (GetWindowTextW(hwnd, buf, sizeof(buf)/sizeof(buf)-1) > 0) {
StrCatW(TotalBuf,buf);
}
HWND hwndChild = GetWindow(hwnd,GW采用CHILD);
hwndChild = GetWindow(hwndChild,GW采用CHILD);
hwndChild = GetWindow(hwndChild,GW采用CHILD);
do {
if (GetWindowTextW(hwndChild, buf, sizeof(buf)/sizeof(buf)-1) > 0) {
StrCatW(TotalBuf,采用T("\n")); StrCatW(TotalBuf,buf);
}
} while (hwndChild = GetWindow(hwndChild, GW采用HWNDNEXT));
acutPrintf(采用T("\nBuf==%s"), TotalBuf);
}
}
页:
[1]