Opened on Aug 22, 2016 at 10:21:35 AM
Closed on Aug 27, 2016 at 8:31:18 AM
Last modified on Sep 2, 2016 at 8:02:19 AM
#3269 closed Bug (No Bug)
ControlSend acts inconsistently
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.14.0 | Severity: | None |
| Keywords: | ControlSend | Cc: |
Description
This problem was already raised in:
https://www.autoitscript.com/trac/autoit/ticket/330
but no solution was given. The problem DEFINITELY exists still. My PC is Windows XP, SciTE-Lite Version 3.5.4.
The part of the responsible code is as follows:
============
Run ( "putty.exe -serial $COM1 -sessionlog log_COM1.txt -sercfg 115200,8,n,1,N", "", @SW_MINIMIZE)
WinWait( "COM1", "", 10)
$Putty_handle=WinGetHandle ( "COM1" )
WinActivate ( $Putty_handle )
WinSetState ( $Putty_handle, "", @SW_MINIMIZE )
Send ("SOURce:CALIbrate:SERIalnumber?", $SEND_RAW) ; just to check Send command
Send ("{ENTER}", $SEND_DEFAULT)
Sleep ( 1500 )
ControlSend ($Putty_handle, "", "", "SOURce:FILE:RESUlts:DEBUg:ENTEr", $SEND_RAW) ; just to use ControlSend
Send ("{ENTER}", $SEND_DEFAULT)
I have run the same code again and again (Go by F5 in SciTE). What I get is that when it works (as it should) the Putty window shows:
SOURce:CALIbrate:SERIalnumber? SOURce:FILE:RESUlts:DEBUg:ENTEr
But when it doesn't work it comes as:
SOURce:CALIbrate:SERIalnumber? source;file;results;debug;enter
Please note how the capital letters are changed to lower case, and all the colons to semicolons. This indicates that a "shift" was "pressed" somewhere, somehow?
I run this code repeatedly 32 times. On 4th execution doesn't work (comes back as "source;file;results;debug;enter"), 5th works, 6th doesn't, 7-10th does, 11th doesnt, 12-31st does, 32nd doesn't, and so on.
There is just no pattern to it. However, I discovered that if the Putty window is opened maximised (@SW_MAXIMIZE, and WinSetState commented out in the code above) then it works EVERY TIME (20 additional runs, no problem).
But as soon as the target window is minimised (@SW_MINIMIZE) or hidden (@SW_HIDE) the problem appears immediately (1st run after hiding, 2nd run after minimising).
Hope this information helps to track it down?
Attachments (0)
Change History (2)
comment:1 by , on Aug 27, 2016 at 8:31:18 AM
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
comment:2 by , on Sep 2, 2016 at 8:02:19 AM
Are you serious? How is this "no bug"? Many people complain about the ControlSend erratic behaviour. This post just gave new information that the erratic behaviour does NOT happen on a maximized window. Why not use it to fix the bug which is clearly there?
I don't need any support for my case.

As explained in the ticket to which you linked, this is not the place to ask for support. please post in the forum.
M23