turbox Posted August 23, 2008 Share Posted August 23, 2008 I want the tray buttons working while it sleep $prefsitem = TrayCreateItem("Preferences") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $prefsitem Msgbox(64, "Preferences:", "OS:" & @OSVersion) Case $msg = $aboutitem Msgbox(64, "About:", "AutoIt3-Tray-sample.") Case $msg = $exititem ExitLoop EndSelect WEnd sleep(353522) Link to comment Share on other sites More sharing options...
James Posted August 23, 2008 Share Posted August 23, 2008 AutoIt is single threaded only. To get something close, try AdlibEnable(). Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
burners Posted August 24, 2008 Share Posted August 24, 2008 have your code trigger a seperate .au3 and run it at the same time with the first script controlling what the second one does. ~~--Feel Free to Steal my Sigs --~~FLAT LOOK____________________________________ROUNDED LOOK Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 25, 2008 Share Posted August 25, 2008 I want the tray buttons working while it sleep $prefsitem = TrayCreateItem("Preferences") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $prefsitem Msgbox(64, "Preferences:", "OS:" & @OSVersion) Case $msg = $aboutitem Msgbox(64, "About:", "AutoIt3-Tray-sample.") Case $msg = $exititem ExitLoop EndSelect WEnd sleep(353522) This is what event mode was invented for: Opt("TrayOnEventMode", 1) Opt("TrayAutoPause", 0) Opt("TrayMenuMode", 1) Global $prefsitem = TrayCreateItem("Preferences") TrayItemSetOnEvent(-1, "_TrayItemHit") TrayCreateItem("") Global $aboutitem = TrayCreateItem("About") TrayItemSetOnEvent(-1, "_TrayItemHit") TrayCreateItem("") Global $exititem = TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "_TrayItemHit") TraySetState() While 1 Sleep(353522) WEnd Func _TrayItemHit() Switch @TRAY_ID Case $prefsitem MsgBox(64, "Preferences", "You clicked on preferences") Case $aboutitem MsgBox(64, "About", "You clicked on about") Case $exititem Exit EndSwitch EndFunc ;==>_TrayItemHit Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
rudi Posted August 25, 2008 Share Posted August 25, 2008 This is what event mode was invented for: Opt("TrayOnEventMode", 1) Thanks a lot! That's exactly what I searched for a few days ago. @ Dev / Doku Team: In the Help File all the Opt() do not have particular examples for all the options. This sample code for Opt("TrayOnEventMode",1) might be enlighting for others, too? Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
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