#1
|
|||
|
|||
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: Last edited by jdev; 10-08-2020 at 07:44 AM. |
#2
|
|||
|
|||
BTW, There are a couple of properties you can use to set the window location to open the IE object at a specific location:
Code:
g_objIE.left=800 g_objIE.top=200 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 next next ' You can figure out what to do with "pStr" From there, I should be able to adjust the coordinates to place the window somewhere inside the main window. |
#3
|
||||
|
||||
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 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.
__________________
Mike VanDyke Software Technical Support [http://www.vandyke.com/support] |
![]() |
Tags |
dialog , internet explorer , internetexplorer object , session list |
Thread Tools | |
Display Modes | Rate This Thread |
|
|