supadodger 0 Posted December 20, 2010 if $cmdline[1] <> "icon" then #notrayicon EndIf Share this post Link to post Share on other sites
supadodger 0 Posted December 20, 2010 If $cmdline[1] <> "icon" then Opt ("TrayIconHide",1) EndIf Share this post Link to post Share on other sites
ZacUSNYR 4 Posted December 20, 2010 You could always hide the icon with #NoTrayIcon then in your code where you'd want it to show use AutoItSetOption("TrayIconHide", 0) You could also change the 0 to 1 and put that in your if statement, but the icon would flash and then go away there. Share this post Link to post Share on other sites
Steveiwonder 0 Posted December 20, 2010 (edited) Hello, Look up TraySetState() if $cmdline[1] == "icon" Then TraySetState(1) ; Show Else TraySetState(2) ; Hide EndIf sleep(10000) Stevo edit: typo Edited December 20, 2010 by Steveiwonder They call me MrRegExpMan Share this post Link to post Share on other sites
ZacUSNYR 4 Posted December 20, 2010 (edited) #NoTrayIcon if $cmdline[1] <> "icon" then ;code Else AutoItSetOption("TrayIconHide", 0) ;else code and show the tray icon. EndIf Edited December 20, 2010 by ZacUSNYR Share this post Link to post Share on other sites
kaotkbliss 146 Posted December 20, 2010 (edited) No, I don't think that will work because Windows needs to know what it is doing with a program (and it's icon) the instant the program is started. (does it show an icon, which icon? does it not show an icon?) trying to put #NoTrayIcon later in the script means that windows would have to run your program partially before finding out what it needs to do with the icon. (my guess as to how it would work) You may have to use Opt("TrayIconHide", 1) to hide Opt("TrayIconHide", 0) to unhide But the icon will show briefly until this line is executed. *edit* Wow... Way too slow. Edited December 20, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites