[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [computer-go] How to play go with other programe?
From: "Persson, Magnus" <persson@xxxxxxxxxxxxxxxxx>
> In Delphi you can get access to std input/output by calling the Windows
function GetStdHandle. I do not understand low level windows programming but it
seems to me that some aspects of the console is always there. It just the
console window that does not show up.
>
> FConsoleInput := GetStdHandle(STD_INPUT_HANDLE);
> FConsoleOutput := GetStdHandle(STD_OUTPUT_HANDLE);
>
> These handles can then be used just as any file handle using Writefile and
ReadFile.
This is correct, and applies not only to Delphi as this function is a standard
Windows API call. The one catch is that the executable must be linked with
special options, otherwise these calls return nothing useful.
See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/console_functions.asp
for all the details -- there are in fact plenty of things one can do with the
console in a Windows program.
regards,
Vlad
_______________________________________________
computer-go mailing list
computer-go@xxxxxxxxxxxxxxxxx
http://www.computer-go.org/mailman/listinfo/computer-go/