(WinAPI) FindWindowW always fails

Виталий Фадеев vital.fadeev at gmail.com
Thu Oct 8 20:05:29 UTC 2020


On Thursday, 8 October 2020 at 19:39:05 UTC, Deen O'Connor wrote:
> ...
> import std.stdio;
> import std.conv;
> import core.sys.windows.windows;
>
> void main(string[] args) {
>     wstring wndName = "x32dbg";
>     HWND hWnd = FindWindowW(null, cast(wchar*)&wndName);
>     if (hWnd is null) {
>         writeln("Error 0x" ~ to!string(GetLastError(), 16) ~ " 
> in FindWindowW()!");
>     } else {
>         writeln("x32dbg window: 0x" ~ to!string(cast(uint)hWnd, 
> 16));
>     }
> }

and may be you find interesting this construction:
writefln( "x32dbg window: %X", hWnd );



More information about the Digitalmars-d mailing list