I have these two lines in my code:
TCHAR String[400] = {0}; SendMessageW(hwnd, WM_GETTEXT,sizeof(String), (LPARAM)String);
When I use it that w
You are using wchar_t, sizeof(String) will be 800, not 400. Fix:
wchar_t String[400] = 0; SendMessageW(hwnd, WM_GETTEXT, sizeof(String) / sizeof(wchar_t), (LPARAM)String);