Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Create a cascading context menu for Internet explorer

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61924
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Create a cascading context menu for Internet explorer
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 Create a cascading context menu for Internet explorer - 6/27/2008 2:36:35 AM   
  hpram99

 

Posts: 10
Score: 0
Joined: 6/27/2008
Status: offline
I can't quite figure out how to do this.  I know how to add a single item to the context menu by editing the registry, but I need to be able to create a cascading menu of options to select, I know this can be done in C++, but I'm terrible at programming and only know a little VBS scripting.

Any help to point me in the right direction is appreciated.

Example of cascading contect menu:

Right click in IE an you get this:

Copy
Paste
etc....
Script -> (sub menu pops out)
  - Option 1
  - Option 2
  - etc
 
 
Post #: 1
 
 RE: Create a cascading context menu for Internet explorer - 6/27/2008 2:51:57 AM   
  4scriptmoni


Posts: 192
Score: 0
Joined: 5/3/2007
Status: offline
I belive it requires a special ActiveX or .dll. As far as I know Its not something easly done in plain vbs.

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net

(in reply to hpram99)
 
 
Post #: 2
 
 RE: Create a cascading context menu for Internet explorer - 6/27/2008 3:10:16 AM   
  hpram99

 

Posts: 10
Score: 0
Joined: 6/27/2008
Status: offline
Shoot...

If it is just an activeX component, is it not possible to call the activex as an object in vbs?

(in reply to 4scriptmoni)
 
 
Post #: 3
 
 RE: Create a cascading context menu for Internet explorer - 6/30/2008 5:26:57 AM   
  Rischip


Posts: 468
Score: 2
Joined: 3/26/2007
Status: offline
This is extremely basic, but this example has most of the techniques necessary to get you going if you want to build it directly in the page.




      

_____________________________

Rischip
Author of - The Grim Linker

(in reply to hpram99)
 
 
Post #: 4
 
 RE: Create a cascading context menu for Internet explorer - 6/30/2008 5:32:20 AM   
  dm_4ever


Posts: 2430
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
Rischip...very neat trick. 

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Rischip)
 
 
Post #: 5
 
 RE: Create a cascading context menu for Internet explorer - 7/2/2008 1:56:43 AM   
  Rischip


Posts: 468
Score: 2
Joined: 3/26/2007
Status: offline
I like doing DHTML, but sometimes it is really alot harder than it should be.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to dm_4ever)
 
 
Post #: 6
 
 RE: Create a cascading context menu for Internet explorer - 7/7/2008 1:52:41 PM   
  TNO


Posts: 1064
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Its not as difficult as it seems, just push most the work onto css, All you have to focus on is toggling the display of the contextmenu and getting the mouse position


      

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to Rischip)
 
 
Post #: 7
 
 RE: Create a cascading context menu for Internet explorer - 8/4/2008 3:41:41 AM   
  hpram99

 

Posts: 10
Score: 0
Joined: 6/27/2008
Status: offline
I appreciate the examples, unfortunately I am not buiilding a webpage, this is being done via WSH on a PC

The menu I speak of is the context menu built into internet explorer the one that has your normal copy/paste/delete etc.. commands

See here: http://msdn.microsoft.com/en-us/library/aa753589.aspx

(in reply to TNO)
 
 
Post #: 8
 
 RE: Create a cascading context menu for Internet explorer - 8/4/2008 10:27:39 AM   
  TNO


Posts: 1064
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Actually, I wrote something for this awhile ago too that is somewhat related:

http://www.visualbasicscript.com/m_27971/mpage_1/key_context%2cmenu/tm.htm#27971

The problem is that it is  VERY impractical  to push items into a submenu without writing a browser plugin. The most viable alternative is to use DHTML like the examples given or what the bookmarklets do and inject a temporary script into the page that does all the work (whether it renders a submenu or opens its own GUI).

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to hpram99)
 
 
Post #: 9
 
 RE: Create a cascading context menu for Internet explorer - 8/4/2008 8:35:45 PM   
  hpram99

 

Posts: 10
Score: 0
Joined: 6/27/2008
Status: offline
I already do something similar since I can't figure out the cascading context menus.  I currently have a single line item in the normal IE right-click menu.  When clicked, it launches a local file which creates a separate menu.
Unfortunately this is not the most efficient as it takes time to load the file that renders the new menu, and overall looks pretty chintzy.  I was hoping for a more integral solution using cascading menus

(in reply to TNO)
 
 
Post #: 10
 
 RE: Create a cascading context menu for Internet explorer - 8/4/2008 11:15:22 PM   
  TNO


Posts: 1064
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
Mind posting what you have so far? We might have some ideas for speeding up or cleaning up the process.

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to hpram99)
 
 
Post #: 11
 
 RE: Create a cascading context menu for Internet explorer - 8/8/2008 3:16:25 AM   
  hpram99

 

Posts: 10
Score: 0
Joined: 6/27/2008
Status: offline
I don't mind at all, but none of it is actually VBS, or any kind of programming/scripting

Right now I simply place a registry entry into

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\&Macros\
default = C:\Program Files\Macro Express3\contextmenu.htm

The "contextmenu.htm" file contains this:

<HTML><BODY ONLOAD='var Shell = new ActiveXObject("WScript.Shell"); Shell.Run("file:///c|/PROGRA~1/MACROE~1/MeProc.exe /ATopMenu");'></BODY></HTML>

