claude21 Posted January 13, 2010 Posted January 13, 2010 Hi all, I'm trying to re-enable a disabled (greyed) button on a toolbar from an external app. Autoit info says the class of the toolbar control is "msvb_lib_toolbar" but I can't see any references to the buttons themselves, nor I can't see any CommandID in the toolbar tab. I've not found any information on controlling an external app toolbar buttons here, so if you have any information, I would be very grateful ! Thanks again
claude21 Posted January 13, 2010 Author Posted January 13, 2010 (edited) Without knowing the commandID of the control (which was invisible for me), it's pretty hard to manipulate it. I found it myself this way (empirical way : note : replace [CLASS:ThunderRT6MDIForm] and [CLASS:msvb_lib_toolbar] with your own #Include <GuiToolBar.au3> $title = WinGetTitle("[CLASS:ThunderRT6MDIForm]", "") $hWnd = ControlGetHandle($title, "", "[CLASS:msvb_lib_toolbar]") $result = '' If isPtr($hWnd) then msgbox(0, '', "The handle is : " & $hWnd) For $i = 0 to 65536 if _GUICtrlToolbar_EnableButton($hWnd, $i) then $result &= $i & ',' next Else msgbox(0, '', "This is not a valid pointer") Endif MsgBox(0, $title, "The following commandID are found to be valid for the control : " & $result ) then you can try to hide or disable each control to see which one is affected Edited January 25, 2010 by claude21
Akshay07 Posted February 12, 2010 Posted February 12, 2010 (edited) I am trying to adapt your script but it fails. $title = WinGetTitle("[CLASS:1234]", "") ; 1234 is the window class name $hWnd = ControlGetHandle($title, "", "[CLASS:xxxx; INSTANCE:4]") ; CLASS:xxxx; INSTANCE:4 is the advanced class for this button If $hWnd = "" Then MsgBox(0,"","error") ; for debug purpose _GUICtrlButton_Enable($hWnd, False) Sleep(10000) ; to give time to check if the button is really disabled Exit The script itself doesn't fail but the button doesn't get disabled. What am I doing wrong? Edited February 12, 2010 by Akshay07
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now