Jump to content
Sign in to follow this  
potitpanda

Option in trayMenu with checking cursor

Recommended Posts

potitpanda

Hi Everybody

How to add in my tray menu a Check item

How to control the state of this item and do some things (IsChecked)

Share this post


Link to post
Share on other sites
monoceres

Hi! I made a small example for you :)

#Include <Constants.au3>
#NoTrayIcon

Opt("TrayMenuMode",1)
$test   = TrayCreateItem("Test")
$exititem=TrayCreateItem("Exit")

TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg=$test
            If BitAND(TrayItemGetState($test),$TRAY_CHECKED) Then
                TrayItemSetState($test,BitOr($TRAY_UNCHECKED,TrayItemGetState($test)))
            Else
                TrayItemSetState($test,BitOr($TRAY_CHECKED,TrayItemGetState($test)))
            EndIf
        Case $msg = $exititem
            ExitLoop
    EndSelect
WEnd
Edited by monoceres

Broken link? PM me and I'll send you the file!

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  

×