Jump to content

Embedded IE Camera Interface Problem


Recommended Posts

#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <WindowsConstants.au3>

Opt("MouseCoordMode", 0)

HotKeySet("{ESC}", "ToggleFullScreen")
HotKeySet("f", "ToggleFullScreen")

_IEErrorHandlerRegister ()

$oIE = _IECreateEmbedded ()
GUICreate("ICRealtime FlexView Assistant", 800, 600, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCreateObj($oIE, 0, 0, 800, 550)
$GUI_Button_Login = GUICtrlCreateButton("Login", (@DesktopWidth - 800) / 2, 560, 100, 30)
$GUI_Button_FullScreen = GUICtrlCreateButton("Full Screen", (@DesktopWidth - 500) / 2, 560, 100, 30)

GUISetState()     ;Show GUI

_IENavigate ($oIE, "http://localhost")

; Waiting for user to close the window

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
            
        Case $GUI_Button_Login
            ClickConnect()
            
        Case $GUI_Button_FullScreen
            ToggleFullScreen()
    EndSwitch
WEnd

GUIDelete()

Func ToggleFullScreen()
    MouseClick("left", 400, 300, 2, 1000)
EndFunc

Func ClickConnect()
    MouseClick("left", 214, 97, 1, 1000)
    sleep(2000)
    msgbox(0, "test", "test")
EndFunc

Exit

I'm trying to build a little interface for a tablet PC to help with some of the simple, but tedious tasks when working on a tablet PC with no external keyboard. Right now, it should be the ideal size, 800x600 and the program should load in an embedded IE object, which is working. I have two buttons, one to make the selected camera full screen (done by double clicking the camera window) and one to make a 1 click auto-login that will supply the username and password.

So far, everything is working great except for:

Func ClickConnect()
    MouseClick("left", 214, 97, 1, 1000)
    sleep(2000)
    msgbox(0, "test", "test")
EndFunc

The form invokes the function just fine. It even processes the MouseClick just fine. Problem happens when the little popup box asking for my username and password shows up. Once it appears, sequental code does not execute until I manually close the window. I'm not positive why and I have no idea how to fix this. Control over this popup is ncessary if I ever hope to finish the script.

Any help or advice is greatly appriciated.

Thanks!

Link to comment
Share on other sites

Suggest you try SciTe debug mode (see my sig) to see exactly what is executing or where it is hanging.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Decided to take a slightly different route.

I have a small application that I built to only do the actual login, that is, wait for the "Login" screen, ControlSend the username then the Password, strike {ENTER} then exit.

I designed the main program to either copy this application into the User's Temp directory or leave it alone if the file exists (FileInstall)

Then I have the script calling the sub-application and then clicking the "Connect" button (which has been causing the original problem). Since the sub-application is unaware of the procedures holding up the main program, it will simulate the key strokes, and once the sub-program hits {ENTER} and closes the Login popup, the main program regains control anyway (as demonstrated by some of my sleep() and msgbox() testing I ran.

Don't know if this is the best way, but it's at least functional. :)

Just letting the board know >_<

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...