Artifact Content

Not logged in

Artifact cdfb975c113a563c8631f1ac5ecf0d7a71506ec8


import core.runtime;
import win32.windows;
import std.stdio;
import std.string;

alias extern(Windows) int function( HWND a, immutable char* b, char* c, DWORD d ) CmdFuncT;

void main()
{
	for(;;) {
		write("> ");
		string s = readln();
		if(s.length > 0) {
			HINSTANCE h = cast(HINSTANCE) Runtime.loadLibrary("QBga32.DLL");
			CmdFuncT Bga = cast(CmdFuncT)GetProcAddress(h, "Bga");
			int r = Bga(NULL, s.toStringz(), null, 0);
			Runtime.unloadLibrary(h);
			writeln("Return: ", r);
		}
	}
}