Jump to content

ie and gui


grzesiek
 Share

Recommended Posts

Hello.

I noticed some problem. I think the problem is related with using IE to automate some things because I have some other application which does some tasks but doesn't use IE and I don't have this problem. So I have application which creates IE object, does some things and GUI which displays progress, but there is a problem with the GUI. The GUI is less responsive and I have problem restoring the minimized GUI, it often doesn't restore and I hear the sound like when the GUI is disabled, but when the script finish the work I can restore GUI without problem. I checked this on another computer with Windows 7 and there is the same problem, and on older computer with Windows XP there is also a problem with restoring the GUI and the GUI is lagging a lot, a lot of problem with dragging the GUI. So it looks like somehow using IE causes problem with the GUI. The script just does some tasks in Internet Explorer and updates the GUI every few seconds.

I wrote this test script where I also have this problem. Can you run this code and check if you doesn't have any problem restoring the GUI?

Opt("GUIOnEventMode", 1)

GUICreate("test", 200, 100)
GUISetOnEvent(-3, "CloseEvent")
$cLabel = GUICtrlCreateLabel("0", 9, 10)
GUICtrlCreateButton("  Stop  ", 9, 50)
GUICtrlSetOnEvent(-1, "CloseEvent")
GUISetState()

$oIE = ObjCreate("InternetExplorer.Application")
;$oIE.Visible = 1

$i = 0
Do
   $oIE.Navigate("https://www.autoitscript.com/site/")
   Do
   Until Sleep(200) And $oIE.ReadyState > 2
   $oDocument = $oIE.Document
   Do
   Until Sleep(200) And String($oDocument.ReadyState) = "complete"
   $oLinks = $oDocument.GetElementsByTagName("a")
   For $oLink In $oLinks
   Next
   ;Sleep(5000)
   $i += 1
   GUICtrlSetData($cLabel, $i)
Until 0

Func CloseEvent()
   If IsObj($oIE) Then $oIE.Quit()
   Exit
EndFunc

When I uncomment Sleep(5000) it nearly eliminates the problem.

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