Sign in to follow this  
Followers 0
mozart90

Problems with ControlSend

7 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



It does not seem that anyone knows.

Perhaps this bump will help or you might want to post the the AutoIt forum here:

www.AutoIt.de.vu


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Have you tried ControlSetText() instead? It's a better approach if it works.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

...

I already tried the flag parameter (control send), but whithout success. So I 'll try the

controlsettext in my skript.

A the moment I let pop up a msgbox (1Sec) with the string that should be inserted in the control - it seems to work.

mozart90

Edited by mozart90

Share this post


Link to post
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
Sign in to follow this  
Followers 0