Jump to content

Recommended Posts

Posted

Opening a a webcam test like this

Local $oIE = _IECreate('http://www.testmycam.net/')
            Sleep(3000)
            $WebCamCheck = MsgBox($MB_YESNO + $MB_ICONWARNING + $MB_DEFBUTTON2, 'Webcam Check', 'Did The Webcam Work')
            _Font()
            If $WebCamCheck = $IDYES Then
                GUICtrlSetImage($WebcamIcon, $tick)
                RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple', 'Webcam', 'REG_SZ', _Date_Time_SystemTimeToDateTimeStr($CuDate))
            ElseIf $WebCamCheck = $IDNO Then
                GUICtrlSetImage($WebcamIcon, $cross)
                RegWrite('HKEY_LOCAL_MACHINE\SYSTEM\Setup\Simple', 'Webcam', 'REG_SZ', 'NotCompleted')
            EndIf

Im trying to find a way to make the $WebCamCheck wait until the browser window is closed as the MsgBox appears before the test is barely started

I tried adding this after the sleep

Local $oIE = _IECreate('http://www.testmycam.net/')
            Sleep(3000)
            Local $ProcessCheck = ProcessExists($oIE) ; <<<<<<<<<< this
            ProcessWaitClose($ProcessCheck) ; <<<<<<<<<<<< this
            $WebCamCheck = MsgBox($MB_YESNO + $MB_ICONWARNING + $MB_DEFBUTTON2, 'Webcam Check', 'Did The Webcam Work')

but it just carry s on and ignores it :(

Any suggestions plz

Posted

Im at this point but i cant get it to display the consolewrites?

Local $oIE = _IECreate('http://www.testmycam.net/')
;~          Sleep(3000)
            Local $ProcessCheck = _IEPropertyGet( $oIE ,"hwnd")
            ConsoleWrite($ProcessCheck & @CRLF)
            Local $IETest = WinExists($ProcessCheck)
            ConsoleWrite($IETest & @CRLF)
            If $IETest = 1 Then ProcessWaitClose($ProcessCheck)

            $WebCamCheck = MsgBox($MB_YESNO + $MB_ICONWARNING + $MB_DEFBUTTON2, 'Webcam Check', 'Did The Webcam Work')

am i reading it wrong?

Posted

Managed to solve this like this in the end

Local $oIE = _IECreate('http://www.testmycam.net/')
            Sleep(300)
            Local $ProcessCheck = _IEPropertyGet($oIE, "hwnd")
            WinWaitClose($ProcessCheck)

It doesnt allow for errors but thats not critical for this script for me

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
×
×
  • Create New...