Sign in to follow this  
Followers 0
ThomasH

unchecked TrayItem dont work

4 posts in this topic

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))

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Zedna

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Yes, as has said ProgAndy use the Opt("TrayMenuMode", 2)

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