Jump to content

Recommended Posts

Posted

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

Posted (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 by PerryRaptor
Posted

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?

Posted

@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]

Posted

tried it...doesn't work at all

I wish we had command, option ..."enter", string'... for the ControlCommand() function. For example

ControlCommand("window title", "window text", control ID, "enter", 'string')

Posted (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 by Outshynd

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...