How to get AutoCAD’s Test Command Line window handle without using MFC?

How to get AutoCAD’s Test Command Line window handle without using MFC?

Anonymous
Not applicable
1,108 Views
3 Replies
Message 1 of 4

How to get AutoCAD’s Test Command Line window handle without using MFC?

Anonymous
Not applicable

I want to get the handle of AutoCAD’s Test Command Line window.

I found objectARX API acedGetAcadTextCmdLine. This API can return the pointer of that window. In order to use acedGetAcadTextCmdLine function, my project must depend on MFC libray, this is what i donot want.

      

How can I get the handle of AutoCAD’s Test Command Line window handle without using MFC, is there any other objectARX API can do this?

0 Likes
Accepted solutions (1)
1,109 Views
3 Replies
Replies (3)
Message 2 of 4

Alexander.Rivilis
Mentor
Mentor

1. There is no "Test window" but is "Text window"

2. There is no any other ObjectARX API for getting handle of "Text window"

So without MFC you have to use Win32 API methods to get this handle.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

0 Likes
Message 3 of 4

Alexander.Rivilis
Mentor
Mentor
Accepted solution

I've found undocumented function:

 

 

HWND AcadGetTextFrameHandle(void);

Maybe it help you. Sample code:

 

 

static void MyGroupTextFrame () {
  HWND hwnd = AcadGetTextFrameHandle();
  WCHAR buf[100000]=L"";
  WCHAR TotalBuf[100000]=L"";
  if (hwnd) {
    if (GetWindowTextW(hwnd, buf, sizeof(buf)/sizeof(buf[0])-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[0])-1) > 0) {
        StrCatW(TotalBuf,_T("\n")); StrCatW(TotalBuf,buf);
      }
    } while (hwndChild = GetWindow(hwndChild, GW_HWNDNEXT));
    acutPrintf(_T("\nBuf==%s"), TotalBuf);
  }
}

 

 2016-09-12_19-55-20.png

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 4 of 4

Anonymous
Not applicable

Dear Alexander.Rivilis:

Thanks for your replay, it solves my problem.

I am very sorry for the spelling mistake I have make.

 

Thanks!

0 Likes