ผมลองเขียนดูน่ะครับ ถ้าผิดตรงไหนช่วยแก้ให้ด้วยนะครับ
- Code:
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Process.au3>
#Region ### START Koda GUI section ### Form=TempDelete.kxf
$Form1 = GUICreate("TempDelete 1.0", 407, 91, -1, -1, $WS_POPUP, 0)
$Label1 = GUICtrlCreateLabel("กำลังลบไฟล์ Temporary...", 96, 8, 204, 23)
GUICtrlSetFont(-1, 12, 800, 0, "Tahoma")
GUICtrlSetColor(-1, 0x0000FF)
$Label2 = GUICtrlCreateLabel("copyright freeware license 2011 By Admin_MyPrograms (arm_2468@hotmail.com)", 8, 72, 387, 17)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 1000, "long", 0x00080000)
WinSetTrans($Form1, "", 200)
$Progress1 = GUICtrlCreateProgress(0, 41, 406, 19, $PBS_SMOOTH)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
For $i = 1 To 100
GUICtrlSetData($Progress1, $i)
If $i = 10 Then _RunDOS("DEL ""%temp%"" /S /Q /A /F")
If $i = 30 Then _RunDOS("DEL ""%userprofile%\Recent"" /S /Q /A /F")
If $i = 50 Then _RunDOS("DEL ""%userprofile%\Cookies"" /S /Q /A /F")
If $i = 65 Then _RunDOS("DEL ""%userprofile%\Local Settings\History"" /S /Q /A /F")
If $i = 80 Then _RunDOS("DEL ""%userprofile%\Local Settings\Temporary Internet Files"" /S /Q /A /F")
If $i = 90 Then _RunDOS("DEL ""%windir%/temp"" /S /Q /A /F")
If $i = 95 Then WinSetTrans($Form1, "", 170)
If $i = 96 Then WinSetTrans($Form1, "", 140)
If $i = 97 Then WinSetTrans($Form1, "", 110)
If $i = 98 Then WinSetTrans($Form1, "", 80)
If $i = 99 Then WinSetTrans($Form1, "", 50)
If $i = 100 Then WinSetTrans($Form1, "", 20)
Sleep(50)
Next
Exit