chriswaldeck Posted July 20, 2018 Share Posted July 20, 2018 (edited) I am capturing data from a web page as soon as it opens. The problem is I am running a dual screen setup and the script don't capture the data when the window is opened up in the non default monitor. On the default monitor it works fine. expandcollapse popupFunc Monitor() Local $hTimer = TimerInit() Do $fDiff = TimerDiff($hTimer) Until WinActive("ActivityDetail - Internet Explorer") Or $fDiff >= 5000 ; Only sees window on default monitor. If WinActive("ActivityDetail - Internet Explorer") Then ; Only sees window on default monitor. Local $hWnd = WinGetHandle("ActivityDetail - Internet Explorer", "") Local $oIE = _IEAttach($hWnd, "hwnd") If @error Then $oIE.Quit() Else Local $oForm = _IEGetObjByName($oIE, "lblHeaderActRefValue") Local $Ref = _IEPropertyGet($oForm, "innertext") Local $oForm = _IEGetObjByName($oIE, "lblCompileDate") Local $Compile = _IEPropertyGet($oForm, "innertext") Local $oForm = _IEGetObjByName($oIE, "Table2") Local $Description = _IEPropertyGet($oForm, "innertext") $Description = StringTrimLeft($Description, 49) Local $iLength = StringLen($Description) Local $iPosition = StringInStr($Description, "Network Tag") Local $sString = StringTrimRight($Description, ($iLength - ($iPosition - 1))) Local $sString1 = StringStripWS($sString, $STR_STRIPLEADING + $STR_STRIPTRAILING + $STR_STRIPSPACES) Local $sString = $sString1 Local $oForm = _IEGetObjByName($oIE, "lblDisruption") Local $Disruption = _IEPropertyGet($oForm, "innertext") If $flag <> $Ref And $Ref <> 0 and $Compile <> 0 Then $ICount = _GUICtrlListView_GetItemCount($ListView1) _GUICtrlListView_AddItem($ListView1, $Compile, $ICount) _GUICtrlListView_AddSubItem($ListView1, $ICount, $Ref, 1) _GUICtrlListView_AddSubItem($ListView1, $ICount, $Disruption, 2) _GUICtrlListView_AddSubItem($ListView1, $ICount, $sString, 3) _FileWriteLog(@ScriptDir & "\" & @YEAR & @MON & ".txt", $Ref & " " & $Disruption & " " & $sString & @CRLF) $flag = $Ref EndIf EndIf EndIf EndFunc ;==>Monitor Edited July 20, 2018 by chriswaldeck Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 20, 2018 Share Posted July 20, 2018 @chriswaldeck Does the script return any error? Best Regards. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
Danp2 Posted July 20, 2018 Share Posted July 20, 2018 Maybe the issue is as simple as the window doesn't have focus when on the 2nd monitor. Have you considered using WinExist instead? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
chriswaldeck Posted July 20, 2018 Author Share Posted July 20, 2018 23 minutes ago, Danp2 said: Maybe the issue is as simple as the window doesn't have focus when on the 2nd monitor. Have you considered using WinExist instead? Thank you buddy it works. It's so simple and I should have know that. What can I say? It was a long Friday. 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