#NoTrayIcon
#include-once
#include <GUIConstants.au3>
GUICreate("复制我的文档", 485, 100)
GUICtrlCreateGroup("", 5, 1, 475, 96)
GUICtrlCreateLabel("将我的文档复制到", 15, 18, 100, 18)
$Input = GUICtrlCreateInput(@MyDocumentsDir, 15, 35, 415, 16, 0x0008)
GUICtrlSetState($Input, $GUI_DISABLE)
$InputButton = GUICtrlCreateButton("浏览", 435, 33, 35, 20)
$CopyButton = GUICtrlCreateButton("进行复制", 370, 65, 80, 25, 0)
GUICtrlSetState($CopyButton, $GUI_DISABLE)
GUISetState()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $InputButton
$var = FileSelectFolder("请选择一个文件夹:", "", 1)
If @error = 1 Then
GUICtrlSetData($Input, @MyDocumentsDir)
ElseIf $var = @MyDocumentsDir Then
MsgBox(16, "错误", "复制目标目录与源目录相同!", 2)
Else
GUICtrlSetData($Input, $var)
$OK = 1
GUICtrlSetState($CopyButton, $GUI_ENABLE)
EndIf
Case $CopyButton
If $OK = 1 Then DirCopy(@MyDocumentsDir, $var, 1)
MsgBox(0, "", "文件夹复制完成!文件已复制到目录:" & $var, 3)
Exit
EndSwitch
WEnd
|