用_GUICtrlMenu_InsertMenuItem创建中文菜单时,中文只能显示一半,有时还会出现乱码,这是怎么回事?
用GUICtrlCreateMenuItem创建中文菜单是正常的
#include <GuiMenu.au3>
#include <GuiConstantsEx.au3>
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Local $hGUI, $hFile, $hEdit, $hHelp, $hMain
Local Enum $idNew = 1000, $idOpen, $idSave, $idExit, $idCut, $idCopy, $idPaste, $idAbout
; Create GUI
$hGUI = GUICreate("Menu", 400, 300)
; Create File menu
$hFile = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hFile, 0, "中文中文中文", $idNew)
_GUICtrlMenu_InsertMenuItem ($hFile, 1, "&Opendfddfsdsfdsfds", $idOpen)
_GUICtrlMenu_InsertMenuItem ($hFile, 2, "&Save", $idSave)
_GUICtrlMenu_InsertMenuItem ($hFile, 3, "", 0)
_GUICtrlMenu_InsertMenuItem ($hFile, 4, "E&xit", $idExit)
; Create Edit menu
$hEdit = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hEdit, 0, "&Cut", $idCut)
_GUICtrlMenu_InsertMenuItem ($hEdit, 1, "C&opy", $idCopy)
_GUICtrlMenu_InsertMenuItem ($hEdit, 2, "&Paste", $idPaste)
; Create Help menu
$hHelp = _GUICtrlMenu_CreateMenu ()
; Create Main menu
$hMain = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hMain, 0, "&File", 0, $hFile)
_GUICtrlMenu_InsertMenuItem ($hMain, 1, "&Edit", 0, $hEdit)
_GUICtrlMenu_InsertMenuItem ($hMain, 2, "&Help", 0, $hHelp)
; Set window menu
_GUICtrlMenu_SetMenu ($hGUI, $hMain)
GUISetState()
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc ;==>_Main
[ 本帖最后由 sd007 于 2009-3-24 16:22 编辑 ] |