RDSchaefer Posted April 18, 2009 Share Posted April 18, 2009 (edited) I have a great idea for a Firefox addon but I'd rather write it in AutoIt if possible. Is there a way to add a button to the Firefox toolbar that would be controlled by my program? Edited April 29, 2009 by RDSchaefer Link to comment Share on other sites More sharing options...
RobertKipling Posted April 22, 2009 Share Posted April 22, 2009 If you're looking for a quick fix, create a tiny window that's topmost with a "toolbar button" on it that follows the closest Firefox around and positions itself over top. Otherwise, sorry to say I've never written a plugin for Firefox in my life. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 22, 2009 Moderators Share Posted April 22, 2009 RDSchaefer,The following is the code I used to create a small toobar on another application. I could not find any way of getting it to act as a proper child in Vista - so I went the overlay route as suggested by RobertKipling.The toobar is created as a small pop-up with the TOPMOST style. Within the While...WEnd loop, it first checks if the app window has moved and if so, repositions itself. It then reactivates the app window when the toolbar is activated by being clicked on so that any subsequent actions take place on the app and not the toolbar! Finally, the toolbar hides when the app is not the active window - otherwise it would stay TOPMOST over something else! It means that the toolbar vanishes if the app is visible and not active - but I could not think of any other way to do it. ;-)Anyway, feel free to plunder this as much as you want:expandcollapse popupGlobal $fToolBar_Vis = True, $iLast_X = -99999, $iLast_Y = -99999 ; ------- ; Create ToolBar GUI Global $hToolBar = GUICreate("ToolBar", 300, 18, Default, Default, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) ; ------- While 1 ; Check App still running If Not WinExists($hApp_Wnd) Then Exit $iMsg = GUIGetMsg() If $iMsg = $GUI_EVENT_CLOSE Or $iMsg = $hExit_Icon Then Exit ; Correct position of window if required If WinActive($hApp_Wnd) Or WinActive($hToolBar) Then $aApp_Pos = WinGetPos($hApp_Wnd) If $aApp_Pos[0] <> $iLast_X Or $aApp_Pos[1] <> $iLast_Y Then $iLast_X = $aApp_Pos[0] $iLast_Y = $aApp_Pos[1] $aApp_Client_Size = WinGetClientSize($hApp_Wnd) ; You will need to adjust the position to fit your app, of course WinMove($hToolBar, '', $aApp_Pos[0] + 360, $aApp_Pos[1] + ($aApp_Pos[3] - $aApp_Client_Size[1]) - 5, $iToolBar_Width, 18) GUISetState(@SW_SHOW) EndIf EndIf ; Reactivate App when Button window is activated If WinActive($hToolBar) Then WinActivate($hApp_Wnd) EndIf ; Hide ToolBar when App not active If BitAND(WinGetState($hApp_Wnd), 8) <> 8 And $fToolBar_Vis = True Then GUISetState(@SW_HIDE, $hToolBar) $fToolBar_Vis = False ElseIf BitAND(WinGetState($hApp_Wnd), 8) = 8 And $fToolBar_Vis = False Then GUISetState(@SW_SHOW, $hToolBar) $fToolBar_Vis = True EndIf ; ------- WEnd ExitAnd if you ever find out how to get the toolbar to act as a real child in Vista - please let me know!M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
RDSchaefer Posted April 24, 2009 Author Share Posted April 24, 2009 The following is the code...And if you ever find out how to get the toolbar to act as a real child in Vista - please let me know!M23Wow, thanks a lot. Not exactly what I was looking for but it will sure help. BTW - I neither use nor support Vista so if you have something else for XP I'm all ears (eyes?). Link to comment Share on other sites More sharing options...
Zedna Posted April 24, 2009 Share Posted April 24, 2009 (edited) Look at anyguihttp://www.autoitscript.com/forum/index.ph...7&hl=anyguiMaybe it will help you.But I think the best will be if you create FF plugin for this. Edited April 24, 2009 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 24, 2009 Moderators Share Posted April 24, 2009 Zedna,I hope it helps the OP, but I could not get the anygui UDF to work in Vista. Have you had any luck? I imagine it is Vista doing its "each app in a separate area" security thing, so I am not optimistic. :-(M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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