Sign in to follow this  
Followers 0
geww

ControlSend BUG

7 posts in this topic

#1 ·  Posted (edited)

Hello everyone,

I am in touch with Autoit over 2 years and I like simplicity and our lovely forum. However today I am fighting with AutoIt BUG. About 4-5 weeks ago I decided to make small tool for my server, unlucky is necessary to use ControlSend or any kind of function which can send data(text) to inactive window and can handle special characters like ( and & . My tool is nearly finished, but I can't make it work with ControlSend. If I am using Send everything working very well. If I use ControlSend instead of ( and & I get 9 and 7. It look like ControlSend fail at sending SHIFT + key. I tried many things what I found on the forum. but it's working bad or it don't work at all.

Example

= What I get

Send("( &")
= ( &   *This is working
-
ControlSend ( "", "", $GwinWnd, "( &", 1)
=  9 7   *This is not working
-
ControlSend ( "", "", $GwinWnd, "( &")
=  9 7  *This is not working
-
ClipPut("( &")
ControlSend ( "", "", $GwinWnd, "{CTRLDOWN}")
ControlSend ( "", "", $GwinWnd, "^{v}")
ControlSend ( "", "", $GwinWnd, "{SHIFTUP}")
= ( &v  *This is working, but I get v at the end of string
-
ClipPut("( &")
ControlSend ( "", "", $GwinWnd, "{CTRLDOWN}")
ControlSend ( "", "", $GwinWnd, "^{v}", 1)
ControlSend ( "", "", $GwinWnd, "{SHIFTUP}")
=[ 9 7]v    *This is not working
-
ControlSetText isn't usable in my case
{ASC xxxx} don't work too

I spent over 50 hours to get it where is it now. So I am too far to abandon it now and also my skill in the others programming languages are too low. :)

However I think I may solve my problem via some WinApi function via ClibBoard paste. But I am completely out of clue how to make it.

Exactly same problem as here:

If anyone have clue how to make WinApi or how to fix that frikinn bug, please don't hesitate post a comment.

Thanks :]

Edited by geww

Share this post


Link to post
Share on other sites



Several things about your code:

- ControlSend should be used with a window title at least in oder for it to work with inactive windows (you can use WinTitleMatchMode option to allow partial match)

- When you try to paste the clipboard content, you are sending CTRLDOWN, then Ctrl+v then SHIFTUP - nothing odd here??? (try sending only "^v" and nothing else.

But I think, if you get the correct title in the controlSend, you won't need any copy/paste.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

Several things about your code:

- ControlSend should be used with a window title at least in oder for it to work with inactive windows (you can use WinTitleMatchMode option to allow partial match)

- When you try to paste the clipboard content, you are sending CTRLDOWN, then Ctrl+v then SHIFTUP - nothing odd here??? (try sending only "^v" and nothing else.

But I think, if you get the correct title in the controlSend, you won't need any copy/paste.

At first I would make it clear. Code What I posted is little messed up, because I made this post when I was sleepy :)

Here is correct version:

Send("( &")
= ( &   *This is working
-
ControlSend ( $GwinWnd, "", "", "( &", 1)
=  9 7   *This is not working
-
ControlSend ( $GwinWnd, "", "", "( &")
=  9 7  *This is not working
-
ClipPut("( &")
ControlSend ($GwinWnd, "", "", "{CTRLDOWN}")
ControlSend ($GwinWnd, "","", "{v}")
ControlSend ( $GwinWnd, "","", "{CTRLTUP}")
= ( &v  *This is working, but I get v at the end of string
-
ClipPut("( &")
ControlSend ($GwinWnd, "", "", "{CTRLDOWN}")
ControlSend ($GwinWnd, "", "", "{v}", 1)
ControlSend ( $GwinWnd, "", ""d, "{CTRLUP}")
=[ 9 7]v    *This is not working
-
ControlSetText isn't usable in my case
{ASC xxxx} don't work too

Anyway I didn't figured how fix this friking bug, so I leaving autoit forever :/ C++ rulz

Share this post


Link to post
Share on other sites

Cya :)

hehe AutoIt isn't bad, but there are few bug which make it unusable :/ btw newest version is also bugged + I probably discover new ddlcall bug

Share this post


Link to post
Share on other sites

geww,

newest version is also bugged + I probably discover new ddlcall bug

Have you opened a Trac ticket for these bugs? If not, then you can hardly complain. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

No better way to ensure you won't receive any help than to complain about the language in your first post :)


√-1 2^3 ∑ π, and it was delicious!

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