PerryRaptor Posted January 9, 2007 Posted January 9, 2007 Sometimes I cannot find way way out of a paper bag with a knife in my hand... I can use ControlCommand() to fill in an EditBox, but I cannot figure out how to send the {Enter} key to the Control ID. I've tried ControlFocus() and ControlSend() and Send() but nothing works
PerryRaptor Posted January 9, 2007 Author Posted January 9, 2007 (edited) Is there a better way than this...ControlSetText( "<window title>", "", <control ID>, "put some text in the edit box and send the enter key" & @CRLF)ControlClick( "<window title>", "", <control ID>) Edited January 9, 2007 by PerryRaptor
PerryRaptor Posted January 10, 2007 Author Posted January 10, 2007 Well there seems to be an issue with reliability...A few times the EditBox is filled with text, but the {Enter} is not happening. Any ideas to do this in a more relaible way?
herewasplato Posted January 10, 2007 Posted January 10, 2007 @PerryRaptor, Are you feelin' alright? You seem to be talking to yourself in this thread :-) How about a ControlClick to replace the ENTER? [size="1"][font="Arial"].[u].[/u][/font][/size]
PerryRaptor Posted January 10, 2007 Author Posted January 10, 2007 tried it...doesn't work at allI wish we had command, option ..."enter", string'... for the ControlCommand() function. For exampleControlCommand("window title", "window text", control ID, "enter", 'string')
Outshynd Posted January 10, 2007 Posted January 10, 2007 (edited) $hWnd = ControlGetHandle("Untitled - Notepad", "", "Edit1") $user32 = DllOpen("user32.dll") $ret = DllCall($user32, "int", "MapVirtualKey", "int", 0x0D, "int", 0) $lParam = BitOR($ret[0] * 0x10000, BitAND(1, 0xFFFF)) If IsArray($ret) Then DllCall($user32, "int", "PostMessage", "hwnd", $hWnd, "int", 0x100, "int", 0x0D, "long", $lParam) Sleep(1) DllCall($user32, "int", "PostMessage", "hwnd", $hWnd, "int", 0x101, "int", 0x0D, "long", BitOR($lParam, 0xC0000000)) EndIf DllClose($user32) Is that what you're looking for? Edited January 10, 2007 by Outshynd
PerryRaptor Posted January 10, 2007 Author Posted January 10, 2007 Yeah, but I discovered ..."EditPaste", 'string'... works ...Like I said, holding a knife doesn'r mean I can get out of a paper bag
herewasplato Posted January 10, 2007 Posted January 10, 2007 ..."EditPaste", 'string'...I've not had a opportunity to use that one yet. Glad you got it working. [size="1"][font="Arial"].[u].[/u][/font][/size]
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