t123456 Posted January 22, 2013 Share Posted January 22, 2013 (edited) Tried using ControlSend and it doesn't work, it acts like Send, eg, ignoring the handle.I have a MDI form with a simple login. ControlSetText is putting the text in the right textboxes, but the application is not recognizing the text, "password" sould look like "*******" etc. And the okay button now says {space}Here is a picture of what it looks like after I run the script.Any way I can get this ap to recognize the keystrokes? Far as the program realizes, no text has been entered even though it appears. For example when I click the Okay button, it says, "You must enter in a user ID." even though it has "user" in the text box.Here is my code:expandcollapse popup#include <_EnumChildWindows.au3> Local $sMessage = "OKAY" Local $w, $sContent, $counter, $result Local $hWnd="",$hControl=0,$sTitle=0,$sClass=0,$aEnumList $w = Run("S:\PROG\util\proj.exe") $hWnd = WinWait("PROG", "", 5) Sleep(5000) $aEnumList=_EnumChildWindows($hWnd,$hControl,$sTitle,$sClass) $w = WinWait(get_handle($aEnumList, "proform", 1), "", 5) Sleep(1000) $hWin = get_handle($aEnumList, "JYACCmultitext", 1) ControlFocus($hWin,"","") Sleep(1000) ControlSetText($hWin,"","","user") Sleep(1000) $hWin = get_handle($aEnumList, "JYACCmultitext", 2) Sleep(1000) ControlFocus($hWin,"","") Sleep(1000) ControlSetText($hWin, "", "", "password") Sleep(1000) $hWin = get_handle($aEnumList, "Button", 1) Sleep(1000) ControlFocus($hWin,"","") Sleep(1000) ControlSetText($hWin, "", "", "{Space}") Exit 0 Func get_handle($aList, $sClass, $iIteration) Local $h For $i=1 to $aList[0][0] if $aList[$i][1] = $sClass And $aList[$i][3] = $iIteration Then $h = $aList[$i][0] EndIf Next Return $h EndFunc ; from _EnumChildWindows.au3 ;[0]|Handle|Classname|Control ID|Iteration|Title/Text ;[1]|0x001305F2|MDIClient|1|1| ;[2]|0x001D058A|proform|5000|1|USER LOGON ;[3]|0x0011056A|Static|0|1|AZTEC ;[4]|0x00100614|Static|0|2|COURT MANAGEMENT SYSTEM ;[5]|0x00170628|Static|6|3|User ID: ;[6]|0x000B0654|JYACCmultitext|7|1| ;[7]|0x001505A4|Static|8|4|Password: ;[8]|0x002205C2|JYACCmultitext|9|2| ;[9]|0x00130686|Button|10|1| &OK ;[10]|0x002F0604|Button|11|2| &Cancel ;[16]|0x002105B4|msctls_statusbar32|59646|1| ;[17]|0x002B05B8|AfxControlBar42s|59419|1| ;[18]|0x000A0682|AfxControlBar42s|59422|2| ;[19]|0x00210606|AfxControlBar42s|59420|3| ;[20]|0x0016062A|AfxControlBar42s|59421|4| Edited January 22, 2013 by t123456 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 22, 2013 Moderators Share Posted January 22, 2013 t123456,It sounds like there is some form of protection on that dialog - which is hardly surprising. Anyway, please read the Forum Rules - particularly the bit about not discussing login and security dialogs - before you post again. Thread locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts