本帖最后由 sd007 于 2009-5-29 10:55 编辑
_GUICtrlEdit_ReplaceSel不支持中文,请问怎么解决?#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiEdit.au3>
#include <GuiStatusBar.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
$Debug_Ed = False ; Check ClassName being passed to Edit functions, set to True and use a handle to another control to see it work
_Main()
Func _Main()
Local $StatusBar, $hEdit, $hGUI
Local $sFile = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & "\include\changelog.txt"
Local $aPartRightSide[3] = [200, 378, -1]
; Create GUI
$hGUI = GUICreate("Edit Replace Sel", 400, 300)
$hEdit = GUICtrlCreateEdit("", 2, 2, 394, 268, BitOR($ES_WANTRETURN, $WS_VSCROLL))
$StatusBar = _GUICtrlStatusBar_Create($hGUI, $aPartRightSide)
_GUICtrlStatusBar_SetIcon($StatusBar, 2, 97, "shell32.dll")
GUISetState()
; Set Margins
_GUICtrlEdit_SetMargins($hEdit, BitOR($EC_LEFTMARGIN, $EC_RIGHTMARGIN), 10, 10)
; Set Text
_GUICtrlEdit_SetText($hEdit, FileRead($sFile))
; Set Sel
_GUICtrlEdit_SetSel($hEdit, 0, 8)
MsgBox(4160, "Information", "Replace Sel")
_GUICtrlEdit_ReplaceSel($hEdit, "中国")
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
|