Search Tools Links Login

console application full screen


Visual Basic 6, or VB Classic

get your vbscript console applications running under cscript using the stdin & stdout objects for input running full-screen. and get the fore and background collor set to the color you like

Original Author: DVM

Code

option explicit
dim oShell: set oShell = CreateObject("WScript.Shell")
' asume it started tweaked
dim bTweaked: bTweaked = true
' is it tweaked?
if wscript.arguments.count = 0 then
bTweaked = false
elseif not wscript.arguments(0) = "tweaked" then
bTweaked = false
end if
' if not, let's tweak it
if not bTweaked then
dim kFullScreen, kScreenColors
kFullScreen = oShell.regRead("HKCUConsoleFullScreen")
kScreenColors = oShell.regRead("HKCUConsoleScreenColors")
oShell.regwrite "HKCUConsoleFullScreen", 1, "REG_DWORD"
oShell.regWrite "HKCUConsoleScreenColors", 9, "REG_DWORD"
oShell.run "cscript.exe /NoLogo """ & wscript.scriptfullname & """ tweaked"
wscript.sleep 5000
oShell.regwrite "HKCUConsoleFullScreen", kFullScreen, "REG_DWORD"
oShell.regWrite "HKCUConsoleScreenColors", kScreenColors, "REG_DWORD"
set oShell = nothing
wscript.quit
end if
dim oIn: set oIn = wscript.stdIn
dim oOut: set oOut = wscript.stdOut
oOut.writeLine "press enter to contintue..."
call oIn.readLine

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 116 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.