i have the same idea before,
but i don't remember what i did before,
for now, i can only think of sending esc key to widget after popup menu,
to close the menu right after it shown,
maybe not the best way but think of it as a temporary solution
example:
Code:
var wsc=new ActiveXObject("WScript.Shell")
function widgetOnPopupMenu()
{
widget.ForceToFround()
wsc.SendKeys("{Esc}")
setTimeout("sendthekey",100)
}
function sendthekey()
{
widget.ForceToFround()
wsc.SendKeys("{Esc}")
}
explanations:
1. first it will create an activex object
2. i have used ForceToFround() to make the widget in focus, to prevent sending key to another program incorrectly
3. SendKeys() will send the key to the program in focus (it will simulate the key press by activex object)
4. i have sent key 2times to prevent any possibility of the menu occurance
5. i have used settimeout() to do the 2nd sendkey() with delay of 100ms
Note:don't forget to link the widgetOnPopupMenu() function to its Event