Jump to content
Sign in to follow this  
jerryHu

GUI window can not afford to call off IE

Recommended Posts

jerryHu

I create a GUI in IE, but when he had the window pop up,

you can not use winclose related instructions to turn off,

this problem has troubled me for days, please help me

#AutoIt3Wrapper_Run_Debug_Mode=Y
#include <IE.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <Debug.au3>


;快速鍵

Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{f8}", "Terminate")
Func TogglePause()
    $Paused = Not $Paused
    While $Paused
        Sleep(100)
        ToolTip('腳本"暫停"', 0, 0)
    WEnd
    ToolTip("")
EndFunc   ;==>TogglePause

Func Terminate()
    Exit 0
EndFunc   ;==>Terminate
$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate("IE", 1024, 715, -1, -1)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 10, 1000, 600)
$oIE.navigate(" https://login.i-part.com.tw/signup.php")

GUISetState(@SW_SHOW)
AutoItSetOption("TrayIconHide", 0)
_IELoadWait($oIE)
$oform = _IEFormGetObjByName($oIE, "frmLogin")
$oformele = _IEFormElementGetObjByName($oform, "username")
$ouser = _IEFormElementSetValue($oformele, "kkk0933")
Sleep(500)
$oformele2 = _IEFormElementGetObjByName($oform, "password")
$ops = _IEFormElementSetValue($oformele2, "0933kkk")
Sleep(500)
_IENavigate($oIE, "javascript:fnChkLogin(0)")
Sleep(1000)
For $i = 5 To 30

    _IENavigate($oIE, " http://www.i-part.com.tw/file/file_guestbook.php?u=" & $i, 0)

    Sleep(1000)
    $ckAD = 0

    If WinExists("", "") Then

        WinClose("網頁訊息", "")
        $ckAD = $ckAD + 1
    EndIf

    If WinExists("", "") Then

        WinClose("網頁訊息", "")
        $ckAD = $ckAD + 1
    EndIf

    If $ckAD > 1 Then
        $i = $i - 2
        ContinueLoop
        $ckAD = 0
    EndIf
Next
Edited by jerryHu

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.