wangyibo1234 发表于 2011-6-15 22:15:01

关于INI文件生成按钮

在点击按钮时卡住,求指教!

#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;取得所有的字段信息
        $j+=1
Next
;得出字段长度
$Form1 = GUICreate("菜单-wyb", 157, 49*$j, 192, 124)


;GUICtrlCreateButton(, 0, ($m-1)*48, 153, 49)
For $i = 1 To $IniName
$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#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;取得所有的字段信息
        $j+=1
Next
;得出字段长度
$Form1 = GUICreate("菜单-wyb", 157, 49*$j, 192, 124)


;GUICtrlCreateButton(, 0, ($m-1)*48, 153, 49)
For $i = 1 To $IniName
$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 #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;取得所有的字段信息
        $j+=1
Next
;得出字段长度
$Form1 = GUICreate("菜单-wyb", 157, 49*$j, 192, 124)


;GUICtrlCreateButton(, 0, ($m-1)*48, 153, 49)
For $i = 1 To $IniName
$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

   下面我想点一个按钮时就读取,相应INI配置文件下的 信息 要怎么处理啊。。
       ; Case
                  ; For $i = 1 To $IniName
                        ; $var=IniRead (@ScriptDir & "\qq.ini", $IniName[$i], "路径", "" )
             ;ShellExecute($var)
                       ;MsgBox(0,$var,$var)
         ; Next   
                       
                       
        EndSwitch
WEnd


INI文件格式:
[配置1]
路径="c:\qq.exe"

netegg 发表于 2011-6-15 22:17:19

本帖最后由 netegg 于 2011-6-15 22:18 编辑

贴多了,改完重贴

wangyibo1234 发表于 2011-6-15 22:19:06

wangyibo1234 发表于 2011-6-15 22:21:21

回复 2# netegg


貌似不能修改啊

netegg 发表于 2011-6-15 22:51:57

回复 4# wangyibo1234

重新编辑下
页: [1]
查看完整版本: 关于INI文件生成按钮