AutoIt GUICtrl读取特殊字符 [英] AutoIt GUICtrlRead Specials characters

查看:322
本文介绍了AutoIt GUICtrl读取特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

autoit GUICtrlCreateInput特殊字符被忽略了吗?

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}")

示例:"TOTO"作为用户,"home"作为dom,"azerty +"作为密码. 输出将是:

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

TOTO    home    azerty

为什么GUICtrlRead()忽略特殊字符作为我的"+"字符?

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

如何修复?

推荐答案

来自帮助文件:

发送() 将模拟的击键发送到活动窗口.

Send() Sends simulated keystrokes to the active window.

发送(键" [,标志])

Send ( "keys" [, flag] )

参数

  • 密钥-要发送的密钥序列.
  • 标志[可选] -更改键"的处理方式:标志= 0 (默认),文本包含特殊字符,例如+和!以表示 SHIFT和ALT键按下. flag = 1,密钥是原始发送的.
  • 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.

因此,您的示例缺少设置为1的标志.

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}")

这篇关于AutoIt GUICtrl读取特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