Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Problem with window over another window

$
0
0
Hi,

I have this code below:
How to change for this widgetx to be in front  (over) of IE only when I have open and it's  active an IE Tab address like google.com or yahoo.com and not other URLs when opened in same or another IE tabs?

May thanks  :)


[ autoit ]         
#include #include Opt("WinTitleMatchMode", 2) HotKeySet("{ESC}", "On_Exit") Func On_Exit() Exit EndFunc Local $gui = WinGetHandle("[CLASS:IEFrame]", "Google") $Gui = GUICreate("widgetx", 300, 250, 122, 111, -1, ($WS_EX_TOOLWINDOW), $gui ) GUISetState(@SW_SHOW) $IE = ObjCreate("Shell.Explorer.2") $iActiveX = GUICtrlCreateObj($IE,0,0,300,250) $IE.navigate("http://www.autoitscript.com/") Global $iLast_X, $iLast_Y, $fToolBar_Vis = True Global $sMain_Title = "[CLASS:IEFrame]" Global $hApplication_Wnd = WinGetHandle($sMain_Title) Global $iApplication_PID = WinGetProcess($sMain_Title) Global $hToolBar = WinGetHandle ("[CLASS:AutoIt v3 GUI]","") GUISetState() _Toolbar_Follow() While 1 sleep(50) ; Check Application is running If Not ProcessExists($iApplication_PID) Then Exit If Not WinExists($sMain_Title) Then Exit ; Hide/show toolbar as required _Toolbar_State() WEnd Func _Toolbar_Follow() Local $aApplication_Pos = WinGetPos($hApplication_Wnd) If $aApplication_Pos[0] <> $iLast_X Or $aApplication_Pos[1] <> $iLast_Y Then $iLast_X = $aApplication_Pos[0] $iLast_Y = $aApplication_Pos[1] WinMove($hToolBar, '', $aApplication_Pos[0] + 360, $aApplication_Pos[1] - 25) EndIf EndFunc ;==>_Toolbar_Follow Func _Toolbar_State() ; If Application minimised, then hide toolbar and do nothing If BitAND(WinGetState($hApplication_Wnd), 16) = 16 Then ;GUISetState(@SW_HIDE, $hToolBar) ;$fToolBar_Vis = False ;If Application not minimised Else ; Hide ToolBar when Application not active If BitAND(WinGetState($hApplication_Wnd), 8) <> 8 And $fToolBar_Vis = True Then ; GUISetState(@SW_HIDE, $hToolBar) ; $fToolBar_Vis = False ElseIf BitAND(WinGetState($hApplication_Wnd), 8) = 8 And $fToolBar_Vis = False Then ; GUISetState(@SW_SHOW, $hToolBar) ; WinActivate($hApplication_Wnd) ; $fToolBar_Vis = True EndIf ; If visible check toolbar position If $fToolBar_Vis = True Then _Toolbar_Follow() EndIf EndFunc ;==>_Toolbar_State

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>