|
发表于 2010-9-25 16:32:08
|
显示全部楼层
本帖最后由 liufenglg 于 2010-9-25 16:33 编辑
别结啊 我怎么获取不到啊
#include <GuiMenu.au3>
#include <GuiConstantsEx.au3>
Opt('MustDeclareVars', 1)
_Main()
Func _Main()
Dim $a
Local $hGUI, $hFile, $hEdit, $hHelp, $hMain,$idOpen0
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_AddMenuItem ($hFile, "&New", $idNew)
_GUICtrlMenu_AddMenuItem ($hFile, "&Open", $idOpen,$idOpen0)
_GUICtrlMenu_AddMenuItem ($hFile, "&Save", $idSave)
_GUICtrlMenu_AddMenuItem ($hFile, "", 0)
_GUICtrlMenu_AddMenuItem ($hFile, "E&xit", $idExit)
; Create Edit menu
$hEdit = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_AddMenuItem ($hEdit, "&Cut", $idCut)
_GUICtrlMenu_AddMenuItem ($hEdit, "C&opy", $idCopy)
_GUICtrlMenu_AddMenuItem ($hEdit, "&Paste", $idPaste)
; Create Help menu
$hHelp = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_AddMenuItem ($hHelp, "&About", $idAbout)
; Create Main menu
$hMain = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_AddMenuItem ($hMain, "&File", 0, $hFile)
_GUICtrlMenu_AddMenuItem ($hMain, "&Edit", 0, $hEdit)
_GUICtrlMenu_AddMenuItem ($hMain, "&Help", 0, $hHelp)
; Set window menu
_GUICtrlMenu_SetMenu ($hGUI, $hMain)
GUISetState()
; Loop until user exits
While 1
$a=GUIGetMsg()
Select
Case $a=$GUI_EVENT_CLOSE
Exit
Case $a=$idopen0
FileOpenDialog('0','c:\','*.*');打开文件框我 打不开啊
endSelect
WEnd
EndFunc ;==>_Main
我这两个都试了$iCmdID
$hSubMenu
都不行 |
|