ฟอรั่ม PSsix

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ฟอรั่มของบล็อก http://pssix.blogspot.com


3 posters

    โปรแกรมลบไฟล์ temp..

    Arm
    Arm
    PSsix Member Super Class III
    PSsix Member Super Class III


    PSsix Master PSsix Program Coder
    จำนวนข้อความ : 268
    ความนิยม : 54
    เข้าร่วมเมื่อ : 31/03/2011
    อายุ : 26

    โปรแกรมลบไฟล์ temp.. Empty โปรแกรมลบไฟล์ temp..

    ตั้งหัวข้อ by Arm 04/06/11, 11:29 pm

    ผมลองเขียนดูน่ะครับ ถ้าผิดตรงไหนช่วยแก้ให้ด้วยนะครับ
    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
    ปล.อยากทำให้ $Progress1 มันเปลื่ยนสีอ่ะครับ สำหรับ win7
    newsak2005
    newsak2005
    ระงับสมาชิก
    ระงับสมาชิก


    โปรแกรมลบไฟล์ temp.. Empty
    จำนวนข้อความ : 115
    ความนิยม : 0
    เข้าร่วมเมื่อ : 08/05/2011

    โปรแกรมลบไฟล์ temp.. Empty Re: โปรแกรมลบไฟล์ temp..

    ตั้งหัวข้อ by newsak2005 05/06/11, 03:45 pm

    ลองปรับปรุงเรื่องการแสดงผลของGUI ให้ได้ตามโค๊ดนี้

    Code:
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Process.au3>
    #include <WinAPI.au3>

    $hForm = GUICreate("TempDelete 1.0", 407, 91, -1, -1, BitOR($WS_POPUP,$WS_CLIPSIBLINGS), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE,$WS_EX_LAYERED))
    GUISetBkColor(0xABABAB)
    $Label1 = GUICtrlCreateLabel("กำลังลบไฟล์ Temporary...", 96, 8, 204, 23)
    GUICtrlSetColor(-1, 0x0000FF)
    GUICtrlSetFont(-1, 12, 800, 0, "Tahoma")
    $Label2 = GUICtrlCreateLabel("copyright freeware license 2011 By Admin_MyPrograms (arm_2468@hotmail.com)", 8, 72, 387, 17)
    $Progress1 = GUICtrlCreateProgress(0, 41, 406, 19, $PBS_SMOOTH)
    GUISetState(@SW_SHOW)
    For $i = 0 To 200
        _WinAPI_SetLayeredWindowAttributes($hForm, 0xABABAB, $i, BitOR($LWA_COLORKEY, $LWA_ALPHA))
        Sleep(1)
    Next
    Do
       Sleep(100)
    Until GUIGetMsg()= -3



    Arm
    Arm
    PSsix Member Super Class III
    PSsix Member Super Class III


    PSsix Master PSsix Program Coder
    จำนวนข้อความ : 268
    ความนิยม : 54
    เข้าร่วมเมื่อ : 31/03/2011
    อายุ : 26

    โปรแกรมลบไฟล์ temp.. Empty Re: โปรแกรมลบไฟล์ temp..

    ตั้งหัวข้อ by Arm 07/06/11, 06:15 pm

    ใครก็ด้ายยยย
    ช่วยบอกวิธีเปลี่ยนสี $Progress1 หน่อยคร้าบบบบบบ (เปลี่ยนสีสำหรับ win7) em228 em229 em228
    newsak2005
    newsak2005
    ระงับสมาชิก
    ระงับสมาชิก


    โปรแกรมลบไฟล์ temp.. Empty
    จำนวนข้อความ : 115
    ความนิยม : 0
    เข้าร่วมเมื่อ : 08/05/2011

    โปรแกรมลบไฟล์ temp.. Empty Re: โปรแกรมลบไฟล์ temp..

    ตั้งหัวข้อ by newsak2005 08/06/11, 12:59 am

    Download: Vista Progress bar Click here
    ---------------------------------------------------------
    Graphic Progress bar

    Code:
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    Local $hWnd = GUICreate("Form1", 306, 22, -1, -1, BitOR($WS_POPUP,$WS_CLIPSIBLINGS), BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
    GUISetBkColor(0xD4D0C8)
    GUICtrlCreateGraphic(3, 3, 300, 15, BitOR($SS_NOTIFY,$SS_SUNKEN))
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    Local $Graphic = GUICtrlCreateGraphic(3, 4, 0, 15, BitOR($SS_NOTIFY,$SS_SUNKEN))
    GUICtrlSetBkColor(-1, 0xFFFFFF)
    GUISetState(@SW_SHOW)

    Dim $i
    For $i = 0 To 300
    GUICtrlSetPos($Graphic, 3, 4, $i, 15)
    GUICtrlSetBkColor($Graphic, 0xFF0000)
    Sleep(50)
    Next
    MsgBox(64, "", "Progression Complete.")
    GUIDelete()
    -------------------------------------------------------------------------------------------------------
    Windows Progress bar Color Percentage

    Code:
    #include <GUIConstants.au3>

    Local $Form1 = GUICreate("", 360, 40, 330, 300, -2138570616)
    GUISetBkColor(0xE3E3E3)
    Local $Progress1 = GUICtrlCreateProgress(5, 5, 350, 30)
    GUICtrlSetColor(-1, 0xFFFFFF)
    DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", GUICtrlGetHandle(-1), "wstr", " ", "wstr", " ")
    GUICtrlSetStyle(-1, 1)
    Local $Label1 = GUICtrlCreateLabel("%", 166, 13, 50, 50)
    GUICtrlSetBkColor($Label1, $GUI_BKCOLOR_TRANSPARENT)
    GUISetState(@SW_SHOW)
    GUICtrlSetData($Progress1,0)

    Dim $i
    While 1
    For $i = 0 To 100
       GUICtrlSetData($Progress1, $i)
       GUICtrlSetColor($Progress1, 0xFF0000)
       GUICtrlSetData($Label1, $i&'%')
       Sleep(50)
    Next
    For $i = 100 To 0 Step -1
       GUICtrlSetData($Progress1, $i)
       GUICtrlSetColor($Progress1, 0x00FF00)
       GUICtrlSetData($Label1, $i&'%')
       Sleep(50)
    Next
    For $i = 0 To 100
       GUICtrlSetData($Progress1, $i)
       GUICtrlSetColor($Progress1, 0x0000FF)
       GUICtrlSetData($Label1, $i&'%')
       If $i > 49 Then GUICtrlSetColor($Label1, 0xFFFFFF)
       Sleep(50)
    Next
    For $i = 100 To 0 Step -1
       GUICtrlSetData($Progress1, $i)
       GUICtrlSetColor($Progress1, 0x00FFFF)
       GUICtrlSetData($Label1, $i&'%')
       GUICtrlSetColor($Label1, 0xFF0000)
       If $i < 51 Then GUICtrlSetColor($Label1, 0x000000)
       Sleep(50)
    Next
    WEnd
    POS
    POS
    PSsix
    PSsix


    โปรแกรมลบไฟล์ temp.. Empty โปรแกรมลบไฟล์ temp.. Empty โปรแกรมลบไฟล์ temp.. Empty
    จำนวนข้อความ : 1152
    ความนิยม : 326
    เข้าร่วมเมื่อ : 19/07/2010

    โปรแกรมลบไฟล์ temp.. Empty Re: โปรแกรมลบไฟล์ temp..

    ตั้งหัวข้อ by POS 09/06/11, 11:09 am



    Progress Bar จะไม่มีคำสั่งสำหรับเปลี่ยนสีครับ จะเปลี่ยนสีได้ในกรณีที่กำหนดสถานะเอาไว้เท่านั้น (สีแสดงสถานะ 3 สี) ข้อมูลดูรายละเอียดได้ตามลิงก์ด้านล่างนี้

    [You must be registered and logged in to see this link.]

    ตัวอย่างโค้ด

    Code:

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <WindowsConstants.au3>
    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("PSsix", 489, 109, 303, 225)
    $Progress1 = GUICtrlCreateProgress(8, 8, 446, 17)
    $Radio1 = GUICtrlCreateRadio("แดง", 8, 40, 113, 17)
    $Radio2 = GUICtrlCreateRadio("เหลือง", 128, 40, 113, 17)
    $Radio3 = GUICtrlCreateRadio("เขียว", 248, 40, 113, 17)
    GUICtrlSetState(-1, $GUI_CHECKED)
    $Button1 = GUICtrlCreateButton("ทดสอบ", 400, 40, 75, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
          Case $GUI_EVENT_CLOSE
             Exit
          Case $Button1
             If GUICtrlRead($Radio1) = 1 Then
                GUICtrlSendMsg($Progress1, $PBM_SETSTATE, 2, 0)
             ElseIf GUICtrlRead($Radio2) = 1 Then
                GUICtrlSendMsg($Progress1, $PBM_SETSTATE, 3,0)
             EndIf

             For $i = 0 To 100
                Sleep(10)
                GUICtrlSetData($Progress1, $i)
             Next
             For $i = 100 To 0 Step -1
                Sleep(10)
                GUICtrlSetData($Progress1, $i)
             Next
       EndSwitch
    WEnd

    ปล. ตั้งหัวข้อ ให้ตรงกับคำถามจะได้คำตอบเร็วขึ้น ตอนแรกผมนึกว่าเป็นโค้ดสำหรับลบไฟล์ใน temp เห็นว่ามีคนตอบแล้วจึงไม่ได้คลิกเข้ามาดู

      เวลาขณะนี้ 02/05/24, 05:13 pm