找回密码
 加入
搜索
查看: 1467|回复: 1

[AU3基础] 循环提取INI文件,生成按键。

[复制链接]
发表于 2011-6-15 22:23:03 | 显示全部楼层 |阅读模式
按键事件不知道怎么处理。求指教!
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
If FileExists(@ScriptDir & "\qq.ini")=0 Then
     If MsgBox(1,"提示","所需要的INI文件不存在,请检查程序完整性!")=1 Then 
         Exit
     EndIf
EndIf
Local $IniName = IniReadSectionNames(@ScriptDir & "\qq.ini")
$j=0
For $i = 1 To $IniName[0];取得所有的字段信息
        $j+=1
Next
;得出字段长度
$Form1 = GUICreate("菜单-wyb", 157, 49*$j, 192, 124)


;GUICtrlCreateButton(, 0, ($m-1)*48, 153, 49)
For $i = 1 To $IniName[0]
$IniName[$i]=GUICtrlCreateButton($IniName[$i], 0, ($i-1)*48, 153, 49)
Next



GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                Exit
       ; Case 
                  ; For $i = 1 To $IniName[0]
                        ; $var=IniRead (@ScriptDir & "\qq.ini", $IniName[$i], "路径", "" )
             ;ShellExecute($var)
                         ;MsgBox(0,$var,$var)
           ; Next   
                        
                        
        EndSwitch
WEnd
 楼主| 发表于 2011-6-16 10:05:35 | 显示全部楼层
INI文件格式
[配置1]
路径="E:\csdndd\DocLibDownload.exe"
[配置2]
路径="D:\XueTr_0.38\XueTr.exe"

通过读取INI里面的信息,生成按钮后。按钮的图标怎么变成程序的图标?
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-19 13:02 , Processed in 0.075404 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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