Jump to content

[SOLVED] Three-state (tristate/indeterminate) checkbox in tray menu?

Recommended Posts



Is there a way create a menu item in tray menu that would show as 3 state checkbox (indeterminate)?

(I already have the functionality of 3nd state, just can't make it show visually)


Thank you.

Edited by VAN0

Share this post

Link to post
Share on other sites

I found a way by replacing type of menu item to radio for the indeterminate state, and switching back to checkbox for any other states:

$val = 0 ; 0 = unchecked, 1 = checked, 2 = indeterminate
$tMenuItem = TrayCreateItem("Test tray menu item")
$type = 0 ; checkbox
$checked = $TRAY_UNCHECKED
If $val > 0 Then
    $checked = $TRAY_CHECKED
    If $val == 2 Then $type = $MFT_RADIOCHECK ;512 = radio
_GUICtrlMenu_SetItemType(TrayItemGetHandle(0), $tMenuItem, $type, false)
TrayItemSetState($tMenuItem, $checked)


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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.