Atm I do:
Code: Select all
TrayFunc(ItemName, ItemPos, *)
{
TrayMain.ToggleCheck(ItemName)
CheckState := MenuCheckState(TrayMain.Handle, ItemPos))
}
MenuCheckState(Handle, Item)
{
static MF_BYPOSITION := 0x00000400
static MF_CHECKED := 0x00000008
MenuState := DllCall("user32\GetMenuState", "Ptr", Handle, "UInt", Item - 1, "UInt", MF_BYPOSITION, "UInt")
if (MenuState = -1)
return -1
return !!(MenuState & MF_CHECKED)
}
ref:
https://lexikos.github.io/v2/docs/objects/Menu.htm#ToggleCheck
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getmenustate