Gene Posted February 18, 2007 Posted February 18, 2007 Never made a Tray Menu before. Now I need one for a GUIless utility. I used Koda to develop one and it runs OK except it appears to expect a GUI. I opened the Help file Tray Menu example and tried it out, its OK (no GUI needed), but it doesn't give any instances of calling a subitem. The Help Example and the Koda generated code are so different that I don't quite see how to relate between them. Both are shown below, I'd appreciate some direction on how to use the Koda code, and a smal comparison of the Help EX vs. the Koda code. CODE#include #Region ### START Koda GUI section ### Form=K:\My Documents\_Dev\_Projects\InternetConnectionMonitor\ICM-TrayMenu.kxf Local $Form1 = GUICreate("AForm1", 633, 447, 213, 115) TraySetClick("9") Local $EMailConfig = TrayCreateMenu("E-Mail Config") Local $SMTPserverPort = TrayCreateItem("SMTP: Server Port", $EMailConfig) Local $SMTPserverName = TrayCreateItem("SMTP: Server Name", $EMailConfig) Local $FromName = TrayCreateItem("From: Name", $EMailConfig) Local $FromAcctUserId = TrayCreateItem("From: Acct. User Id", $EMailConfig) Local $FromPassword = TrayCreateItem("From: Acct. Password", $EMailConfig) Local $FromEmailAddress = TrayCreateItem("From: Email Address", $EMailConfig) Local $ToSubject = TrayCreateItem("To: Subject", $EMailConfig) Local $ToName = TrayCreateItem("To: Name", $EMailConfig) Local $Config = TrayCreateMenu("Config") Local $MaxRows = TrayCreateItem("Max Rows", $Config) Local $Intervals = TrayCreateItem("Intervals", $Config) Local $ViewLogs = TrayCreateMenu("View Logs") Local $EmailLog = TrayCreateItem("E-Mail Log", $ViewLogs) Local $ErrorLog = TrayCreateItem("Error Log", $ViewLogs) Local $MainLog = TrayCreateItem("Main Log", $ViewLogs) Local $Exit = TrayCreateItem("Exit") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $AForm1 Case $AForm1 Case $AForm1 Case $AForm1 EndSwitch WEnd Now the Help file code... CODE#Include #NoTrayIcon Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown. $settingsitem = TrayCreateMenu("Settings") $displayitem = TrayCreateItem("Display", $settingsitem) $printeritem = TrayCreateItem("Printer", $settingsitem) TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $aboutitem Msgbox(64,"about:","AutoIt3-Tray-sample") Case $msg = $exititem ExitLoop EndSelect WEnd Exit [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now