Artifact Content

Not logged in

Artifact cc2ab2b91c87057b3522028258f6b9806ee4df71


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

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

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