• Offizieller Beitrag

    Hi!

    Habe das Sript jetzt nicht genau angeguckt, aber ich meine, dass man Fortschrittsbalken mit GUICTRLSetColor schon färben kann, dass man das allerdings nur sieht, wenn man nicht den XP-Style für die Fenster an hat - bin mir aber nicht ganz sicher.

    peethebee

  • Hi,

    ich möchte peethebees Ausführungen bestätigen und sinngemäß auch Xenobiologist (siehe Post 21 & 22). :thumbup:

    In Windows mit klassischem Stil ist es möglich, mit „GUICtrlSetColor“ den Fortschrittsbalken und mit „GUICtrlSetBkColor“ sogar dessen Hintergrund, farbig darzustellen. 8o
    Hingegen wird im Windows mit XP-Stil nur eine einheitliche Farbgebung bei Beiden erzielt.
    Beim wechsel (switchen) zwischen den versch. Stilen, wird eine vorher programmierte Einstellung wieder ein – bzw. ausgeschaltet. :thumbup:

    Gut zu wissen (siehe Anhang) ! :thumbup:

    Schöne Feiertage und
    Danke

    Man liest sich...
    Euer Ritzelrocker04

    • Offizieller Beitrag

    @Xeno: Ich finde es schon fantastisch, was man alles so im engl. Forum findet, aber eigentlich wollte ich wissen, wie man hinter das Geheimnis der DllCalls kommt.
    Ich meine, ein Aufruf von: DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0) bewirkt, dass man ein PopupFenster verschieben kann!? :rolleyes::?::?::?:
    Gibt's da irgendwo eine Doku drüber?

    • Offizieller Beitrag

    @Xeno: Vielen Dank für den Link. Ich werde mal versuchen mich da 'reinzulesen'.

    Aus aktuellem Anlass (ich habe mir eine ICY-Box IB-NAS4220 gekauft) habe ich das Script mal so angepasst, dass auch Netzlaufwerke mit angezeigt werden.

    Spoiler anzeigen
    [autoit]


    ; by Ritzelrocker04, Xenobiologist and Oscar
    Opt('MustDeclareVars', 1)
    #include <GUIConstants.au3>
    #include <String.au3>
    #include <Array.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $WM_LBUTTONDOWN = 0x0201
    Global $aFDrive = DriveGetDrive('FIXED'), $aNDrive = DriveGetDrive('NETWORK')
    If IsArray($aNDrive) Then
    For $i = 1 To $aNDrive[0]
    _ArrayAdd($aFDrive, $aNDrive[$i])
    $aFDrive[0] += 1
    Next
    EndIf
    Global $aProgress[$aFDrive[0]], $aName[$aFDrive[0]], $msg = 0, $aVol = 0
    Global $GUI = GUICreate('SpaceBar v 2.0', 248, 8 + $aFDrive[0] * 50, @DesktopWidth - 250, 27, $WS_POPUPWINDOW, $WS_EX_TOPMOST)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $aFDrive[0] - 1
    $aProgress[$i] = GUICtrlCreateProgress(8, 8 + $i * 50, 230, 17)
    $aName[$i] = GUICtrlCreateInput('', 8, 27 + $i * 50, 230, 21, $ES_READONLY)
    Next
    Global $trackmenu = GUICtrlCreateContextMenu()
    Global $aboutitem = GUICtrlCreateMenuItem('About', $trackmenu)
    GUICtrlCreateMenuItem('', $trackmenu)
    Global $exititem = GUICtrlCreateMenuItem('Exit', $trackmenu)
    GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _Update()
    AdlibEnable('_Update', 60000) ; Empfehlung AdlibEnable('_Update', 300000) = 5min

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg = $exititem Or $msg = -3 Or $msg = -1 Then Exit (0)
    If $msg = $aboutitem Then MsgBox(0, 'About', 'SpaceBar v 2.0.0.0' & @CRLF & 'Build 2007-12-18' & @CRLF & 'Copyright by Ritzelrocker04 !')
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    For $i = 0 To $aFDrive[0] - 1
    $aVol = _DriveFree($aFDrive[$i + 1])
    GUICtrlSetData($aProgress[$i], $aVol[0])
    GUICtrlSetData($aName[$i], 'Auf ' & $aVol[1] & ' sind ' & $aVol[2] & ' MB frei')
    Next
    EndFunc ;==>_Update

    [/autoit] [autoit][/autoit] [autoit]

    Func _DriveFree($LW)
    Local $TOTAL = DriveSpaceTotal($LW), $FREE = DriveSpaceFree($LW), $aDrive[3] = [StringReplace(Round(($TOTAL - $FREE) / ($TOTAL / 100), 2), '.', ','), _
    StringUpper($LW) & ' (' & DriveGetLabel($LW) & ')', _StringAddComma(StringReplace(Round($FREE, 2), '.', ','), '.', ',')]
    Return $aDrive
    EndFunc ;==>_DriveFree

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
    EndFunc ;==>_WinMove

    [/autoit]
  • Hallo Oscar,

    nochmals herzlichen Dank an Ihm, Xeno und auch pee für die erwiesene Aufmerksamkeit und Unterweisung. Weiterhin freut es mich um so mehr, dass auch für Ihn etwas Neues dabei ist.

    Beim letzten Script kommt es zu einer Fehlermeldung in Zeile 10 !

    Danksagung
    an das Forum und
    besonders an die Mitwirkenden für ihr Engagement sowie die schnelle, hochwertige Hilfe.

    Schöne Feiertage und
    weiterhin viel Erfolg !

    Man liest sich...
    Euer Ritzelrocker04

    • Offizieller Beitrag

    Hi,

    so sollte es gehen:

    Spoiler anzeigen
    [autoit]

    ; by Ritzelrocker04, Xenobiologist and Oscar
    Opt('MustDeclareVars', 1)
    #include <GUIConstants.au3>
    #include <String.au3>
    #include <Array.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $WM_LBUTTONDOWN = 0x0201
    Global $aFDrive = DriveGetDrive('FIXED'), $aNDrive = DriveGetDrive('NETWORK')
    If IsArray($aNDrive) Then
    For $i = 1 To $aNDrive[0]
    _ArrayAdd($aFDrive, $aNDrive[$i])
    $aFDrive[0] += 1
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Global $aProgress[$aFDrive[0]], $aName[$aFDrive[0]], $msg = 0, $aVol = 0
    Global $GUI = GUICreate('SpaceBar v 2.0', 248, 8 + $aFDrive[0] * 50, @DesktopWidth - 250, 27, $WS_POPUPWINDOW, $WS_EX_TOPMOST)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $aFDrive[0] - 1
    $aProgress[$i] = GUICtrlCreateProgress(8, 8 + $i * 50, 230, 17)
    $aName[$i] = GUICtrlCreateInput('', 8, 27 + $i * 50, 230, 21, $ES_READONLY)
    Next
    Global $trackmenu = GUICtrlCreateContextMenu()
    Global $aboutitem = GUICtrlCreateMenuItem('About', $trackmenu)
    GUICtrlCreateMenuItem('', $trackmenu)
    Global $exititem = GUICtrlCreateMenuItem('Exit', $trackmenu)
    GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _Update()
    AdlibEnable('_Update', 1000) ; Empfehlung AdlibEnable('_Update', 300000) = 5min

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg = $exititem Or $msg = -3 Or $msg = -1 Then Exit (0)
    If $msg = $aboutitem Then MsgBox(0, 'About', 'SpaceBar v 2.0.0.0' & @CRLF & 'Build 2007-12-18' & @CRLF & 'Copyright by Ritzelrocker04 !')
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    For $i = 0 To $aFDrive[0] - 1
    $aVol = _DriveFree($aFDrive[$i + 1])
    GUICtrlSetData($aProgress[$i], $aVol[0])
    GUICtrlSetData($aName[$i], 'Auf ' & $aVol[1] & ' sind ' & $aVol[2] & ' MB frei')
    Next
    EndFunc ;==>_Update

    [/autoit] [autoit][/autoit] [autoit]

    Func _DriveFree($LW)
    Local $TOTAL = DriveSpaceTotal($LW), $FREE = DriveSpaceFree($LW), $aDrive[3] = [StringReplace(Round(($TOTAL - $FREE) / ($TOTAL / 100), 2), '.', ','), _
    StringUpper($LW) & ' (' & DriveGetLabel($LW) & ')', _StringAddComma(StringReplace(Round($FREE, 2), '.', ','), '.', ',')]
    Return $aDrive
    EndFunc ;==>_DriveFree

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
    EndFunc ;==>_WinMove

    [/autoit]

    So long,

    Mega

  • Hi,

    ich habe Zeile 37 entsprechen angepasst !


    Spoiler anzeigen
    [autoit]

    ; by Ritzelrocker04, Xenobiologist and Oscar
    Opt('MustDeclareVars', 1)
    #include
    #include
    #include
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $WM_LBUTTONDOWN = 0x0201
    Global $aFDrive = DriveGetDrive('FIXED'), $aNDrive = DriveGetDrive('NETWORK')
    If IsArray($aNDrive) Then
    For $i = 1 To $aNDrive[0]
    _ArrayAdd($aFDrive, $aNDrive[$i])
    $aFDrive[0] += 1
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Global $aProgress[$aFDrive[0]], $aName[$aFDrive[0]], $msg = 0, $aVol = 0
    Global $GUI = GUICreate('SpaceBar v 2.0', 248, 8 + $aFDrive[0] * 50, @DesktopWidth - 250, 27, $WS_POPUPWINDOW, $WS_EX_TOPMOST)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $aFDrive[0] - 1
    $aProgress[$i] = GUICtrlCreateProgress(8, 8 + $i * 50, 230, 17)
    $aName[$i] = GUICtrlCreateInput('', 8, 27 + $i * 50, 230, 21, $ES_READONLY)
    Next
    Global $trackmenu = GUICtrlCreateContextMenu()
    Global $aboutitem = GUICtrlCreateMenuItem('About', $trackmenu)
    GUICtrlCreateMenuItem('', $trackmenu)
    Global $exititem = GUICtrlCreateMenuItem('Exit', $trackmenu)
    GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove")
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _Update()
    AdlibEnable('_Update', 1000) ; Empfehlung AdlibEnable('_Update', 300000) = 5min

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg = $exititem Or $msg = -3 Or $msg = -1 Then Exit (0)
    If $msg = $aboutitem Then MsgBox(64, 'About', 'SpaceBar v 2.0.0.0 Build 2007-12-23 ' & @CRLF & '' & @CRLF & 'Copyright by :' & @CRLF & 'Ritzelrocker04, Oscar, Xenobiologist ' & @CRLF & 'Thx an das http://www.Autoit.de Team ')
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    For $i = 0 To $aFDrive[0] - 1
    $aVol = _DriveFree($aFDrive[$i + 1])
    GUICtrlSetData($aProgress[$i], $aVol[0])
    GUICtrlSetData($aName[$i], 'Auf ' & $aVol[1] & ' sind ' & $aVol[2] & ' MB frei')
    Next
    EndFunc ;==>_Update

    [/autoit] [autoit][/autoit] [autoit]

    Func _DriveFree($LW)
    Local $TOTAL = DriveSpaceTotal($LW), $FREE = DriveSpaceFree($LW), $aDrive[3] = [StringReplace(Round(($TOTAL - $FREE) / ($TOTAL / 100), 2), '.', ','), _
    StringUpper($LW) & ' (' & DriveGetLabel($LW) & ')', _StringAddComma(StringReplace(Round($FREE, 2), '.', ','), '.', ',')]
    Return $aDrive
    EndFunc ;==>_DriveFree

    [/autoit] [autoit][/autoit] [autoit]

    Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
    EndFunc ;==>_WinMove

    [/autoit] [autoit][/autoit] [autoit][/autoit]


    Schöne Feiertage und
    weiterhin viel Erfolg !

    Man liest sich...
    Euer Ritzelrocker04

    • Offizieller Beitrag

    Hi,

    das brauchst du nicht. Ich lege auf soetwas nicht so viel wert. Wenn jemand ein komplettes Skript oder eine tolle Funktionalität übernimmt, dann wäre ein Credit nicht schlecht, aber bei so einfachen Dingen ist das nicht notwendig. (Meine Meinung!)

    So long,

    Mega

    P.S.: Wie soll es denn jetzt hiermit weitergehen?

  • Also ich mußte so einiges raus schmeißen, bis es "funzt".

    So läuft das ganze bei mir fehlerfrei und schnell:

    Spoiler anzeigen
    [autoit]


    #include<Array.au3>
    #include<String.au3>
    #include<GUIConstants.au3>
    ; by Ritzelrocker04, Xenobiologist and Oscar
    Opt('MustDeclareVars', 1)
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $WM_LBUTTONDOWN = 0x0201
    Global $aFDrive = DriveGetDrive('FIXED'), $aNDrive = DriveGetDrive('NETWORK')
    If IsArray($aNDrive) Then
    For $i = 1 To $aNDrive[0]
    _ArrayAdd($aFDrive, $aNDrive[$i])
    $aFDrive[0] += 1
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Global $aProgress[$aFDrive[0]], $aName[$aFDrive[0]], $msg = 0, $aVol = 0
    Global $GUI = GUICreate('SpaceBar v 2.0', 248, 8 + $aFDrive[0] * 50, @DesktopWidth - 250, 27, $WS_POPUPWINDOW, $WS_EX_TOPMOST)

    [/autoit] [autoit][/autoit] [autoit]

    For $i = 0 To $aFDrive[0] - 1
    $aProgress[$i] = GUICtrlCreateProgress(8, 8 + $i * 50, 230, 17)
    $aName[$i] = GUICtrlCreateInput('', 8, 27 + $i * 50, 230, 21, $ES_READONLY)
    Next
    Global $trackmenu = GUICtrlCreateContextMenu()
    Global $aboutitem = GUICtrlCreateMenuItem('About', $trackmenu)
    GUICtrlCreateMenuItem('', $trackmenu)
    Global $exititem = GUICtrlCreateMenuItem('Exit', $trackmenu)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _Update()
    AdlibEnable('_Update', 1000) ; Empfehlung AdlibEnable('_Update', 300000) = 5min

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg = $exititem Or $msg = -3 Or $msg = -1 Then Exit (0)
    If $msg = $aboutitem Then MsgBox(64, 'About', 'SpaceBar v 2.0.0.0 Build 2007-12-23 ' & @CRLF & '' & @CRLF & 'Copyright by :' & @CRLF & 'Ritzelrocker04, Oscar, Xenobiologist ' & @CRLF & 'Thx an das http://www.Autoit.de Team ')
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    For $i = 0 To $aFDrive[0] - 1
    $aVol = _DriveFree($aFDrive[$i + 1])
    GUICtrlSetData($aProgress[$i], $aVol[0])
    GUICtrlSetData($aName[$i], 'Auf ' & $aVol[1] & ' sind ' & $aVol[2] & ' MB frei')
    Next
    EndFunc ;==>_Update

    [/autoit] [autoit][/autoit] [autoit]

    Func _DriveFree($LW)
    Local $TOTAL = DriveSpaceTotal($LW), $FREE = DriveSpaceFree($LW), $aDrive[3] = [StringReplace(Round(($TOTAL - $FREE) / ($TOTAL / 100), 2), '.', ','), _
    StringUpper($LW) & ' (' & DriveGetLabel($LW) & ')', _StringAddComma(StringReplace(Round($FREE, 2), '.', ','), '.', ',')]
    Return $aDrive
    EndFunc ;==>_DriveFree

    [/autoit]

    WIESO sind keine Zahlen im "Spoiler" ?

    edit: AutoIt Zahlenreihe noch zur besseren Übersicht hin bekommen ;)

    Einen lieben blonden GRUSS.

    L I N A

    LG, Lina.

    Lieben Gruß,
    Alina

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Geheime Information: ;)
    OuBVU5ebLhHu5QvlnAyQB4A7SzBrvWulwL7RLl2BdH5tI6sIYspeMKeXMSXl

    2 Mal editiert, zuletzt von Alina (23. Dezember 2007 um 19:22)

  • Ich hab ziemlich viel dran geändert. Hoffentlich stört es dich nicht, Ritzelrocker04
    Außerdem hab ich mir ne neu farbige Progressbar erstellt. Einziges Problem: Bei schnellem Updaten flackert sie. (Und noch Docking und einklappen am rechten bildschirmrand)

    3D-ProgressBar
    [autoit]

    #NoTrayIcon
    ; by Ritzelrocker04, Xenobiologist and Oscar
    Opt('MustDeclareVars', 1)
    ;[Includes]
    #include<Array.au3>
    #include<GUIConstants.au3>
    #include<String.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    If Not IsDeclared("Range") Then Const $Range = 100
    If Not IsDeclared("WM_MOVING") Then Const $WM_MOVING = 0x0216
    If Not IsDeclared("WM_ENTERSIZEMOVE") Then Const $WM_ENTERSIZEMOVE = 0x0231
    If Not IsDeclared("WM_LBUTTONDOWN") Then Global Const $WM_LBUTTONDOWN = 0x0201
    If Not IsDeclared("WM_SYSCOMMAND") Then Const $WM_SYSCOMMAND = 0x112
    If Not IsDeclared("WM_RBUTTONDOWN") Then Global Const $WM_RBUTTONDOWN = 0x0204

    [/autoit] [autoit][/autoit] [autoit]

    Global $taskbarPos = WinGetPos("[CLASS:Shell_TrayWnd]"), $x_start, $y_start

    [/autoit] [autoit][/autoit] [autoit]

    Global $aFDrive = DriveGetDrive('FIXED'), $aNDrive = DriveGetDrive('NETWORK')
    If IsArray($aNDrive) Then
    For $i = 1 To $aNDrive[0]
    _ArrayAdd($aFDrive, $aNDrive[$i])
    $aFDrive[0] += 1
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Global $aProgress[$aFDrive[0]], $aName[$aFDrive[0]], $msg = 0, $aVol = 0, $aProzent[$aFDrive[0]], $aGB[$aFDrive[0]]
    Global $GUI = GUICreate('SpaceBar v 2.0', 340, 8 + $aFDrive[0] * 50, @DesktopWidth - 340, 27, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    Global $Colors = _Gradient(0x00CC00,0x00FF00, $aFDrive[0]*2)
    Global $hider = GUICtrlCreateLabel(":: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::",0,0,5,10 + $aFDrive[0] * 50)
    Dim $k = 0
    For $i = 0 To $aFDrive[0] - 1
    $aProgress[$i] = _ProgressCreate(10, 8 + $i * 50, 230, 20,$Colors[$k],-1,$Colors[$k+1])
    $aProzent[$i] = GUICtrlCreateLabel("", 250, 8 + $i * 50,70,20,$ES_RIGHT,$GUI_WS_EX_PARENTDRAG)
    GUICtrlSetFont(-1,10,700,0,"Arial")
    $aGB[$i] = GUICtrlCreateLabel("", 250, 30 + $i * 50,70,20,$ES_RIGHT,$GUI_WS_EX_PARENTDRAG)
    GUICtrlSetFont(-1,10,500,0,"Arial")
    $k+=2
    ;Func _ProgressCreate($x, $y,$w = 204, $h = 24,$Col=0xFFFF00,$BG=0xAAAA00,$GradCol=0x00FF00,$GradBG=0xFF0000)
    $aName[$i] = GUICtrlCreateInput('', 10, 30 + $i * 50, 230, 21, $ES_READONLY)
    Next
    Dim $aContext = GUICtrlCreateLabel(" ",250,10,230,-2 + $aFDrive[0] * 50,-1,$GUI_WS_EX_PARENTDRAG) ;Label for ContextMenu over the otherLabels
    GUICtrlSetState($aContext,$GUI_ONTOP)
    GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
    Global $trackmenu = GUICtrlCreateContextMenu($aContext)
    Global $aboutitem = GUICtrlCreateMenuItem('About', $trackmenu)
    GUICtrlCreateMenuItem('', $trackmenu)
    Global $exititem = GUICtrlCreateMenuItem('Exit', $trackmenu)
    Dim $aExit = GUICtrlCreateLabel("X",330,0,10,10,$ES_CENTER) ; Label als Exit-Button
    GUICtrlSetBkColor(-1,0xDD0000)
    GUICtrlSetColor(-1,0xFFFFFF)
    GUICtrlSetFont(-1,-1,600)
    GUIRegisterMsg($WM_RBUTTONDOWN, "_RightClick") ; Funktion, um das KontextMenu des Labels auch von der Gui aus aufzurufen
    GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove") ; Funktion, um das Fenster zu bewegen
    GUIRegisterMsg($WM_ENTERSIZEMOVE, "On_WM_ENTERSIZEMOVE") ; Docking
    GUIRegisterMsg($WM_MOVING, "On_WM_MOVING") ; Docking
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _Update()
    AdlibEnable('_Update', 10000) ; Empfehlung AdlibEnable('_Update', 300000) = 5min
    Dim $hidden = 0
    While 1
    $msg = GUIGetMsg()
    If $msg = $exititem Or $msg = -3 Or $msg = -1 Or $msg = $aExit Then Exit (0)
    If $msg = $hider Then
    If $hidden Then
    WinMove($gui,"",@DesktopWidth-340,Default)
    Else
    WinMove($gui,"",@DesktopWidth-5,Default)
    EndIf
    $hidden = Not $hidden
    EndIf
    If $msg = $aboutitem Then MsgBox(64, 'About', 'SpaceBar v 2.0.0.0 Build 2007-12-23 ' & @CRLF & '' & @CRLF & 'Copyright by :' & @CRLF & 'Ritzelrocker04, Oscar, Xenobiologist ' & @CRLF & 'Thx an das http://www.Autoit.de Team ')
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    For $i = 0 To $aFDrive[0] - 1
    $aVol = _DriveFree($aFDrive[$i + 1])
    ;_GuiCtrlOCXProgressSetValue($aProgress[$i], $aVol[0])
    GUICtrlSetData($aProzent[$i],StringReplace((100-$aVol[0]),".",",") & "% frei")
    Select
    Case $aVol[0] >= 60
    GUICtrlSetColor($aProzent[$i],0xDD0000)
    Case $aVol[0] < 60 And $aVol[0] > 40
    GUICtrlSetColor($aProzent[$i],0xEE8800)
    Case $aVol[0] <= 40
    GUICtrlSetColor($aProzent[$i],0x00CC00)
    EndSelect
    GUICtrlSetData($aGB[$i],"von " & StringReplace(Round(($aVol[3]/1024),1),".",",") & "GB")
    _ProgressSet($aProgress[$i], 100-Number($aVol[0]))
    If @error Then MsgBox(0, $aVol[0], @error)
    GUICtrlSetData($aName[$i], 'Auf ' & $aVol[1] & ' sind ' & $aVol[2] & ' MB frei')

    Next
    EndFunc ;==>_Update

    [/autoit] [autoit][/autoit] [autoit]

    Func _DriveFree($LW)
    Local $TOTAL = DriveSpaceTotal($LW), $FREE = DriveSpaceFree($LW), $aDrive[4] = [(Round(($TOTAL - $FREE) / ($TOTAL / 100), 2)), _
    StringUpper($LW) & ' (' & DriveGetLabel($LW) & ')', _StringAddComma(StringReplace(Round($FREE, 2), '.', ','), '.', ','), $TOTAL]
    Return $aDrive
    EndFunc ;==>_DriveFree

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Moving and Docking
    Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
    EndFunc ;==>_WinMove

    [/autoit] [autoit][/autoit] [autoit]

    ; Author: Xenobiologist (Mega)
    Func On_WM_ENTERSIZEMOVE()
    Local $aMPos = MouseGetPos()
    $x_start = $aMPos[0]
    $y_start = $aMPos[1]
    EndFunc ;==>On_WM_ENTERSIZEMOVE

    [/autoit] [autoit][/autoit] [autoit]

    ; Author: Xenobiologist (Mega)
    Func On_WM_MOVING($hWnd, $Msg, $wParam, $lParam)
    Local $aMPos = MouseGetPos()
    Local $rect = DllStructCreate("long left; long top; long right; long bottom", $lParam)
    Local $left = DllStructGetData($rect, "left")
    Local $top = DllStructGetData($rect, "top")
    Local $right = DllStructGetData($rect, "right")
    Local $bottom = DllStructGetData($rect, "bottom")
    If $left <= $Range And $aMPos[0] < $x_start Then
    DllStructSetData($rect, "left", 0)
    DllStructSetData($rect, "right", $right - $left)
    EndIf
    If $top <= $Range And $aMPos[1] < $y_start Then
    DllStructSetData($rect, "top", 0)
    DllStructSetData($rect, "bottom", $bottom - $top)
    EndIf
    If $right >= (@DesktopWidth - $Range) And $aMPos[0] > $x_start Then
    DllStructSetData($rect, "right", @DesktopWidth)
    DllStructSetData($rect, "left", (@DesktopWidth - $right) + $left)
    EndIf
    If $bottom >= ($taskbarPos[1] - $Range) And $aMPos[1] > $y_start Then
    DllStructSetData($rect, "bottom", $taskbarPos[1])
    DllStructSetData($rect, "top", ($taskbarPos[1] - $bottom) + $top)
    EndIf
    On_WM_ENTERSIZEMOVE()
    EndFunc ;==>On_WM_MOVING
    #endregion
    ;-------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Gradient
    ;===============================================================================
    ;
    ; Function Name: _Gradient($RGB_Color1 ,$RGB_Color2, $Count)
    ; Description:: Returns an Array of Gradient Colors
    ; Parameter(s): $RGB_Color1 : The Start-Color in RGB Hexadecimal
    ; $RGB_Color2 : The End-Color in RGB Hexadecimal
    ; $Count : The number of Colors in the Gradient
    ; Requirement(s):
    ; Return Value(s): An Array with the Colors
    ; Author(s): Prog@ndy
    ;
    ;===============================================================================
    ;

    [/autoit] [autoit][/autoit] [autoit]

    Func _Gradient($RGB_Color1 ,$RGB_Color2, $Count)
    Dim $Color1_R, $Color1_G, $Color1_B, $Color2_R, $Color2_G, $Color2_B, $NeuCol_R, $NeuCol_G, $NeuCol_B

    $Color1_R = BitAND( BitShift($RGB_Color1, 16), 0xff)
    $Color1_G = BitAND( BitShift($RGB_Color1, 8), 0xff)
    $Color1_B = BitAND($RGB_Color1, 0xff)

    $Color2_R = BitAND( BitShift($RGB_Color2, 16), 0xff)
    $Color2_G = BitAND( BitShift($RGB_Color2, 8), 0xff)
    $Color2_B = BitAND($RGB_Color2, 0xff)

    $Count -= 1 ; 0-basiert !
    Dim $arColors[$Count+1], $pos1

    For $i = 0 To $Count
    $pos1 = $Count - $i
    $NeuCol_R = ($Color1_R * $pos1 + $Color2_R * $i) / ($Count)
    $NeuCol_G = ($Color1_G * $pos1 + $Color2_G * $i) / ($Count)
    $NeuCol_B = ($Color1_B * $pos1 + $Color2_B * $i) / ($Count)
    $arColors[$i] = Execute("0x" & Hex($NeuCol_R,2) & Hex($NeuCol_G,2) & Hex($NeuCol_B,2))
    Next
    Return $arColors
    EndFunc
    #endregion
    ;-------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Colored Progressbar

    [/autoit] [autoit][/autoit] [autoit]

    ;Hilfsfunktion für doppelten Verlauf
    ; Author(s): Prog@ndy
    Func _ZwischenGrad($RGB_c)
    Local $c_R = BitAND( BitShift($RGB_c, 16), 0xff)
    Local $c_G = BitAND( BitShift($RGB_c, 8), 0xff)
    Local $c_B = BitAND($RGB_c, 0xff)
    $c_R = _MyMax(0,$c_R-99)
    $c_G = _MyMax(0,$c_G-99)
    $c_B = _MyMax(0,$c_B-99)
    Return Dec(Hex($c_R,2) & Hex($c_G,2) & Hex($c_B,2))
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Author(s): Prog@ndy
    Func _ProgressCreate($x, $y,$w = 204, $h = 24,$Col=0xFFFF00,$BG=0xAAAA00,$GradCol=0x00FF00,$GradBG=0xFF0000)
    Local $ID[8]
    $ID[0] = GUICtrlCreateGraphic($x,$y,$w,$h)
    Local $error = @error
    Local $extended = @extended
    $ID[1] = $w
    $ID[2] = $h
    If $Col = -1 Then $Col=0xFFFF00
    If $BG = -1 Then $BG=0xAAAA00
    If $GradCol = -1 Then $GradCol=0x00FF00
    If $GradBG = -1 Then $GradBG=0xFF0000
    $ID[3] = $Col
    $ID[4] = $BG
    $ID[5] = $GradCol
    $ID[6] = $GradBG
    _ProgressSet($ID,0)
    Return SetError($error,$extended,$ID)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Author(s): Prog@ndy
    Func _ProgressDelete(ByRef $ID)
    If Not IsArray($ID) Or UBound($ID) <> 8 Then Return SetError(1,0,0)
    $ID[1] = -1
    $ID[2] = -1
    $ID[3] = -1
    $ID[4] = -1
    $ID[5] = -1
    $ID[6] = -1
    $ID[7] = -1
    Dim $temp = GUICtrlDelete($ID[0])
    Return SetError(@error,0,$temp)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Author(s): Prog@ndy
    Func _ProgressSetColors(ByRef $ID,$Col,$BG=-1,$GradCol=-1,$GradBG=-1)
    If Not IsArray($ID) Or UBound($ID) <> 8 Then Return SetError(1,0,0)
    $ID[3] = $Col
    If $BG <> -1 Then $ID[4] = $BG
    If $GradCol <> -1 Then $ID[5] = $GradCol
    If $GradBG <> -1 Then $ID[6] = $GradBG
    MsgBox(0,$ID[6],$ID[7])
    _ProgressSet($ID,$ID[7])
    Return SetError(@error,0,@error)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Author(s): Prog@ndy
    Func _ProgressSet(ByRef $ID, $value)
    Local $Wechsel = Round((9/20)*$ID[2]-4)
    Local $Hoehe = $ID[2]-4
    Local $Breite = $ID[1]-4

    [/autoit] [autoit][/autoit] [autoit]


    If $value <= $ID[7] Then
    GUICtrlSetBkColor($ID[0],0xAAAAAA)
    GUICtrlSetColor($ID[0],0x777777)
    $ID[7] = $value
    Local $temp = _ZwischenGrad($ID[6])
    Local $Gradient = _Gradient($ID[4],$temp, $Wechsel)
    Local $Gradient2 = _Gradient($temp,$ID[6], $Hoehe-$Wechsel)
    For $i = 2 To $Wechsel+1
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,$Gradient[$i-2])
    GUICtrlSetGraphic($ID[0],$GUI_GR_RECT, 2,$i,$Breite,1)
    Next
    For $i = $Wechsel+2 To $Hoehe+1
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,$Gradient2[$i-$Wechsel-2])
    GUICtrlSetGraphic($ID[0],$GUI_GR_RECT, 2,$i,$Breite,1)
    Next
    Local $start = 2
    Else
    Local $start = $ID[7]+2
    $ID[7] = $value
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Local $Faktor = $Breite/100
    $value *= $Faktor
    If Round($value) >= $Breite Then $value = $Breite
    Local $temp = _ZwischenGrad($ID[5])
    Local $Gradient = _Gradient($ID[3],$temp, $Wechsel)
    Local $Gradient2 = _Gradient($temp,$ID[5], $Hoehe-$Wechsel)
    ;Local $Gradient = _Gradient(0xFFFF00,0x00AA00, $Wechsel)
    ;Local $Gradient2 = _Gradient(0x00AA00,0x00FF00, $Hoehe-$Wechsel)
    For $i = 2 To $Wechsel+1
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,$Gradient[$i-2])
    GUICtrlSetGraphic($ID[0],$GUI_GR_RECT, $start,$i,$value-$start+2,1)
    Next
    For $i = $Wechsel+2 To $Hoehe+1
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,$Gradient2[$i-$Wechsel-2])
    GUICtrlSetGraphic($ID[0],$GUI_GR_RECT, $start,$i,$value-$start+2,1)
    Next

    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,0xCCCCCC)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, 2,2)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, 2,$Hoehe+1);19)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, $Breite+1,2)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, $Breite+1,$Hoehe+1)
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,0xEEEEEE)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, 0,$Hoehe+3)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, 0,0)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, $Breite+3,$Hoehe+3)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, $Breite+3,0)

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetGraphic($ID[0],$GUI_GR_REFRESH)

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Original _Max() Function, directly included
    ; Author(s): Jeremy Landes <jlandes at landeserve dot com>
    Func _MyMax($nNum1, $nNum2)
    ; Check to see if the parameters are indeed numbers of some sort.
    If (Not IsNumber($nNum1)) Then
    SetError(1)
    Return (0)
    EndIf
    If (Not IsNumber($nNum2)) Then
    SetError(2)
    Return (0)
    EndIf

    If $nNum1 > $nNum2 Then
    Return $nNum1
    Else
    Return $nNum2
    EndIf
    EndFunc ;==>_Max

    [/autoit] [autoit][/autoit] [autoit]

    #endregion
    ;-------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Context Menu Handlers
    Func _RightClick($HWnd, $Command, $wParam, $lParam)
    ShowMenu($hWnd,$trackmenu,$aContext,1)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;Author: MsCreatoR in http://www.autoitscript.com/forum/index.ph…ndpost&p=453350
    ;Modified from Help
    ; Show a menu in a given GUI window which belongs to a given GUI ctrl
    Func ShowMenu($hWnd, $nContextID, $nContextControlID, $iMouse=0)
    Local $hMenu = GUICtrlGetHandle($nContextID)
    Local $iCtrlPos = ControlGetPos($hWnd, "", $nContextControlID)

    Local $X = $iCtrlPos[0]
    Local $Y = $iCtrlPos[1] + $iCtrlPos[3]

    ClientToScreen($hWnd, $X, $Y)

    If $iMouse Then
    $X = MouseGetPos(0)
    $Y = MouseGetPos(1)
    EndIf

    DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $X, "int", $Y, "hwnd", $hWnd, "ptr", 0)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Convert the client (GUI) coordinates to screen (desktop) coordinates
    ;From Help
    Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
    Local $stPoint = DllStructCreate("int;int")

    DllStructSetData($stPoint, 1, $x)
    DllStructSetData($stPoint, 2, $y)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

    $x = DllStructGetData($stPoint, 1)
    $y = DllStructGetData($stPoint, 2)
    ; release Struct not really needed as it is a local
    $stPoint = 0
    EndFunc
    #endregion
    ;-------------------------------------------------------------------

    [/autoit]

    3 Mal editiert, zuletzt von progandy (26. Dezember 2007 um 14:08)

  • Standard-ProgressBar ohne Visual-Style:

    2D-ProgressBar
    [autoit]

    #NoTrayIcon
    ; by Ritzelrocker04, Xenobiologist and Oscar
    Opt('MustDeclareVars', 1)
    ;[Includes]
    #include<Array.au3>
    #include<GUIConstants.au3>
    #include<String.au3>
    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0) ; Disable Visual-Styles

    [/autoit] [autoit][/autoit] [autoit]

    If Not IsDeclared("Range") Then Const $Range = 100
    If Not IsDeclared("WM_MOVING") Then Const $WM_MOVING = 0x0216
    If Not IsDeclared("WM_ENTERSIZEMOVE") Then Const $WM_ENTERSIZEMOVE = 0x0231
    If Not IsDeclared("WM_LBUTTONDOWN") Then Global Const $WM_LBUTTONDOWN = 0x0201
    If Not IsDeclared("WM_SYSCOMMAND") Then Const $WM_SYSCOMMAND = 0x112
    If Not IsDeclared("WM_RBUTTONDOWN") Then Global Const $WM_RBUTTONDOWN = 0x0204

    [/autoit] [autoit][/autoit] [autoit]

    Global $taskbarPos = WinGetPos("[CLASS:Shell_TrayWnd]"), $x_start, $y_start

    [/autoit] [autoit][/autoit] [autoit]

    Global $aFDrive = DriveGetDrive('FIXED'), $aNDrive = DriveGetDrive('NETWORK')
    If IsArray($aNDrive) Then
    For $i = 1 To $aNDrive[0]
    _ArrayAdd($aFDrive, $aNDrive[$i])
    $aFDrive[0] += 1
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Global $aProgress[$aFDrive[0]], $aName[$aFDrive[0]], $msg = 0, $aVol = 0, $aProzent[$aFDrive[0]], $aGB[$aFDrive[0]]
    Global $GUI = GUICreate('SpaceBar v 2.0', 340, 8 + $aFDrive[0] * 50, @DesktopWidth - 340, 27, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    Global $Colors = _Gradient(0x00CC00,0x00FF00, $aFDrive[0])
    Global $hider = GUICtrlCreateLabel(":: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::",0,0,5,10 + $aFDrive[0] * 50)
    For $i = 0 To $aFDrive[0] - 1
    $aProgress[$i] = GUICtrlCreateProgress(10, 8 + $i * 50, 230, 20,1)
    GUICtrlSetBkColor(-1,0xDD0000)
    GUICtrlSetColor(-1,$Colors[$i])
    $aProzent[$i] = GUICtrlCreateLabel("", 250, 8 + $i * 50,70,20,$ES_RIGHT,$GUI_WS_EX_PARENTDRAG)
    GUICtrlSetFont(-1,10,700,0,"Arial")
    $aGB[$i] = GUICtrlCreateLabel("", 250, 30 + $i * 50,70,20,$ES_RIGHT,$GUI_WS_EX_PARENTDRAG)
    GUICtrlSetFont(-1,10,500,0,"Arial")
    ;Func _ProgressCreate($x, $y,$w = 204, $h = 24,$Col=0xFFFF00,$BG=0xAAAA00,$GradCol=0x00FF00,$GradBG=0xFF0000)
    $aName[$i] = GUICtrlCreateInput('', 10, 30 + $i * 50, 230, 21, $ES_READONLY)
    Next
    Dim $aContext = GUICtrlCreateLabel(" ",250,10,230,-2 + $aFDrive[0] * 50,-1,$GUI_WS_EX_PARENTDRAG) ;Label for ContextMenu over the otherLabels
    GUICtrlSetState($aContext,$GUI_ONTOP)
    GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
    Global $trackmenu = GUICtrlCreateContextMenu($aContext)
    Global $aboutitem = GUICtrlCreateMenuItem('About', $trackmenu)
    GUICtrlCreateMenuItem('', $trackmenu)
    Global $exititem = GUICtrlCreateMenuItem('Exit', $trackmenu)
    Dim $aExit = GUICtrlCreateLabel("X",330,0,10,10,$ES_CENTER) ; Label als Exit-Button
    GUICtrlSetBkColor(-1,0xDD0000)
    GUICtrlSetColor(-1,0xFFFFFF)
    GUICtrlSetFont(-1,-1,600)
    GUIRegisterMsg($WM_RBUTTONDOWN, "_RightClick") ; Funktion, um das KontextMenu des Labels auch von der Gui aus aufzurufen
    GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove") ; Funktion, um das Fenster zu bewegen
    GUIRegisterMsg($WM_ENTERSIZEMOVE, "On_WM_ENTERSIZEMOVE") ; Docking
    GUIRegisterMsg($WM_MOVING, "On_WM_MOVING") ; Docking
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _Update()
    AdlibEnable('_Update', 10000) ; Empfehlung AdlibEnable('_Update', 300000) = 5min
    Dim $hidden = 0
    While 1
    $msg = GUIGetMsg()
    If $msg = $exititem Or $msg = -3 Or $msg = -1 Or $msg = $aExit Then Exit (0)
    If $msg = $hider Then
    If $hidden Then
    WinMove($gui,"",@DesktopWidth-340,Default)
    Else
    WinMove($gui,"",@DesktopWidth-5,Default)
    EndIf
    $hidden = Not $hidden
    EndIf
    If $msg = $aboutitem Then MsgBox(64, 'About', 'SpaceBar v 2.0.0.0 Build 2007-12-23 ' & @CRLF & '' & @CRLF & 'Copyright by :' & @CRLF & 'Ritzelrocker04, Oscar, Xenobiologist ' & @CRLF & 'Thx an das http://www.Autoit.de Team ')
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    For $i = 0 To $aFDrive[0] - 1
    $aVol = _DriveFree($aFDrive[$i + 1])
    ;_GuiCtrlOCXProgressSetValue($aProgress[$i], $aVol[0])
    GUICtrlSetData($aProzent[$i],StringReplace((100-$aVol[0]),".",",") & "% frei")
    Select
    Case $aVol[0] >= 60
    GUICtrlSetColor($aProzent[$i],0xDD0000)
    Case $aVol[0] < 60 And $aVol[0] > 40
    GUICtrlSetColor($aProzent[$i],0xEE8800)
    Case $aVol[0] <= 40
    GUICtrlSetColor($aProzent[$i],0x00CC00)
    EndSelect
    GUICtrlSetData($aGB[$i],"von " & StringReplace(Round(($aVol[3]/1024),1),".",",") & "GB")
    GUICtrlSetData($aProgress[$i], 100-Number($aVol[0]))
    If @error Then MsgBox(0, $aVol[0], @error)
    GUICtrlSetData($aName[$i], 'Auf ' & $aVol[1] & ' sind ' & $aVol[2] & ' MB frei')

    Next
    EndFunc ;==>_Update

    [/autoit] [autoit][/autoit] [autoit]

    Func _DriveFree($LW)
    Local $TOTAL = DriveSpaceTotal($LW), $FREE = DriveSpaceFree($LW), $aDrive[4] = [(Round(($TOTAL - $FREE) / ($TOTAL / 100), 2)), _
    StringUpper($LW) & ' (' & DriveGetLabel($LW) & ')', _StringAddComma(StringReplace(Round($FREE, 2), '.', ','), '.', ','), $TOTAL]
    Return $aDrive
    EndFunc ;==>_DriveFree

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Moving and Docking
    Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
    EndFunc ;==>_WinMove

    [/autoit] [autoit][/autoit] [autoit]

    ; Author: Xenobiologist (Mega)
    Func On_WM_ENTERSIZEMOVE()
    Local $aMPos = MouseGetPos()
    $x_start = $aMPos[0]
    $y_start = $aMPos[1]
    EndFunc ;==>On_WM_ENTERSIZEMOVE

    [/autoit] [autoit][/autoit] [autoit]

    ; Author: Xenobiologist (Mega)
    Func On_WM_MOVING($hWnd, $Msg, $wParam, $lParam)
    Local $aMPos = MouseGetPos()
    Local $rect = DllStructCreate("long left; long top; long right; long bottom", $lParam)
    Local $left = DllStructGetData($rect, "left")
    Local $top = DllStructGetData($rect, "top")
    Local $right = DllStructGetData($rect, "right")
    Local $bottom = DllStructGetData($rect, "bottom")
    If $left <= $Range And $aMPos[0] < $x_start Then
    DllStructSetData($rect, "left", 0)
    DllStructSetData($rect, "right", $right - $left)
    EndIf
    If $top <= $Range And $aMPos[1] < $y_start Then
    DllStructSetData($rect, "top", 0)
    DllStructSetData($rect, "bottom", $bottom - $top)
    EndIf
    If $right >= (@DesktopWidth - $Range) And $aMPos[0] > $x_start Then
    DllStructSetData($rect, "right", @DesktopWidth)
    DllStructSetData($rect, "left", (@DesktopWidth - $right) + $left)
    EndIf
    If $bottom >= ($taskbarPos[1] - $Range) And $aMPos[1] > $y_start Then
    DllStructSetData($rect, "bottom", $taskbarPos[1])
    DllStructSetData($rect, "top", ($taskbarPos[1] - $bottom) + $top)
    EndIf
    On_WM_ENTERSIZEMOVE()
    EndFunc ;==>On_WM_MOVING
    #endregion
    ;-------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Gradient
    ;===============================================================================
    ;
    ; Function Name: _Gradient($RGB_Color1 ,$RGB_Color2, $Count)
    ; Description:: Returns an Array of Gradient Colors
    ; Parameter(s): $RGB_Color1 : The Start-Color in RGB Hexadecimal
    ; $RGB_Color2 : The End-Color in RGB Hexadecimal
    ; $Count : The number of Colors in the Gradient
    ; Requirement(s):
    ; Return Value(s): An Array with the Colors
    ; Author(s): Prog@ndy
    ;
    ;===============================================================================
    ;

    [/autoit] [autoit][/autoit] [autoit]

    Func _Gradient($RGB_Color1 ,$RGB_Color2, $Count)
    Dim $Color1_R, $Color1_G, $Color1_B, $Color2_R, $Color2_G, $Color2_B, $NeuCol_R, $NeuCol_G, $NeuCol_B

    $Color1_R = BitAND( BitShift($RGB_Color1, 16), 0xff)
    $Color1_G = BitAND( BitShift($RGB_Color1, 8), 0xff)
    $Color1_B = BitAND($RGB_Color1, 0xff)

    $Color2_R = BitAND( BitShift($RGB_Color2, 16), 0xff)
    $Color2_G = BitAND( BitShift($RGB_Color2, 8), 0xff)
    $Color2_B = BitAND($RGB_Color2, 0xff)

    $Count -= 1 ; 0-basiert !
    Dim $arColors[$Count+1], $pos1

    For $i = 0 To $Count
    $pos1 = $Count - $i
    $NeuCol_R = ($Color1_R * $pos1 + $Color2_R * $i) / ($Count)
    $NeuCol_G = ($Color1_G * $pos1 + $Color2_G * $i) / ($Count)
    $NeuCol_B = ($Color1_B * $pos1 + $Color2_B * $i) / ($Count)
    $arColors[$i] = Execute("0x" & Hex($NeuCol_R,2) & Hex($NeuCol_G,2) & Hex($NeuCol_B,2))
    Next
    Return $arColors
    EndFunc
    #endregion
    ;-------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Context Menu Handlers
    Func _RightClick($HWnd, $Command, $wParam, $lParam)
    ShowMenu($hWnd,$trackmenu,$aContext,1)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;Author: MsCreatoR in http://www.autoitscript.com/forum/index.ph…ndpost&p=453350
    ;Modified from Help
    ; Show a menu in a given GUI window which belongs to a given GUI ctrl
    Func ShowMenu($hWnd, $nContextID, $nContextControlID, $iMouse=0)
    Local $hMenu = GUICtrlGetHandle($nContextID)
    Local $iCtrlPos = ControlGetPos($hWnd, "", $nContextControlID)

    Local $X = $iCtrlPos[0]
    Local $Y = $iCtrlPos[1] + $iCtrlPos[3]

    ClientToScreen($hWnd, $X, $Y)

    If $iMouse Then
    $X = MouseGetPos(0)
    $Y = MouseGetPos(1)
    EndIf

    DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $X, "int", $Y, "hwnd", $hWnd, "ptr", 0)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Convert the client (GUI) coordinates to screen (desktop) coordinates
    ;From Help
    Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
    Local $stPoint = DllStructCreate("int;int")

    DllStructSetData($stPoint, 1, $x)
    DllStructSetData($stPoint, 2, $y)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

    $x = DllStructGetData($stPoint, 1)
    $y = DllStructGetData($stPoint, 2)
    ; release Struct not really needed as it is a local
    $stPoint = 0
    EndFunc
    #endregion
    ;-------------------------------------------------------------------

    [/autoit]
    • Offizieller Beitrag


    es wird Zeit, dass du weitermachst. Die Konkurrenz schläft nicht.

    Ich finde, progandy hat uns mit seinem Beitrag glatt in Führung gebracht. :)

    @progandy: Super Beitrag! Deine Änderungen runden das Ganze ab. Klasse gemacht! :thumbup:

    @All: Weiß jemand eine Lösung um das Flackern zu verhindern? Das würde uns den Sieg (gegen das englische Forum) bringen. :D

  • Wir könnten
    a) Direkt mit den Windows-Funktionen zeichnen (Sehr Aufwendeig)
    oder
    b) die Active-X Progressbar verwenden (zusätzliche Dateien)
    Aber das muss ja auch nicht jede Sekunde geupdated werden :)
    /edit:
    c) Nur bei einer Änderung updaten
    Zu c):

    §D-NurÄnderung
    [autoit]

    #NoTrayIcon
    ; by Ritzelrocker04, Xenobiologist and Oscar and Prog@ndy
    Opt('MustDeclareVars', 1)
    ;[Includes]
    #include<Array.au3>
    #include<GUIConstants.au3>
    #include<String.au3>

    [/autoit] [autoit][/autoit] [autoit]

    If Not IsDeclared("Range") Then Const $Range = 100
    If Not IsDeclared("WM_MOVING") Then Const $WM_MOVING = 0x0216
    If Not IsDeclared("WM_ENTERSIZEMOVE") Then Const $WM_ENTERSIZEMOVE = 0x0231
    If Not IsDeclared("WM_LBUTTONDOWN") Then Global Const $WM_LBUTTONDOWN = 0x0201
    If Not IsDeclared("WM_SYSCOMMAND") Then Const $WM_SYSCOMMAND = 0x112
    If Not IsDeclared("WM_RBUTTONDOWN") Then Global Const $WM_RBUTTONDOWN = 0x0204

    [/autoit] [autoit][/autoit] [autoit]

    Global $taskbarPos = WinGetPos("[CLASS:Shell_TrayWnd]"), $x_start, $y_start

    [/autoit] [autoit][/autoit] [autoit]

    Global $aFDrive = DriveGetDrive('FIXED'), $aNDrive = DriveGetDrive('NETWORK')
    If IsArray($aNDrive) Then
    For $i = 1 To $aNDrive[0]
    _ArrayAdd($aFDrive, $aNDrive[$i])
    $aFDrive[0] += 1
    Next
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Global $aProgress[$aFDrive[0]], $aName[$aFDrive[0]], $msg = 0, $aVol = 0, $aProzent[$aFDrive[0]], $aGB[$aFDrive[0]]
    Global $aZwischenspeicher[$aFDrive[0]]
    Global $GUI = GUICreate('SpaceBar v 2.0', 340, 8 + $aFDrive[0] * 50, @DesktopWidth - 340, 27, $WS_POPUPWINDOW, $WS_EX_TOPMOST)
    Global $Colors = _Gradient(0x00CC00,0x00FF00, $aFDrive[0]*2)
    Global $hider = GUICtrlCreateLabel(":: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: :: ::",0,0,5,10 + $aFDrive[0] * 50)
    Dim $k = 0
    For $i = 0 To $aFDrive[0] - 1
    $aProgress[$i] = _ProgressCreate(10, 8 + $i * 50, 230, 20,$Colors[$k],-1,$Colors[$k+1])
    $aProzent[$i] = GUICtrlCreateLabel("", 250, 8 + $i * 50,70,20,$ES_RIGHT,$GUI_WS_EX_PARENTDRAG)
    GUICtrlSetFont(-1,10,700,0,"Arial")
    $aGB[$i] = GUICtrlCreateLabel("", 250, 30 + $i * 50,70,20,$ES_RIGHT,$GUI_WS_EX_PARENTDRAG)
    GUICtrlSetFont(-1,10,500,0,"Arial")
    $k+=2
    ;Func _ProgressCreate($x, $y,$w = 204, $h = 24,$Col=0xFFFF00,$BG=0xAAAA00,$GradCol=0x00FF00,$GradBG=0xFF0000)
    $aName[$i] = GUICtrlCreateInput('', 10, 30 + $i * 50, 230, 21, $ES_READONLY)
    Next
    Dim $aContext = GUICtrlCreateLabel(" ",250,10,230,-2 + $aFDrive[0] * 50,-1,$GUI_WS_EX_PARENTDRAG) ;Label for ContextMenu over the otherLabels
    GUICtrlSetState($aContext,$GUI_ONTOP)
    GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
    Global $trackmenu = GUICtrlCreateContextMenu($aContext)
    Global $aboutitem = GUICtrlCreateMenuItem('About', $trackmenu)
    GUICtrlCreateMenuItem('', $trackmenu)
    Global $exititem = GUICtrlCreateMenuItem('Exit', $trackmenu)
    Dim $aExit = GUICtrlCreateLabel("X",330,0,10,10,$ES_CENTER) ; Label als Exit-Button
    GUICtrlSetBkColor(-1,0xDD0000)
    GUICtrlSetColor(-1,0xFFFFFF)
    GUICtrlSetFont(-1,-1,600)
    GUIRegisterMsg($WM_RBUTTONDOWN, "_RightClick") ; Funktion, um das KontextMenu des Labels auch von der Gui aus aufzurufen
    GUIRegisterMsg($WM_LBUTTONDOWN, "_WinMove") ; Funktion, um das Fenster zu bewegen
    GUIRegisterMsg($WM_ENTERSIZEMOVE, "On_WM_ENTERSIZEMOVE") ; Docking
    GUIRegisterMsg($WM_MOVING, "On_WM_MOVING") ; Docking
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    _Update()
    AdlibEnable('_Update', 4000) ; Empfehlung AdlibEnable('_Update', 300000) = 5min
    Dim $hidden = 0
    While 1
    $msg = GUIGetMsg()
    If $msg = $exititem Or $msg = -3 Or $msg = -1 Or $msg = $aExit Then Exit (0)
    If $msg = $hider Then
    If $hidden Then
    WinMove($gui,"",@DesktopWidth-340,Default)
    Else
    WinMove($gui,"",@DesktopWidth-5,Default)
    EndIf
    $hidden = Not $hidden
    EndIf
    If $msg = $aboutitem Then MsgBox(64, 'About', 'SpaceBar v 2.1.0.0 Build 2007-12-23 ' & @CRLF & '' & @CRLF & 'Copyright by :' & @CRLF & 'Ritzelrocker04, Oscar, Xenobiologist, Prog@ndy ' & @CRLF & 'Thx an das http://www.Autoit.de Team ')
    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Func _Update()
    For $i = 0 To $aFDrive[0] - 1
    $aVol = _DriveFree($aFDrive[$i + 1])
    If $aZwischenspeicher[$i] = $aVol[2] Then ContinueLoop
    $aZwischenspeicher[$i] = $aVol[2]
    ;_GuiCtrlOCXProgressSetValue($aProgress[$i], $aVol[0])
    GUICtrlSetData($aProzent[$i],StringReplace((100-$aVol[0]),".",",") & "% frei")
    Select
    Case $aVol[0] >= 60
    GUICtrlSetColor($aProzent[$i],0xDD0000)
    Case $aVol[0] < 60 And $aVol[0] > 40
    GUICtrlSetColor($aProzent[$i],0xEE8800)
    Case $aVol[0] <= 40
    GUICtrlSetColor($aProzent[$i],0x00CC00)
    EndSelect
    GUICtrlSetData($aGB[$i],"von " & StringReplace(Round(($aVol[3]/1024),1),".",",") & "GB")
    _ProgressSet($aProgress[$i], 100-Number($aVol[0]))
    If @error Then MsgBox(0, $aVol[0], @error)
    GUICtrlSetData($aName[$i], 'Auf ' & $aVol[1] & ' sind ' & $aVol[2] & ' MB frei')

    Next
    EndFunc ;==>_Update

    [/autoit] [autoit][/autoit] [autoit]

    Func _DriveFree($LW)
    Local $TOTAL = DriveSpaceTotal($LW), $FREE = DriveSpaceFree($LW), $aDrive[4] = [(Round(($TOTAL - $FREE) / ($TOTAL / 100), 2)), _
    StringUpper($LW) & ' (' & DriveGetLabel($LW) & ')', _StringAddComma(StringReplace(Round($FREE, 2), '.', ','), '.', ','), $TOTAL]
    Return $aDrive
    EndFunc ;==>_DriveFree

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Moving and Docking
    Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
    EndFunc ;==>_WinMove

    [/autoit] [autoit][/autoit] [autoit]

    ; Author: Xenobiologist (Mega)
    Func On_WM_ENTERSIZEMOVE()
    Local $aMPos = MouseGetPos()
    $x_start = $aMPos[0]
    $y_start = $aMPos[1]
    EndFunc ;==>On_WM_ENTERSIZEMOVE

    [/autoit] [autoit][/autoit] [autoit]

    ; Author: Xenobiologist (Mega)
    Func On_WM_MOVING($hWnd, $Msg, $wParam, $lParam)
    Local $aMPos = MouseGetPos()
    Local $rect = DllStructCreate("long left; long top; long right; long bottom", $lParam)
    Local $left = DllStructGetData($rect, "left")
    Local $top = DllStructGetData($rect, "top")
    Local $right = DllStructGetData($rect, "right")
    Local $bottom = DllStructGetData($rect, "bottom")
    If $left <= $Range And $aMPos[0] < $x_start Then
    DllStructSetData($rect, "left", 0)
    DllStructSetData($rect, "right", $right - $left)
    EndIf
    If $top <= $Range And $aMPos[1] < $y_start Then
    DllStructSetData($rect, "top", 0)
    DllStructSetData($rect, "bottom", $bottom - $top)
    EndIf
    If $right >= (@DesktopWidth - $Range) And $aMPos[0] > $x_start Then
    DllStructSetData($rect, "right", @DesktopWidth)
    DllStructSetData($rect, "left", (@DesktopWidth - $right) + $left)
    EndIf
    If $bottom >= ($taskbarPos[1] - $Range) And $aMPos[1] > $y_start Then
    DllStructSetData($rect, "bottom", $taskbarPos[1])
    DllStructSetData($rect, "top", ($taskbarPos[1] - $bottom) + $top)
    EndIf
    On_WM_ENTERSIZEMOVE()
    EndFunc ;==>On_WM_MOVING
    #endregion
    ;-------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Gradient
    ;===============================================================================
    ;
    ; Function Name: _Gradient($RGB_Color1 ,$RGB_Color2, $Count)
    ; Description:: Returns an Array of Gradient Colors
    ; Parameter(s): $RGB_Color1 : The Start-Color in RGB Hexadecimal
    ; $RGB_Color2 : The End-Color in RGB Hexadecimal
    ; $Count : The number of Colors in the Gradient
    ; Requirement(s):
    ; Return Value(s): An Array with the Colors
    ; Author(s): Prog@ndy
    ;
    ;===============================================================================
    ;

    [/autoit] [autoit][/autoit] [autoit]

    Func _Gradient($RGB_Color1 ,$RGB_Color2, $Count)
    Dim $Color1_R, $Color1_G, $Color1_B, $Color2_R, $Color2_G, $Color2_B, $NeuCol_R, $NeuCol_G, $NeuCol_B

    $Color1_R = BitAND( BitShift($RGB_Color1, 16), 0xff)
    $Color1_G = BitAND( BitShift($RGB_Color1, 8), 0xff)
    $Color1_B = BitAND($RGB_Color1, 0xff)

    $Color2_R = BitAND( BitShift($RGB_Color2, 16), 0xff)
    $Color2_G = BitAND( BitShift($RGB_Color2, 8), 0xff)
    $Color2_B = BitAND($RGB_Color2, 0xff)

    $Count -= 1 ; 0-basiert !
    Dim $arColors[$Count+1], $pos1

    For $i = 0 To $Count
    $pos1 = $Count - $i
    $NeuCol_R = ($Color1_R * $pos1 + $Color2_R * $i) / ($Count)
    $NeuCol_G = ($Color1_G * $pos1 + $Color2_G * $i) / ($Count)
    $NeuCol_B = ($Color1_B * $pos1 + $Color2_B * $i) / ($Count)
    $arColors[$i] = Execute("0x" & Hex($NeuCol_R,2) & Hex($NeuCol_G,2) & Hex($NeuCol_B,2))
    Next
    Return $arColors
    EndFunc
    #endregion
    ;-------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Colored Progressbar

    [/autoit] [autoit][/autoit] [autoit]

    ;Hilfsfunktion für doppelten Verlauf
    ; Author(s): Prog@ndy
    Func _ZwischenGrad($RGB_c)
    Local $c_R = BitAND( BitShift($RGB_c, 16), 0xff)
    Local $c_G = BitAND( BitShift($RGB_c, 8), 0xff)
    Local $c_B = BitAND($RGB_c, 0xff)
    $c_R = _MyMax(0,$c_R-99)
    $c_G = _MyMax(0,$c_G-99)
    $c_B = _MyMax(0,$c_B-99)
    Return Dec(Hex($c_R,2) & Hex($c_G,2) & Hex($c_B,2))
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Author(s): Prog@ndy
    Func _ProgressCreate($x, $y,$w = 204, $h = 24,$Col=0xFFFF00,$BG=0xAAAA00,$GradCol=0x00FF00,$GradBG=0xFF0000)
    Local $ID[8]
    $ID[0] = GUICtrlCreateGraphic($x,$y,$w,$h)
    Local $error = @error
    Local $extended = @extended
    $ID[1] = $w
    $ID[2] = $h
    If $Col = -1 Then $Col=0xFFFF00
    If $BG = -1 Then $BG=0xAAAA00
    If $GradCol = -1 Then $GradCol=0x00FF00
    If $GradBG = -1 Then $GradBG=0xFF0000
    $ID[3] = $Col
    $ID[4] = $BG
    $ID[5] = $GradCol
    $ID[6] = $GradBG
    _ProgressSet($ID,0)
    Return SetError($error,$extended,$ID)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Author(s): Prog@ndy
    Func _ProgressDelete(ByRef $ID)
    If Not IsArray($ID) Or UBound($ID) <> 8 Then Return SetError(1,0,0)
    $ID[1] = -1
    $ID[2] = -1
    $ID[3] = -1
    $ID[4] = -1
    $ID[5] = -1
    $ID[6] = -1
    $ID[7] = -1
    Dim $temp = GUICtrlDelete($ID[0])
    Return SetError(@error,0,$temp)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Author(s): Prog@ndy
    Func _ProgressSetColors(ByRef $ID,$Col,$BG=-1,$GradCol=-1,$GradBG=-1)
    If Not IsArray($ID) Or UBound($ID) <> 8 Then Return SetError(1,0,0)
    $ID[3] = $Col
    If $BG <> -1 Then $ID[4] = $BG
    If $GradCol <> -1 Then $ID[5] = $GradCol
    If $GradBG <> -1 Then $ID[6] = $GradBG
    MsgBox(0,$ID[6],$ID[7])
    _ProgressSet($ID,$ID[7])
    Return SetError(@error,0,@error)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Author(s): Prog@ndy
    Func _ProgressSet(ByRef $ID, $value)
    Local $Wechsel = Round((9/20)*$ID[2]-4)
    Local $Hoehe = $ID[2]-4
    Local $Breite = $ID[1]-4

    [/autoit] [autoit][/autoit] [autoit]


    If $value <= $ID[7] Then
    GUICtrlSetBkColor($ID[0],0xAAAAAA)
    GUICtrlSetColor($ID[0],0x777777)
    $ID[7] = $value
    Local $temp = _ZwischenGrad($ID[6])
    Local $Gradient = _Gradient($ID[4],$temp, $Wechsel)
    Local $Gradient2 = _Gradient($temp,$ID[6], $Hoehe-$Wechsel)
    For $i = 2 To $Wechsel+1
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,$Gradient[$i-2])
    GUICtrlSetGraphic($ID[0],$GUI_GR_RECT, 2,$i,$Breite,1)
    Next
    For $i = $Wechsel+2 To $Hoehe+1
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,$Gradient2[$i-$Wechsel-2])
    GUICtrlSetGraphic($ID[0],$GUI_GR_RECT, 2,$i,$Breite,1)
    Next
    Local $start = 2
    Else
    Local $start = $ID[7]+2
    $ID[7] = $value
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    Local $Faktor = $Breite/100
    $value *= $Faktor
    If Round($value) >= $Breite Then $value = $Breite
    Local $temp = _ZwischenGrad($ID[5])
    Local $Gradient = _Gradient($ID[3],$temp, $Wechsel)
    Local $Gradient2 = _Gradient($temp,$ID[5], $Hoehe-$Wechsel)
    ;Local $Gradient = _Gradient(0xFFFF00,0x00AA00, $Wechsel)
    ;Local $Gradient2 = _Gradient(0x00AA00,0x00FF00, $Hoehe-$Wechsel)
    For $i = 2 To $Wechsel+1
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,$Gradient[$i-2])
    GUICtrlSetGraphic($ID[0],$GUI_GR_RECT, $start,$i,$value-$start+2,1)
    Next
    For $i = $Wechsel+2 To $Hoehe+1
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,$Gradient2[$i-$Wechsel-2])
    GUICtrlSetGraphic($ID[0],$GUI_GR_RECT, $start,$i,$value-$start+2,1)
    Next

    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,0xCCCCCC)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, 2,2)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, 2,$Hoehe+1);19)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, $Breite+1,2)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, $Breite+1,$Hoehe+1)
    GUICtrlSetGraphic($ID[0],$GUI_GR_COLOR,0xEEEEEE)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, 0,$Hoehe+3)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, 0,0)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, $Breite+3,$Hoehe+3)
    GUICtrlSetGraphic($ID[0],$GUI_GR_PIXEL, $Breite+3,0)

    [/autoit] [autoit][/autoit] [autoit]

    GUICtrlSetGraphic($ID[0],$GUI_GR_REFRESH)

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Original _Max() Function, directly included
    ; Author(s): Jeremy Landes <jlandes at landeserve dot com>
    Func _MyMax($nNum1, $nNum2)
    ; Check to see if the parameters are indeed numbers of some sort.
    If (Not IsNumber($nNum1)) Then
    SetError(1)
    Return (0)
    EndIf
    If (Not IsNumber($nNum2)) Then
    SetError(2)
    Return (0)
    EndIf

    If $nNum1 > $nNum2 Then
    Return $nNum1
    Else
    Return $nNum2
    EndIf
    EndFunc ;==>_Max

    [/autoit] [autoit][/autoit] [autoit]

    #endregion
    ;-------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;-------------------------------------------------------------------
    #region Context Menu Handlers
    Func _RightClick($HWnd, $Command, $wParam, $lParam)
    ShowMenu($hWnd,$trackmenu,$aContext,1)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;Author: MsCreatoR in http://www.autoitscript.com/forum/index.ph…ndpost&p=453350
    ;Modified from Help
    ; Show a menu in a given GUI window which belongs to a given GUI ctrl
    Func ShowMenu($hWnd, $nContextID, $nContextControlID, $iMouse=0)
    Local $hMenu = GUICtrlGetHandle($nContextID)
    Local $iCtrlPos = ControlGetPos($hWnd, "", $nContextControlID)

    Local $X = $iCtrlPos[0]
    Local $Y = $iCtrlPos[1] + $iCtrlPos[3]

    ClientToScreen($hWnd, $X, $Y)

    If $iMouse Then
    $X = MouseGetPos(0)
    $Y = MouseGetPos(1)
    EndIf

    DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $X, "int", $Y, "hwnd", $hWnd, "ptr", 0)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ; Convert the client (GUI) coordinates to screen (desktop) coordinates
    ;From Help
    Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
    Local $stPoint = DllStructCreate("int;int")

    DllStructSetData($stPoint, 1, $x)
    DllStructSetData($stPoint, 2, $y)

    [/autoit] [autoit][/autoit] [autoit]

    DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))

    $x = DllStructGetData($stPoint, 1)
    $y = DllStructGetData($stPoint, 2)
    ; release Struct not really needed as it is a local
    $stPoint = 0
    EndFunc
    #endregion
    ;-------------------------------------------------------------------

    [/autoit]

    //Edit: Hab mich mal in die About-Box eingefügt und die Version auf 2.1.00 geändert

    3 Mal editiert, zuletzt von progandy (27. Dezember 2007 um 18:14)

  • Hi,

    die Familien-Tage habe ich gut verlebt, was ich auch von Euch hoffe ?

    (A)linas lauffähige Script-Variante ist die Funktion der möglichen GUI-Verschiebung abgängig.
    Xeno verweist auf das en. Forum und JamesB hat einen guten Job gemacht, den er inzwischen ergänzt hat.

    Progandy hat im zweiten Anlauf wirklich erstaunliches vollbracht, beide (2D und 3D) Fortschrittsbalken können sich sehen lassen. :thumbup: Der 3D-Balken scheint bei mir aber noch etwas instabil / volatil ?

    Auch Oscar hat sich wieder eingefunden und ich freue mich über das Interesse und die Resonanz für dieses Thema.

    Schöne Feiertage und Respekt
    Man liest sich...
    Euer Ritzelrocker04