破剑 发表于 2009-4-22 15:06:30

KODA设计器与功能代码整合问题

各位 小弟现在才玩au3 用koda设计了一个简单的窗体,有一个进度条,和一个按钮,在点下按钮后执行
If ProcessExists("groove.exe") Then
    ProcessClose("groove.exe")
EndIf
Sleep(1000) ;five seconds
DirCopy(@homepath&"\Local Settings\Application Data\Microsoft\Office\Groove", "d:\Backups\Groove", 1)
这段代码 我应该怎么做呢 加到窗体代码的哪个位置呢。请各位指点下

以下为窗体代码
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Groove = GUICreate("Groove帐户信息备份工具      By---破剑", 501, 243, 192, 124)
$jindutiao = GUICtrlCreateProgress(24, 48, 441, 105)
$Button1 = GUICtrlCreateButton("开始备份", 168, 176, 105, 49, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

                Case $Groove
                Case $Groove
                Case $Groove
                Case $Groove
                Case $Button1
        EndSwitch
WEnd

sxd 发表于 2009-4-25 02:33:24

$nMsg = GUIGetMsg()
这里不停的得到系统信息 就是看用户进行了什么操作
Case $Button1
这里就是 当用户按了 $Button1的时候进行的操作

所以你那段放这下面
页: [1]
查看完整版本: KODA设计器与功能代码整合问题