Jump to content

Recommended Posts

Posted

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 :)

#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
Posted

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?

I have no idea what this sentence means.

Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

Posted

I have no idea what this sentence means.

I put the above code, which creates a Gui window named widgetx with embedded ActiveX that is attached to a Internet Explorer instance. The problem is that the Gui window is visible always and I need to be visible just only when certain URLs is put on in Internet Explorer address.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...