wccppp Posted December 12, 2007 Share Posted December 12, 2007 Hello, I tried to use ANYGUI to add a button to Adobe Acrobat Professional's toolbar, but could not get it to work. The trouble I'm having is to get the target window/control (the toolbar). $Targetwindow = _GuiTarget($winhandle,"","AVToolBarView", $ControlID) But the Adobe toolbar control does not have ID, based on AutoIt Window Info. Anyone has a suggestion? Thank you! Link to comment Share on other sites More sharing options...
Skruge Posted December 12, 2007 Share Posted December 12, 2007 Are there overlapping controls? What is the output of WinGetClassList? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
wccppp Posted December 12, 2007 Author Share Posted December 12, 2007 Are there overlapping controls?What is the output of WinGetClassList?Thanks Skruge. There are no overlapping controls and this is the output of WinGetClassList:AVEaselBarWindowAVEaselBarWindowAVEaselBarWindowAVEaselBarWindowAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewStaticAVL_AVViewEditStaticAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewEditAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewMDIClientAcrobatMDIChildWndAVL_AVViewAVL_AVViewAVL_AVViewStaticAVL_AVViewStaticmsctls_progress32AVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewEditAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewEditAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewStaticAVL_AVViewAVL_AVViewAVL_AVViewScrollBarScrollBarAVEaselBarWindowAVEaselBarWindowAVEaselBarWindowAVEaselBarWindowAVEaselBarWindowAVEaselBarWindowAVEaselBarWindowAVEaselBarWindowAVL_AVViewAVL_AVViewAVL_AVViewATL:038BCD50AtlAxWin71Shell EmbeddingAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewAVL_AVViewScrollBarScrollBarAVL_AVViewButton Link to comment Share on other sites More sharing options...
Skruge Posted December 13, 2007 Share Posted December 13, 2007 Hmm... The closest match to a "toolbar" on that list sounds like "AVEaselBarWindow" and you have 12 of them. ANYGUI expects either control ID's (handles) or coordinates, so you could try coordinates if the toolbar is in a predictable location. Otherwise, test it with ControlGetHandle($winhandle,"", "AVEaselBarWindow1") and work your way to up "AVEaselBarWindow12" to see which control it's actually using. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
wccppp Posted December 13, 2007 Author Share Posted December 13, 2007 Otherwise, test it with ControlGetHandle($winhandle,"", "AVEaselBarWindow1") and work your way to up "AVEaselBarWindow12" to see which control it's actually using. Thanks again Skruge! The ClassnameNN for the toolbar is AVEaselBarWindow4. This is output from AutoIt Window Info: Class: AVEaselBarWindow Instance: 4 ClassnameNN: AVEaselBarWindow4 ID: Text: Position: 0, 1 Size: 1280, 32 ControlClick Coords: 946, 16 Style: 0x52000000 ExStyle: 0x00000000 Handle: 0x00060738 But how do I use above information in the _GuiTarget function? I'm not clear about the last argument: $controlid [optional] - "Targeted" Control in window **OR** array containing x and y coords Link to comment Share on other sites More sharing options...
Skruge Posted December 14, 2007 Share Posted December 14, 2007 But how do I use above information in the _GuiTarget function? I'm not clear about the last argument: $controlid [optional] - "Targeted" Control in window **OR** array containing x and y coordsIt needs the handle of the toolbar control. I'm using $hToolbar in this example:Opt("GUIOnEventMode", 1) ; Your existing code goes here... where you get $winhandle $hToolbar = ControlGetHandle($winhandle, "", "AVEaselBarWindow4") $hTarget = _GuiTarget($winhandle, 0, "", $hToolbar) $hButton = _TargetaddButton("Your Button", 0, 0, 50, 25,"","",$hTarget) ; Change button text/coords/size GUICtrlSetOnEvent($hButton[0], "_YourFunction") ; Assign a function GUISetState(@SW_SHOW) While WinExists($winhandle) ; Keep script alive as long as the app is open Sleep(100) WEnd Func _YourFunction() ; Execute this when button is pressed EndFunc [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
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