Jump to content

Toolbar for Browser


Monooboe
 Share

Recommended Posts

Hello,

I'm trying to create toolbar on IE and Chrome that  appears for those browser window only. It moves with active browser window and hides for other windows. 

image.png.fcf2e1b027f1e51996fb6a8fb32f085e.png

I also wants to attach  pop-out  window ( sliding window) from the Parent GUI by using a child gui. It will show when mouse over respected button for extended function. 

image.png.4a8caa734aff70f5e794744c07417c8f.png

here is my current code.

thanks

Monooboe

#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <GuiButton.au3>
#include <EditConstants.au3>
#include <Misc.au3>
#Include <WinAPI.au3>


Global $LastPosX=-9999, $LastPosY=-9999

$Title='IEBar'
$apos=WinGetPos('[CLASS:Chrome_WidgetWin_1]')
$hwnd = WinGetHandle('[CLASS:Chrome_WidgetWin_1]')
$sGUI = GuiCreate($Title, 120, 20, $apos[0]+$apos[2]-300, $apos[1]+10, $WS_POPUP, $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST, $hwnd)
$guicolor=PixelGetColor($apos[0]+$apos[2]-301,$apos[1]+9)
GUISetBkColor ($guicolor)

Local $color =  [0, '0x6AFF6A', '0x00FFFF', '0xFF9900']
$x=0
local $Button[4]

For $i = 1 To 3
$Button[$i] = GUICtrlCreateLabel('Button' & $i, $x, 0, 40, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE))
$x += 40
GUICtrlSetBkColor(-1, $color[$i])
Next

GUISetState(@SW_SHOW, $sGUI)

Local $nMsg

While 1
    tbmove()
    $nMsg = GUIGetMsg()

        Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button[2]
            MsgBox(0,'','Pressed button 2')

    EndSwitch
WEnd

Func tbmove()

    If WinActive('[CLASS:Chrome_WidgetWin_1]') Or WinActive('[CLASS:IEFrame]') Then
    $hwnd = WinGetHandle('[ACTIVE]')
    $apos=WinGetPos($hwnd)
    GUISetState(@SW_SHOW,$sGUI)
    If $apos[0] <> $LastPosX Or $apos[1] <> $LastPosY Then
            $LastPosX = $apos[0]
            $LastPosY = $apos[1]
            WinMove($sGUI, '',  $apos[0]+$apos[2]-300, $apos[1]+10)
    EndIf
    Else
    GUISetState(@SW_HIDE,$sGUI)
    EndIf
    If WinActive($sGUI) Then WinActivate($hwnd)

EndFunc

 

Edited by Monooboe
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...