shaktiku1 Posted May 8, 2014 Share Posted May 8, 2014 Hi, I am working on to send Keyboard keys to notepad opened in Win7 m/c(which i am accessing using webBrowser{called as console view} just like client-server) which is in maximized mode and focus is set to notepad. I have created AutoIT script to get the handle of the browser's window but when i triggers AutoIT script through batch script it is not recognizing properly ,though its find the browser window properly but not sending the keys to notepad I am attaching the screenshot of the opened Win7 m/c for reference(https://dl.dropboxusercontent.com/u/91420517/Insession.JPG) **If i run the AutoIT script and click inside the opened notepad,then sendkeys sends all the key properly. $hFirefox = WinGetHandle("[CLASS:MozillaWindowClass; TITLE:FRwin7x64 - Mozilla Firefox]", "") WinActivate($hFirefox,"") ; Character in Small letters ;-------------------------- Sleep(1000) Send("a") send("{ENTER}") Send("b") send("{ENTER}") Send("c") send("{ENTER}") Send("d") send("{ENTER}") Send("e") send("{ENTER}") AutoIT Window Info expandcollapse popup>>>> Window <<<< Title: FRwin7x64 - Mozilla Firefox Class: MozillaWindowClass Position: 594, 46 Size: 836, 718 Style: 0x16CF0000 ExStyle: 0x00000100 Handle: 0x00040018 >>>> Control <<<< Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<< Position: 953, 174 Cursor ID: 0 Color: 0x0959AE >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< >>>> Hidden Text <<<< Please help in resolving this way or let me know the better way of finding the windows control. *Sorry if i not very clear is describing my issue.. Many Thanks in advance!! Link to comment Share on other sites More sharing options...
orbs Posted May 8, 2014 Share Posted May 8, 2014 if this is remote control of some sort, then you issue is similar to running AutoIt over RDP/VNC/Citrix/etc. search the forum, there are few solutions: 1) run the AutoIt script from the host itself, not from the terminal client. 2) use blind click based on coordinates and blind send() instead of ControlSend(). for these, the following conditions are required, depending on the method you choose: method 1 - open-loop-control: make sure the remote app is located exactly in a specific coordinates, so Click based on coordinates will work; and use blind send() instead of ControlSend(). method 2 - closed-loop-control: use image recognition to detect the controls you wish to operate on. in short: go for option (1) and run the AutoIt script from the host itself. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Alexxander Posted May 8, 2014 Share Posted May 8, 2014 you can use the title instead of the win handle try these: WinActivate("firefox","") WinActivate("mozilla","") or what ever your browser name appears in the tool bar thingy 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