Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Thread Tools Rate Thread Display Modes
Old 02-19-2013, 06:41 PM
dluther dluther is offline
Registered User
Join Date: Feb 2013
Posts: 4
Custom IE Dialog - Session List

Hi everyone,

I created a custom IE dialog to address the lack of a "session list" when using tabbed sessions in a single window. It uses the "InternetExplorer.Application" object and some interesting DHTML/Styles/embedded icons to display a list of sessions you can select -- kind of an object lesson (no pun intended) in DHTML development and SecureCRT scripting for myself.

I'm attaching the current VBS code and the image, just in case the embedded image doesn't work to this message -- just remove the ".txt" extension. Use it, play with it, make improvements and suggestions...

Many thanks to Mike at VanDyke Software for his prompt e-mail assistance and gentle guidance -- often when normal people are counting sheep.

Here's a screen shot:

Attached Images
File Type: jpg session_list.jpg (176.9 KB, 1752 views)
Attached Files
File Type: txt select.vbs.txt (22.1 KB, 1598 views)

Last edited by jdev; 10-08-2020 at 07:44 AM.
Reply With Quote
Old 02-20-2013, 07:12 PM
dluther dluther is offline
Registered User
Join Date: Feb 2013
Posts: 4
BTW, There are a couple of properties you can use to set the window location to open the IE object at a specific location:

I think I'm close to figuring a way to get the screen XY coordinates of the main window -- just a bit more research into the inner workings of Windows, but I think it may be around this code:

set objWMIService = GetObject( "winmgmts://./root/cimv2" )
set colItems = objWMIService.ExecQuery( "Select * from Win32_Process where Name='SecureCRT.exe'", , 48 )

i = 1
for each objItem in colItems
    pStr = pStr + (CStr(i) & ": " & objItem.Caption & vbTab & objItem.ExecutablePath & VbCrLf)
    i = i + 1

    j = 1
    for each objProperty in objItem.Properties_
      pStr = pStr + ("   " & CStr(j) & ": " & objProperty.Name & ": " & objProperty.Value & VbCrLf)
      j = j + 1
' You can figure out what to do with "pStr"
Anyway, the "Handle" (and "ProcessID") should yield another object that I can query for the XY coordinates of the main SecureCRT window -- I just haven't found it. Yet.

From there, I should be able to adjust the coordinates to place the window somewhere inside the main window.
Reply With Quote
Old 02-25-2013, 09:33 AM
miked's Avatar
miked miked is offline
Registered User
Join Date: Feb 2004
Posts: 2,039
Here are a couple other approaches to finding SecureCRT's window position, in lieu of having a CRT object method or property: parse part of SecureCRT's Global.ini file, use AutoIT or similar third party application.

In the SecureCRT configuration folder you'll find a file named Global.ini. The following two lines in Global.ini show the last saved SecureCRT window position:
D:"X Position"=000000a9
D:"Y Position"=00000063

When you start SecureCRT, the X and Y positions will be accurate. If you start SecureCRT then move the window, it gets a little more complicated (still do-able). You'd need to save SecureCRT's settings to update the position within Global.ini before parsing out the variables/values needed. If you don't actually want to change settings you could backup the Global.ini to a different name, save SecureCRT settings, extract the X and Y position, then restore the Global.ini.

Alternatively, AutoIT and similar third party programs have functions which help you extract the window position. If you're comfortable installing a third party application, or already use AutoIT, then this approach may be worthwhile.
VanDyke Software
Technical Support
Reply With Quote

dialog , internet explorer , internetexplorer object , session list

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 07:17 AM.