VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Console API Class

Richard Caetano  (1 Submission)   Windows API Call/Explanation   Visual Basic 5.0   Intermediate   Wed 3rd February 2021

Visual Basic doesn't have the ability to read or write from the console. To accomplish this, the Win32 API exports a set of functions that interacts with a console window using handles.
clsWinConsole is a simple VB class that encapsulates the code needed to open, write/read, and close a console window. Here is a code snippet that demonstrates how to use clsWinConsole:


Public Sub Main()
Dim console as New clsWinConsole
Dim inp As String
console.Show
console.WriteText "Text"
inp = console.ReadText
console.WriteText inp
console.Hide
End Sub

Side Effects
Tested with Windows 2000 and Windows XP

Rate Console API Class (8(8 Vote))

Download Console API Class

Console API Class Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters