Jump to content

Problems with ControlSend


mozart90
 Share

Recommended Posts

Hi

I' ve got a Problem with the ControlSend Command.

I am sending a String Variable to an Edit Control (Actually it s the Path and the Filename for Saving)

It works fine but sometimes the '\' (Backslash) and then ':' are inserted incorrectly as 'ß' and '.' (dot)

which meens my path string looks like this:

c.ßtestdir\anotherdir\thefile.bmp

It is very strange because it is mostly the first part that is returnd in a wrong way.

It seems to me it s a shift/alt key problem. Is there a possibility to avoid the problem?

By the way I use already the flag option 1 ...

Or do you habe another Idea how can I get this working ???

(I'm using a german keyboard layout under XP SP2)

mozart90

Edited by mozart90
Link to comment
Share on other sites

I just noticed this problem myself, I think it may be a bug.

In my case, this:

$InstDir = "C:\MicroProse"
ControlFocus ("Choose Folder", "Please choose the installation folder", 1161)
ControlSend ("Choose Folder", "Please choose the installation folder", 1161, $InstDir & "\Falcon4", 1)

Should be sending "C:\MicroProse\Falcon4", which it usualy does.

Occasionaly, however, it will instead send "c;\microprose\falcon4" (All caps changed to lowercase and ":" changed to ";" )

The weird part is that it does it intermittently, usually rebooting solves the problem.

I am using AutoIT3 Beta with English (USA) keyboard.

-DRX
Link to comment
Share on other sites

Haven't tried it, but it's a good idea.

I've gotten around it already by just using Send() in conjunction with ControlFocus() instead of using ControlSend(). That worked for me because my script lent itself to that well, but would be a cumbersome workaround for most scripts.

The problem seems to be that ControlSend() occasionally does not send shift or alt keys that are implied in the string, but not explicitly included in the string. ("Hello" rather than "+hello") It's an intermittent problem, which makes it all that more frustrating.

Edited by DoctorX
-DRX
Link to comment
Share on other sites

The problem seems to be that ControlSend() occasionally does not send shift or alt keys that are implied in the string, but not explicitly included in the string. ("Hello" rather than "+hello") It's an intermittent problem, which makes it all that more frustrating.

That can be catered for through the use of the optional Flag parameter. In any case, I would recommend ControlSetText() over ControlSend() if the situation allows for it.
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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