Sign in to follow this  
Followers 0
godsstigma

Tray menu control help

4 posts in this topic

Ok, so I am probably going about this completely wrong, but I have no clue what to try now

Please help:

I found a sample script that integrates IE into a GUI and runs www.pandora.com and I was trying to create a tray menu that would allow me to hide and show the GUI (simple right???). Well I can not get the menu controls to work at all.

here is the code

#include <GUIConstants.au3>
#include <IE.au3>

Opt("TrayMenuMode", 1)
Opt("TrayMenuMode", 1)

$PanTask = _IECreateEmbedded()
$Form1 = GUICreate("Pandora Radio", 608, 450)
$PanGUI = GUICtrlCreateObj($PanTask, -62, -136, 1024, 1024)
TraySetClick("9")
$Menu_exit = TrayCreateItem("Exit")
GUICtrlSetOnEvent($Menu_exit, "ExitGUI")
$Menu_Show = TrayCreateItem("Show")
GUICtrlSetOnEvent($Menu_Show, "ShowGUI")
$Menu_Hide = TrayCreateItem("Hide")
GUICtrlSetOnEvent($Menu_Hide, "HideGUI")
GUISetState(@SW_SHOW, $Form1)
_IENavigate ($PanTask, "http://www.pandora.com", 0)

While 1
    sleep(10)
WEnd

Func exitGUI()
    Exit
EndFunc

Func showGUI()
    GUISetState(@SW_SHOW, $Form1)
EndFunc

Func HideGUI()
    GUISetState(@SW_HIDE, $Form1)
EndFunc

Any help would be much appreciated.

Thanks

Share this post


Link to post
Share on other sites



Also use TrayItemSetOnEvent() instead of GUICtrlSetOnEvent()

Share this post


Link to post
Share on other sites

All those peices still wouldn't have worked... this does

#include <GUIConstants.au3>
#include <IE.au3>

Opt("GUIOnEventMode", 1)
Opt("TrayMenuMode", 1)
Opt("TrayOnEventMode", 1)

$PanTask = _IECreateEmbedded()
$Form1 = GUICreate("Pandora Radio", 608, 450)
GUISetOnEvent($GUI_EVENT_CLOSE, "ExitGUI", $Form1)
$PanGUI = GUICtrlCreateObj($PanTask, -62, -136, 1024, 1024)
GUISetState(@SW_SHOW, $Form1)

TraySetClick("9")
$Menu_exit = TrayCreateItem("Exit")
TrayItemSetOnEvent($Menu_exit, "ExitGUI")
$Menu_Show = TrayCreateItem("Show")
TrayItemSetOnEvent($Menu_Show, "ShowGUI")
$Menu_Hide = TrayCreateItem("Hide")
TrayItemSetOnEvent($Menu_Hide, "HideGUI")

_IENavigate($PanTask, "http://www.pandora.com", 0)

While 1
    Sleep(10)
WEnd

Func exitGUI()
    Exit
EndFunc   ;==>exitGUI

Func showGUI()
    GUISetState(@SW_SHOW, $Form1)
EndFunc   ;==>showGUI

Func HideGUI()
    GUISetState(@SW_HIDE, $Form1)
EndFunc   ;==>HideGUI

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0