﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3269	ControlSend acts inconsistently	zureks@…		"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?"	Bug	closed		AutoIt	3.3.14.0	None	No Bug	ControlSend	
