Before Disch gets in, I may as well say it: GetWindowText doesn't necessarily accept wide strings. It might accept normal strings if your compiler settings are different.
There are two functions
GetWindowTextA <- asci: accepts ASCII LPSTR
GetWindowTextW <- unicode accepts Wide LPWSTR
GetWindowText becomes GetWindowTextW if wide characters are enabled, and GetWindowTextA otherwise.
Instead, you should use TCHAR and LPTSTR. It automatically takes on the form of wide or non wide as appropriate. Then the function to use is _ttol().
Thank you all for your kind support I am a beginner so I am not using standard coding format so len1, len2, are two names given to a variable. Do you need the full code to solve the problem?
if it is essential i will provide it here for you.