Century Software, Inc., received comments from a customer writing a Visual Basic (VB) script to open TinyTERM with a specified .tpx file. Using the VB GetObject() command opens TinyTERM but makes it invisible. It’s listed in Task Manager, but there’s no icon or window for it, nor is there any way to bring it up. The basic script was
dim x
set x = getobject(“c:\default.tpx”)
‘x.visible = true
msgbox “test”
Note the line commented out. TinyTERM does not have a “visible” property to use in this situation.
The VB script that resolved the issue is:
dim retcode
dim alreadyrunning
set Wshshell= WScript.createobject(“wscript.shell”)
‘try to activate the tiny term window using the application title
Alreadyrunning = wshshell.appactivate(“C:\default.tpx”)
if not alreadyrunning then
‘launch Tiny Term
retcode = Wshshell.run (“%comspec% /C c:\default.tpx” , 1, FALSE)
Else
‘ send keystrokes to maximize the window
WshShell.SendKeys “% ”
WshShell.SendKeys “r”
end if
CR 735
This entry was posted
on Wednesday, May 2nd, 2007 at 1:23 pm and is filed under Scripting.
You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.