(WinAPI) FindWindowW always fails
Bastiaan Veelo
Bastiaan at Veelo.net
Thu Oct 8 20:04:40 UTC 2020
On Thursday, 8 October 2020 at 19:39:05 UTC, Deen O'Connor wrote:
> HWND hWnd = FindWindowW(null, cast(wchar*)&wndName);
...
> So, am i doing something wrong, or is this a bug?
You are taking the address of a slice and pass it as if it were a
C string. You can use toUtf16z for a conversion, but do note the
limitations of toUtfz.
-Bastiaan
PS this is more a subject for the Learn forum.
More information about the Digitalmars-d
mailing list