Jump to content

_GUICtrlMenu_GetItemEnabled inconsistent results


Recommended Posts

Hey, 

I'm trying to determine whether a menu item is enabled or not. _GUICtrlMenu_GetItemEnabled is returning inconsistent results. It returns True when a menu item is clearly grayed/disable. Actually, all of the menu functions are inconsistent _GUICtrlMenu_GetItemGrayed, _GUICtrlMenu_GetItemState, _GUICtrlMenu_GetItemDisabled, etc...

My function looks like this, maybe it's me.

Func FileExportMenuState()
    NewModel()
    $sSubMenu = _GUICtrlMenu_GetItemSubMenu($hMenu, 0)
    $sSubSubMenu = _GUICtrlMenu_GetItemSubMenu($sSubMenu, 15)
    $iCount = _GUICtrlMenu_GetItemCount($sSubSubMenu)
    $sActual = ""
    For $x = 0 To $iCount - 1
        $sType = _GUICtrlMenu_GetItemType($sSubSubMenu, $x)
        If $sType <> 2048 Then
            $sActual = $sActual & _GUICtrlMenu_GetItemEnabled($sSubSubMenu, $x)
            $sText = _GUICtrlMenu_GetItemText($sSubSubMenu, $x)
;~          ConsoleWrite($sText & @CRLF)
        EndIf
    Next
    Sleep(1000)
;~  ConsoleWrite($sActual & @CRLF)
    Assert("FileExportMenuState() ", $sFileExportMenuStatus, $sActual)
EndFunc   ;==>FileExportMenuState

_GUICtrlMenu_GetItemEnabled is returning True for all 4 of the menu items in the Export flyout in the attached image.

Any help would be appreciated. 

Brad

menu.jpg

Edited by CygnusX1
Added image and more text

Cygnus

Link to comment
Share on other sites

Ok, I thought it was solved but it isn't. I adjusted the script to open the menu while I'm getting the menu state. 

The video clearly shows a menu is grayed and the state of the menu is being returned as enabled. The opposite is also true, some active menus are being returned as not enabled. 

Any thoughts as to what is going on?

Thank you,

Brad

menus.mp4

Cygnus

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...