admin 发表于 2024-3-14 20:11:06

[每日一码] 获取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]
查看完整版本: [每日一码] 获取ACAD文本窗口内容