问题
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 ?
回答1:
From the help file:
Send() Sends simulated keystrokes to the active window.
Send ( "keys" [, flag] )
Parameters
- keys - The sequence of keys to send.
- flag [optional] - 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.
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}")
来源:https://stackoverflow.com/questions/24080031/autoit-guictrlread-specials-characters