找回密码
 加入
搜索
查看: 3205|回复: 2

[GUI管理] 怎么单击_GUICtrlToolbar_Create上的_GUICtrlToolbar_AddButton运行一个EXE文件

[复制链接]
发表于 2010-7-5 20:01:44 | 显示全部楼层 |阅读模式
#include <GuiToolbar.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>


$Debug_TB = False

Global Const $exit = -3 
Local Enum $idSave
;~ Opt("guioneventmode",1)
$hgui = GUICreate("1",500, 300)

$toolbar = _GUICtrlToolbar_Create($hgui,0)
_GUICtrlToolbar_AddBitmap ($toolbar, 1, -1, $IDB_STD_LARGE_COLOR )
$Button1 = _GUICtrlToolbar_AddButton($toolbar,$idSave , $STD_FILENEW)
$Button2 = _GUICtrlToolbar_AddButton($toolbar,"" , $STD_FILEOPEN)
$Button3 = _GUICtrlToolbar_AddButton($toolbar,"" , $STD_FILESAVE)
;~ $Button4 = _GUICtrlToolbar_AddButton($toolbar,"" , $STD_FILESAVE)

GUISetState(@SW_SHOW)

While 1
        $gui = GUIGetMsg()
        Select
                Case $gui = $exit
                        ExitLoop
        EndSelect
WEnd
GUIDelete()
发表于 2010-7-5 22:25:35 | 显示全部楼层
#include <Constants.au3>
#include <GuiToolbar.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

$Debug_TB = False
Global $iItem
Global Const $exit = -3
Local Enum $idSave
$hgui = GUICreate("", 500, 300)

$toolbar = _GUICtrlToolbar_Create($hgui, 0)
_GUICtrlToolbar_AddBitmap($toolbar, 1, -1, $IDB_STD_LARGE_COLOR)
$Button1 = _GUICtrlToolbar_AddButton($toolbar, $idSave, $STD_FILENEW)
$Button2 = _GUICtrlToolbar_AddButton($toolbar, "", $STD_FILEOPEN)
$Button3 = _GUICtrlToolbar_AddButton($toolbar, "", $STD_FILESAVE)
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY")

While 1
        $gui = GUIGetMsg()
        Switch $gui
                Case - 3
                        ExitLoop
        EndSwitch
WEnd
GUIDelete()

Func _WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam)
        Local $tNMHDR, $code
        $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
        $code = DllStructGetData($tNMHDR, "Code")
        If $code = $NM_LDOWN Then MsgBox(0, '', '')
EndFunc   ;==>_WM_NOTIFY
 楼主| 发表于 2010-7-7 20:21:06 | 显示全部楼层
谢谢,我去研究下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-21 04:32 , Processed in 0.079298 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表