Rhumba Posted August 3, 2006 Share Posted August 3, 2006 I'm having issues with the ControlSend function. I'm trying to start up the Cisco VPN client automatically. I can pass it through just keystrokes with the Send() function just fine. But I'd like to use ControlSend because occasionally it borks out on me using just Send(). From the AutoIt v3 Active Window info window. I see when on the control edit box I want. >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: VPN Client | User Authentication for <xxxxxxxx(took this out)> Class: QWidget Size: X: 582 Y: 479 W: 481 H: 243 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 979 Y: 614 Cursor ID: 5 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0x000072 Dec: 114 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 372 Y: 99 W: 91 H: 20 Control ID: ClassNameNN: QWidget8 Text: username My ControlSend looks like: ControlSend($connWin,"","QWidget8",$vpnUserId) $connWin is equal to the window title, which I know works because I've used it with a WinActive already. It also works when I use a WinActivate() $vpnUserId is equal to the user id I want to use. It works when just using a Send() However when I use the above, it just inserts the value in $vpnUserId into the edit box with focus instead of finding the correct control item. I've also tried passing in "username" instead of QWidget8. But that has the same issues. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 4, 2006 Share Posted August 4, 2006 Hi, doesn't work for me, too. But it isn't that bad. I use something like,... ;Opt("WinTextMatchMode", 4) ; too shorten the title Dim $code[2] = ['', "8a2510"] Run("C:\Programme\Cisco Systems\VPN Client\vpngui.exe -sc", "", @SW_HIDE) If WinActivate('VPN Client | User Authentication for "GAD via Router-Manuell"',"") Then Send($code[1]&"{Tab}{Enter}") EndIf So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Rhumba Posted August 4, 2006 Author Share Posted August 4, 2006 I'd gotten it working with SEND also. Was just hoping that I could get something more elegant up and running. Either way, if someone else had issues with ControlSend on that app, it must not work. Would be curious if anyone knows why it does not work still through. Thanks for the confirmation, Link to comment Share on other sites More sharing options...
herewasplato Posted August 4, 2006 Share Posted August 4, 2006 (edited) ...Any help would be greatly appreciated.Try a ControlFocus right before your ControlSend line.I've used ControlFocus/ControlSend with that app for quite some time now.Edit: now that I've had a chance to look at my code for this app, I don't send to the Username...ControlFocus and ControlSend both report success (or failure if the control is not present)... they just do not work (as you found and JS explained). Edited August 5, 2006 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
JSThePatriot Posted August 4, 2006 Share Posted August 4, 2006 I'd gotten it working with SEND also. Was just hoping that I could get something more elegant up and running.Either way, if someone else had issues with ControlSend on that app, it must not work.Would be curious if anyone knows why it does not work still through.Thanks for the confirmation,It may be because of the Widgets not being a standard Windows API. That would be my assumption for the troubles. Widgets is another API for creating windows and controls.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) 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