Monooboe Posted April 15, 2018 Share Posted April 15, 2018 (edited) 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. 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. here is my current code. thanks Monooboe expandcollapse popup#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 April 15, 2018 by Monooboe Link to comment Share on other sites More sharing options...
Developers Jos Posted April 15, 2018 Developers Share Posted April 15, 2018 Is there a question ? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Monooboe Posted April 15, 2018 Author Share Posted April 15, 2018 need help for attach pop-out window ( sliding window) from 'Button2'. Stuck with creating sliding child window. Any help? Monooboe, 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