xxxxxxxxxx
import std.stdio: writeln;
extern (System) nothrow
{
alias WNDENUMPROC = int function(void*, long);
}
extern (System) nothrow
{
int EnumWindowsSimulator(WNDENUMPROC f, long params)
{
f(cast(void*) 0, params);
f(cast(void*) 1, params);
return 0;
}
}
void main() {
void*[] hWndList;
static extern (System) int mycallback(void* hWnd, long lparam) nothrow {
*(cast(void*[] *) lparam) ~= hWnd;
return true;
}
EnumWindowsSimulator(&mycallback, cast(long) &hWndList);
writeln(hWndList);
}