VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Console API Class

by Richard Caetano (1 Submission)
Category: Windows API Call/Explanation
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (8 Votes)

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

Download Console API Class

Download Console API Class (2 KB)

Console API Class Comments

No comments have been posted about Console API Class. Why not be the first to post a comment about Console API Class.

Post your comment

Subject:
Message:
0/1000 characters