优化了一下楼上的代码
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
Opt("GUIOnEventMode", 1)
Global $Total, $Bu = 500, $Apex = 0
Dim $Button[$Bu][2]
$Form1 = GUICreate("主窗体", 1000, 35, 20, 5, BitOR _
($WS_MINIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_SYSMENU, $WS_POPUP, $WS_GROUP, $WS_CLIPSIBLINGS))
;~ $Pic1 = GUICtrlCreatePic("bg_hm.jpg", 0, 0, 1000, 35, BitOR($SS_NOTIFY, $WS_GROUP, $WS_CLIPSIBLINGS))
GUISetState()
$Total = IniReadSection("_conf.ini", "LINK")
For $i = 1 To $Total[0][0]
$Button[$i][0] = GUICtrlCreateButton($Total[$i][0], $Apex+55*$i, 2, 50, 30)
$Button[$i][1] = $Total[$i][1]
GUICtrlSetOnEvent($Button[$i][0], "B_Msg")
Next
While 1
Sleep(1000)
WEnd
Func B_Msg()
MsgBox(0, 0, 0)
For $i = 1 To UBound($Button, 1) - 1
If @GUI_CtrlId = $Button[$i][0] Then Run($Button[$i][1])
Next
EndFunc ;==>B_Msg
|