Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:26

Using the menu system with an HTA and VBScript - [SOLVED]


Poster: Ginolard
Dated: Wednesday November 9 2005 - 10:19:50 GMT

Hi all,

I've written an HTA that emulates a tabbed browsing interface. What I'd like to do, if possible, is replace that with this wonderful menu system. So, what I need to know is how to call my VBscript Subs/Functions from the menu items. I've seen one answer that says the menu item should just say aI("text=doFunction;url=javascript:myfunction();");

However, all this does is open an IE page that tries to go to the page javascript:myfunction(), it doesn't run the Vbscript code in the HTA.

For example, I have one function that reboots a remote machine (let's called it RemReboot). What do I need to specify in the menu_data.js file to make it call the RemReboot Vbscript function in the HTA?


Poster: Ginolard
Dated: Wednesday November 9 2005 - 10:29:40 GMT

never mind, I found it in another post. For any others that want to know you do this

aI("text=Vbscript Menu Test;clickfunction=TestMsg();")

The TestMsg Sub/Function needs to be in your HTA


Poster: Ruth
Dated: Wednesday November 9 2005 - 14:37:47 GMT

Hi,

Thanks so much for posting the solution. We appreciate it. :)

Ruth


Poster: Ginolard
Dated: Wednesday November 9 2005 - 15:20:51 GMT

No problem. Now all I need to find out is how to make entries in the menu dynamic.

My HTA is used to get info on remote PCs and one of the things it retrieves is a list of shares available on the machine. Currently those shares are added to an HTML listbox from which the user selects which share to browse/manage. It would be nice to have a menu entry that is dynamically created with the various shares. I think that might be a little beyond my very limited JSscript skills though ;)


Poster: Ruth
Dated: Thursday November 10 2005 - 0:24:02 GMT

Well, it is way beyond mine :lol: But, I know there is a php menu which retrieves things from a data base, and there is also a asp, and something about mysql, so I'm sure it's possible.

Ruth


Poster: Andy
Dated: Monday November 21 2005 - 16:32:04 GMT

Hi,

There is a menu editing API at http://www.milonic.com/mm_menueditapi.js that will allow you to dynamically change menus and menu items.

-- Andy


Poster: Ginolard
Dated: Friday December 2 2005 - 15:06:01 GMT

Excuse my newbie ignorance but how do you incoporate this into a simple HTA? For example, here's a test one I have.

<HTA:APPLICATION
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="normal">
</head>


<Body>
<script type="text/javascript" src="milonic_src.js"></script>
<div class=milonic><a href="http://www.milonic.com/">JavaScript Menu, DHTML Menu Powered By Milonic</a></div>
<script type="text/javascript">
if(ns4)_d.write("<scr"+"ipt type=text/javascript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt type=text/javascript src=mmenudom.js><\/scr"+"ipt>"); </script>
<script type="text/javascript" src="menu_data2.js"></script>

</body>

<script language="VBScript">

Sub HELLOWORLD
MsgBox "HELLO WORLD"
End Sub
</script>

</html>

Let's say I have another Sub that goes off and gets all the open shares on a machine. How can I have the API add a menu item for each share?

I hope I've explained that correctly.