Macro Express is licenced in our business here and installed on all the PC's, it has menu functionality built it, so the "MeProc.exe /ATopMenu" command is actually launchin a menu to appear.
This isn't ideal because of multiple things
1. you loose focus of IE because the menu is actually an entirely separate program (regaining focus requires an extra step because of this)
2. the delay to launch MeProc.exe and then the actuall "TopMenu" macro within the program takes a few seconds, which is terrible from a professional standpoint
3. this is used very frequently, so the extra clicks included are also time consuming it's currently rightclick, click, *wait* click, click

I'd be more than willing to hack away at some C++ if it's going to require me doing so, I'm not a programmer, but I'll be damned if I can't get this into a REAL context menu!!

Thanks again to all for the suggestions

(in reply to TNO)
 
 
Post #: 12
 
 RE: Create a cascading context menu for Internet explorer - 8/8/2008 4:12:33 AM   
  Rischip


Posts: 468
Score: 2
Joined: 3/26/2007
Status: offline
What are the Titles of the options that you desire, and what tasks do you wish each option to carry out?
I'm not sure it can be done easily in the "popout" manner you desire without an activex control, but we can look into it.
Script -> (sub menu pops out)
  - Option 1
  - Option 2
  - etc

_____________________________

Rischip
Author of - The Grim Linker

(in reply to hpram99)
 
 
Post #: 13
 
 RE: Create a cascading context menu for Internet explorer - 8/8/2008 4:32:09 AM   
  hpram99

 

Posts: 10
Score: 0
Joined: 6/27/2008
Status: offline
The options will change and be updated frequently, so for now lets just call it like this:

Macros
-->Macro1
-->Macro2
-->Macro3

We use Macro Express as login script, it adds a lot more power to the simple vbs login scripts as it has the power to do anything a keyboard and mouse can do. So forcing updates shouldn't be an issue if I chose to add options/rename existing menus

I don't mind if it has to be done with an activex, I just don't know how!

The issue is, I'd like it to look exactly like native windows functionality, exactly like the current IE menu

here's a picture of what I'm talking about: (although this is for windows explorer, not internet explorer, but same idea & look)

http://www.codeguru.com/img/legacy/shell/CascadingMenus2.gif

(in reply to Rischip)
 
 
Post #: 14
 
 RE: Create a cascading context menu for Internet explorer - 8/8/2008 6:29:56 AM   
  Rischip


Posts: 468
Score: 2
Joined: 3/26/2007
Status: offline
Ok, It appears that you can only ADD single level menu items through the registry.You can replace the ENTIRE contextmenu in a page by cancelling the bubble and showing your own DHTML menu.
But you can not ADD cascading menus to the existing context menu without going with COM and implementing IContextMenu. Basically you either list items as single menu items in the default context menu or you go COM.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to hpram99)
 
 
Post #: 15
 
 RE: Create a cascading context menu for Internet explorer - 8/10/2008 9:06:13 PM   
  hpram99

 

Posts: 10
Score: 0
Joined: 6/27/2008
Status: offline
and what's the issue with going COM?  Unfortunately any examples are written in C++ (which I already knew of)

Can't a vbs or even normal vb use this com?

(in reply to Rischip)
 
 
Post #: 16
 
 RE: Create a cascading context menu for Internet explorer - 8/11/2008 12:45:34 AM   
  Rischip


Posts: 468
Score: 2
Joined: 3/26/2007
Status: offline
The only issue is.... You have to find one to do what you want, then you have to install it on all the client machines. It is not apart of the default OS.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to hpram99)
 
 
Post #: 17
 
 RE: Create a cascading context menu for Internet explorer - 8/11/2008 1:02:34 AM   
  Rischip


Posts: 468
Score: 2
Joined: 3/26/2007
Status: offline
If you dare... Here is an article which might be helpful. http://www.codeguru.com/cpp/misc/misc/internetexplorer/article.php/c11007/#more

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Rischip)
 
 
Post #: 18
 
 RE: Create a cascading context menu for Internet explorer - 8/12/2008 3:13:18 AM   
  hpram99

 

Posts: 10
Score: 0
Joined: 6/27/2008
Status: offline
meh, that's the beauty of "undo disks" in virtual pc

Codeguru seems to have some fantastic examples, unfortunately in C++
The particular link shows me how to add a single line item to the menu, the rest of it is showing how to code a pop-up box and write a file.  Doesn't have any reference to what I specifically need - cascading context

I really should pull out the blackbook and start reading up on it.... but then again I'm supposed to be studying for my cert. haha..


Creating a "program" to install is not an issue, Macro Express is a fantasticly easy macro tool that is essentially my team's login script & group policy.  I can easily tell  it to dynamically draw a painting every 30 minutes if I so deemed.

Unfortunately, writing the app is not as simple as sketching something in mspaint, I need examples.... no chance of this happening in the only language I can script?

< Message edited by hpram99 -- 8/12/2008 3:15:18 AM >

(in reply to Rischip)
 
 
Post #: 19
 
 RE: Create a cascading context menu for Internet explorer - 8/12/2008 10:15:06 AM   
  TNO


Posts: 1064
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
DynaWrap or VBA should allow Win32 access yes? Maybe there is a workaround hack for it through those...

I still vote for an in page override to create a custom context menu in DHTML. It's the path of least resistance.

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to hpram99)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Create a cascading context menu for Internet explorer Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts