Hello,
I am enumerating windows on windows. I get the HWND in enumerate function.
If I use wide character method, I see console output only shows 3 windows titles:
Code:
TCHAR* buff;
buff = new TCHAR[length + 1];
memset(buff, 0, (length + 1) * sizeof(TCHAR));
GetWindowText(hWnd, buff, length + 1);
tstring winTitle = tstring(buff);
delete[] buff;
const wchar_t* wTitle = winTitle .c_str();
wcout << TEXT("wTitle: ") << wTitle << std::endl;
But if use simple string method, I see console outputs 18 windows titles:
Code:
char buff[1026];
int res = GetWindowTextA(hWnd, buff, 1026);
printf(buff)
What might be the issue with GetWindowText so that it prevents other 15 windows titles to be printed? How can I trace the issue with GetWindowText and wide characters?
This is C++ console application in VS Community 2017.
Cheers