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

[AU3基础] 求助-菜鸟

[复制链接]
发表于 2013-12-29 20:34:43 | 显示全部楼层 |阅读模式
本帖最后由 babicy 于 2014-1-2 21:32 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=d:\work\脚本\终端脚本\me\快速启动\form1.kxf
Dim $Button[20],$i,$x,$y,$j=1,$qdname,$var,$path1,$path2,$path3,$var1,$m
$path1=@ScriptDir&"\启动工具.ini"
$path2=@ScriptDir&"\启动文件.ini"
$path3=@ScriptDir&"\sys.ini"
$Form1_1 = GUICreate("tfire快速启动", 234, 363, 188, 124)
$Tab1 = GUICtrlCreateTab(8, 48, 217, 297)
$TabSheet1 = GUICtrlCreateTabItem("常用工具")
$Group1 = GUICtrlCreateGroup("", 16, 88, 201, 249)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$TabSheet2 = GUICtrlCreateTabItem("常用文件")
$Group2 = GUICtrlCreateGroup("", 16, 88, 201, 249)
;$Button2 = GUICtrlCreateButton("添加", 24, 104, 42, 42)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateTabItem("")
$i=IniRead($path3,"qdxiang","xmshu","-1")
$x=IniRead($path3,"fristwz","x","-1")
$y=IniRead($path3,"fristwz","y","-1")
While $j<=$i 
        $qdname=IniRead($path1,"qdname","qd"&$j,"-1")
    $Button[$i] = GUICtrlCreateButton($qdname, $x, $y, 42, 42)
        $j=$j+1
WEnd
$x=$x+48
IniWrite($path3,"endwz","x",$x)
IniWrite($path3,"endwz","y",$y)
IniWrite($path3,"endwz","j",$j)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button[1]
                     $var = FileOpenDialog("选择一个文件",".", "所有文件(*.*)", 1)
                         IniWrite($path1,"workpath","path"&$j,$var)
                         $var1=StringSplit($var,'\',1)
                         $m=$var1[0]        
                         $i=IniRead($path3,"endwz","j","-1")
             $x=IniRead($path3,"endwz","x","-1")
                         $y=IniRead($path3,"endwz","y","-1")
                         IniWrite($path1,"workpath","path"&$i,$var)
                         IniWrite($path1,"qdname","qd"&$i,$var1[$m])
                         $Button[$i] = GUICtrlCreateButton($var1[$m], $x, $y, 42, 42)
                Case $Button[2]
                         ;$var=IniRead($path1,"workpath","path2","-1")
                         MsgBox(4096,"",$var)
                         ;Run($var)
        EndSwitch
WEnd
执行后,马上出现msgbox(4096,"",$var)为什么
 楼主| 发表于 2013-12-30 09:22:14 | 显示全部楼层
自己 解决了
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-12-24 02:57 , Processed in 0.081969 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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