84038

AutoIt GUICtrlRead Specials characters

Question:

autoit GUICtrlCreateInput special char ignored ?

$user = GUICtrlCreateInput("", 90, 65, 100, 20) $dom = GUICtrlCreateInput("", 90, 95, 100, 20) $pass = GUICtrlCreateInput("", 90, 125, 100, 20, 0x0020) Send(GUICtrlRead($user) & "{tab}" & GUICtrlRead($dom) & "{tab}" & GUICtrlRead($pass) & "{Enter}")

Example with : "TOTO" as user, "home" as dom and, "azerty+" as password. Output will be :

TOTO home azerty

Why GUICtrlRead() ignore specials characters as my "+" char ?

How to fix it ?

Answer1:

From the help file:

<strong>Send()</strong> Sends simulated keystrokes to the active window.

Send ( "keys" [, flag] )

Parameters

<ul><li><em>keys</em> - The sequence of keys to send. </li> <li><em>flag [optional]</em> - Changes how "keys" is processed: flag = 0 (default), Text contains special characters like + and ! to indicate SHIFT and ALT key-presses. flag = 1, keys are sent raw.</li> </ul>

So, your example is missing flag set to 1.

$user = GUICtrlCreateInput("", 90, 65, 100, 20) $dom = GUICtrlCreateInput("", 90, 95, 100, 20) $pass = GUICtrlCreateInput("", 90, 125, 100, 20, 0x0020) Send(GUICtrlRead($user),1) Send("{tab}") Send(GUICtrlRead($dom),1) Send("{tab}") Send(GUICtrlRead($pass),1) Send("{Enter}")

Recommend