#include <string.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#AutoIt3Wrapper_UseAnsi=y
$Form1 = GUICreate("汉字内码转换演示", 280, 113, 192, 124)
$Input1 = GUICtrlCreateInput("请输入汉字", 56, 16, 129, 21)
$Input2 = GUICtrlCreateInput("汉字内码结果", 56, 48, 129, 21)
$Label1 = GUICtrlCreateLabel("汉字", 8, 16, 36, 17)
$Label2 = GUICtrlCreateLabel("内码", 8, 48, 36, 17)
$Button = GUICtrlCreateButton("转换", 200, 24, 49, 33, 0)
$Label3 = GUICtrlCreateLabel("注意:必需编译之后才能正常运行", 54, 80, 184, 17)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
$String = GUICtrlRead($Input1)
$Hex = _StringToHex($String)
GUICtrlSetData($Input2,$Hex)
EndSwitch
WEnd
切记:必需编译之后才能运行,否则只会显示内码的前两位而已
这是脚本编译方式的问题,必需要使用ANSI编译方式#AutoIt3Wrapper_UseAnsi=y
|