WRITING TO THE CONSOLE FROM LIBERTY BASIC

sample program by Brent Thorn, used by permission

mailto:lbgui@aol.com

Home

Color Controls

Colored Textboxes

INPUTTO$

Spotlight

Development4Life?

console program

console API

Volunteer

Newsletter Help

Index

NoMainWin
Open "Kernel32" For DLL As #kernel
CallDLL #kernel, "AllocConsole", success As long
If success Then

CallDLL #kernel, "GetStdHandle", _
_STD_INPUT_HANDLE As long, _
hStdIn As long

CallDLL #kernel, "GetStdHandle", _
_STD_OUTPUT_HANDLE As long, _
hStdOut As long

buffer$ = "Press any key to close this window... " + Chr$(0)
buflen = Len(buffer$) - 1
Struct bytes, number As ulong

CallDLL #kernel, "WriteFile", _
hStdOut As long, _
buffer$ As ptr, _
buflen As long, _
bytes As struct, _
0 As long, _
success As long

CallDLL #kernel, "ReadFile", _
hStdIn As long, _
buffer$ As ptr, _
1 As long, _
bytes As struct, _
0 As long, _
success As long

CallDLL #kernel, "FreeConsole", success As long
End If
Close #kernel
End


Home

Color Controls

Colored Textboxes

INPUTTO$

Spotlight

Development4Life?

console program

console API

Volunteer

Newsletter Help

Index