ThomasH Posted December 3, 2008 Share Posted December 3, 2008 Hi, im a newbie in AutoIt scripting and i've a problem with the automatic check/unchek-function of trayitems. I use V3.2.12.1 under Win98 SE, eventually my problem results only under this old windowsversion. Start the samlecode below and DONT click the ok button of the messagebox. In the systemtray you have my two entries, but only the "work"-item is check- and uncheck-able The "dont work"-item you can not check. Where is the problem? #include <Constants.au3> #include <GUIConstantsEx.au3> Opt("TrayAutoPause",0) Opt("TrayOnEventMode",1) $TrayWork = TrayCreateItem("work") $TrayDWork = TrayCreateItem("dont work") TrayItemSetState($TrayWork,$TRAY_CHECKED) TrayItemSetState($TrayDWork,$TRAY_UNCHECKED) TraySetState() MsgBox(0,"","checked work: " &TrayItemGetState($TrayWork) &@CRLF &"unchecked dont work: " &TrayItemGetState($TrayDWork)) Link to comment Share on other sites More sharing options...
Zedna Posted December 3, 2008 Share Posted December 3, 2008 (edited) The same behaviour is also on WINXP. I think this is intentional (but I'm not sure about that) to be possible to distinguish between normal/"checkable" menu item. If it's checked at start it will be created as "checkable" If it's not checked at start it will not be created as "checkable" it will be normal menu item. I think it's because there is no "checkable" property in TrayCreateItem() as i t is for radio menu items for example. But mayb this is bug a should be changed ... I'm not sure. Edited December 3, 2008 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
ProgAndy Posted December 3, 2008 Share Posted December 3, 2008 You should disable auto-uncheck and do all on your won in OnEvent-Function (Opt traymenumode) *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
rasim Posted December 4, 2008 Share Posted December 4, 2008 Yes, as has said ProgAndy use the Opt("TrayMenuMode", 2) 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