How to get the contents of a text field in C ++?
Use the Win32 GetWindowText API passing in the text box window handle.
If you want to get text from another process, use WM_GETTEXT instead of SendMessage .
CWnd :: GetWindowText ()
GetWindowText()
:
//unicode std::string or std::wstring typedef std::basic_string<TCHAR> unicode_string; unicode_string GetWinString(HWND h) { int len = ::GetWindowTextLength(h); if (len) { std::vector<TCHAR> tmp(len + 1,_T('\0')); ::GetWindowText(h,&tmp[0],len + 1); return &tmp[0]; } return _T(""); }
Source: https://habr.com/ru/post/1766264/More articles:Saving modules independently of each other while using each other - c ++ASP.NET auth, exclude root and allow anonymity - asp.netHow to organize code for javascript UI widget? - javascriptHow to make the player smoothly move around the terrain in the game? - mathUpload file to web server using C ++ - c ++android fullscreen text - androidHow to get the number of months and days from two dates - tsqlHow to get GKPlayer status from Game Center? - objective-cДоступ к контейнеру единства в поле зрения класса модели - wpfjquery key up and down. Search Results Navigation - jqueryAll Articles