Old-Style programmieren

  • Nur mal aus Interesse.
    Ich hab mir eine GUI mit 2000er-Style erstellt.
    Habt ihr Vorschläge wie man das verbessern kann? So dass zum Beispiel das Icon in der Titelleiste transparent wird, oder dass die Buttons zum Schliesen nicht markiert werden können, oder dass das Maximieren (Resizing) richtig funktioniert.

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Global $title = "Funkey's Old-Style-Gui"

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

    Opt("GUIOnEventMode", 1)
    ;~ GUICreate($title, 400, 600, -1, -1, BitOR(-1, $WS_DLGFRAME)) ;zum Vergleich mit 2. Titelleiste
    GUICreate($title, 400, 600, -1, -1, BitOR($WS_POPUP, $WS_DLGFRAME)) ;ohne Original-Titelleiste
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    GUICtrlCreateIcon("shell32.dll", 42, 2, 2, 16, 16, 0x0200)

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

    GUICtrlCreateButton('0', 348, 2, 16, 16, 0x0800)
    GUICtrlSetOnEvent(-1, '_Minimize')
    GUICtrlSetTip(-1, 'Minimieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    GUICtrlCreateButton('1', 364, 2, 16, 16, 0x0800) ;
    GUICtrlSetOnEvent(-1, '_Maximize')
    GUICtrlSetTip(-1, 'Maximieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
    GUICtrlSetState(-1, $GUI_DISABLE)

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

    GUICtrlCreateButton('r', 382, 2, 16, 16, 0x0800) ; x
    GUICtrlSetOnEvent(-1, '_Exit')
    GUICtrlSetTip(-1, 'Schließen')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    GUICtrlCreateLabel(" " & $title, 0, 0, 400, 20, 0x4000200, 0x00100000)
    GUICtrlSetBkColor(-1, 0x08246B)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetFont(-1, -1, 553)

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

    GUISetState()

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

    While 1
    Sleep(10000)
    WEnd

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

    Func _Minimize()
    GUISetState(@SW_MINIMIZE)
    EndFunc ;==>_Minimize

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

    Func _Maximize()
    GUISetState(@SW_MAXIMIZE)
    EndFunc ;==>_Maximize

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

    [/autoit]
  • Ist dir das nicht 2000-style genug? EIne Zeile an den Anfang vom Skript:

    [autoit]

    DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", 0)

    [/autoit]
  • Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Global $title = "Funkey's Old-Style-Gui"

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

    Opt("GUIOnEventMode", 1)
    ;~ GUICreate($title, 400, 600, -1, -1, BitOR(-1, $WS_DLGFRAME)) ;zum Vergleich mit 2. Titelleiste
    GUICreate($title, 400, 600, -1, -1, BitOR($WS_POPUP, $WS_DLGFRAME)) ;ohne Original-Titelleiste
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    GUICtrlCreateIcon("shell32.dll", 42, 2, 2, 16, 16, 0x0200)

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

    GUICtrlCreateButton('0', 348, 2, 16, 16, 0x0800)
    GUICtrlSetResizing ( -1,256+512+4)
    GUICtrlSetOnEvent(-1, '_Minimize')
    GUICtrlSetTip(-1, 'Minimieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    GUICtrlCreateButton('1', 364, 2, 16, 16, 0x0800) ;
    GUICtrlSetResizing ( -1,256+512+4)
    GUICtrlSetOnEvent(-1, '_Maximize')
    GUICtrlSetTip(-1, 'Maximieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
    ;~ GUICtrlSetState(-1, $GUI_DISABLE)

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

    GUICtrlCreateButton('r', 382, 2, 16, 16, 0x0800) ; x
    GUICtrlSetResizing ( -1,256+512+4)
    GUICtrlSetOnEvent(-1, '_Exit')
    GUICtrlSetTip(-1, 'Schließen')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    GUICtrlCreateLabel(" " & $title, 0, 0, 400, 20, 0x4000200, 0x00100000)
    GUICtrlSetResizing ( -1, 512)
    GUICtrlSetBkColor(-1, 0x08246B)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetFont(-1, -1, 553)

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

    GUISetState()

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

    While 1
    Sleep(10000)
    WEnd

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

    Func _Minimize()
    GUISetState(@SW_MINIMIZE)
    EndFunc ;==>_Minimize

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

    Func _Maximize()
    GUISetState(@SW_MAXIMIZE)
    EndFunc ;==>_Maximize

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    mfg. Jam00

  • Danke Jam00, damit stimmt das Resizing für die Buttons schon mal. Den Button-Text müsste man dann noch umschalten auf das Maximiert-Symbol. Beim Titel stimmts auch noch nicht ganz.

    @progandy:
    1. Das sieht ganz bestimmt nicht wie richtiges 2000-Feeling aus
    2. Es geht mir ums Prinzip
    3. Das kenne ich natürlich schon ziemlich lange

  • Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Global $title = "Funkey's Old-Style-Gui"

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

    Opt("GUIOnEventMode", 1)
    ;~ GUICreate($title, 400, 600, -1, -1, BitOR(-1, $WS_DLGFRAME)) ;zum Vergleich mit 2. Titelleiste
    GUICreate($title, 400, 600, -1, -1, BitOR($WS_POPUP, $WS_DLGFRAME)) ;ohne Original-Titelleiste
    GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")

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

    GUICtrlCreateIcon("shell32.dll", 42, 2, 2, 16, 16, 0x0200)
    GUICtrlSetResizing ( -1,256+512+2)

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

    GUICtrlCreateButton('0', 348, 2, 16, 16, 0x0800)
    GUICtrlSetResizing ( -1,256+512+4)
    GUICtrlSetOnEvent(-1, '_Minimize')
    GUICtrlSetTip(-1, 'Minimieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    $Maxi = GUICtrlCreateButton('1', 364, 2, 16, 16, 0x0800) ;
    GUICtrlSetResizing ( -1,256+512+4)
    GUICtrlSetOnEvent(-1, '_Maximize')
    GUICtrlSetTip(-1, 'Maximieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
    ;~ GUICtrlSetState(-1, $GUI_DISABLE)

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

    GUICtrlCreateButton('r', 382, 2, 16, 16, 0x0800) ; x
    GUICtrlSetResizing ( -1,256+512+4)
    GUICtrlSetOnEvent(-1, '_Exit')
    GUICtrlSetTip(-1, 'Schließen')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    GUICtrlCreateLabel(" " & $title, 0, 0, 400, 20, 0x4000200, 0x00100000)
    GUICtrlSetResizing ( -1, 512)
    GUICtrlSetBkColor(-1, 0x08246B)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetFont(-1, -1, 553)

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

    GUISetState()
    $Max = False
    While 1
    Sleep(10000)
    WEnd

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

    Func _Minimize()
    GUISetState(@SW_MINIMIZE)
    EndFunc ;==>_Minimize

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

    Func _Maximize()
    If $Max = False Then
    GUISetState(@SW_MAXIMIZE)
    GUICtrlSetData ($Maxi,"_")
    $Max = True
    Else
    $Max = False
    GUISetState(@SW_RESTORE)
    GUICtrlSetData ($Maxi,"1")
    EndIf
    EndFunc ;==>_Maximize

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    mfg. Jam00

  • So weit bin ich bis jetzt. Für das Icon hab ich noch keine Lösung gefunden.

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_Res_Description=Eigene veränderliche Titelleiste
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
    #AutoIt3Wrapper_Res_LegalCopyright=funkey
    #AutoIt3Wrapper_Res_Language=3079
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <ButtonConstants.au3>
    #include <Color.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Opt('PixelCoordMode', 0)
    Opt("GUIOnEventMode", 1)

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

    Const $WS_EX_COMPOSITED = 0x2000000
    Global $title = "Hallo Autoit.de ;-)"
    Global $hGui = GUICreate($title, 400, 500, -1, -1, BitOR($WS_POPUP, $WS_DLGFRAME, $WS_SIZEBOX), $WS_EX_COMPOSITED)
    ;~ GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    ;~ GUISetOnEvent($GUI_EVENT_RESTORE, "_Restore")

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

    GUISetIcon("shell32.dll", 42)
    GUICtrlCreateIcon("shell32.dll", 42, 2, 2, 16, 16, 0x0300)
    GUICtrlSetResizing ( -1,256+512+32+2)

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

    Global $Btn_Min = GUICtrlCreateButton('0', 348, 3, 16, 15) ; _
    ;~ GUICtrlSetOnEvent(-1, '_Minimize')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Minimieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Btn_Max = GUICtrlCreateButton('1', 364, 3, 16, 15) ;
    ;~ GUICtrlSetOnEvent(-1, '_Maximize')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Maximieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Btn_Restore = GUICtrlCreateButton('2', 364, 3, 16, 15) ;
    ;~ GUICtrlSetOnEvent(-1, '_Restore')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Verkleinern')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
    GUICtrlSetState(-1, $GUI_HIDE)

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

    Global $Btn_Close = GUICtrlCreateButton('r', 382, 3, 16, 15) ; x
    ;~ GUICtrlSetOnEvent(-1, '_Exit')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Schließen')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Lbl_Caption = GUICtrlCreateLabel(" " & $title, 0, 0, 400, 20, 0x4000200, 0x00100020)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetResizing(-1, 512)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetFont(-1, 9, 551, 0);, 'MS Sans Serif')

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

    Global $hChild = GUICreate('Child', 3200, 20, 0, 0, $WS_CHILD, -1, $hGui)
    Global $Ctrl_Grafik = _CreateColorTransition(0, 0, 3200, 20, 0xFF0000, 0x0B6295, 1, 4)
    GUISetState()
    GUISwitch($hGui)

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

    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

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

    GUISetState()

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

    AdlibEnable('_RotateCaption', 350)

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

    While 1
    Sleep(20000)
    WEnd

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

    Func _RotateCaption()
    Local $aPosC = WinGetPos($hChild), $aPosG = WinGetPos($hGui)
    If $aPosC[0] - $aPosG[0] <= -1600 Then
    WinMove($hChild, '', -20, 0)
    Else
    WinMove($hChild, '', $aPosC[0] - $aPosG[0] - 20, 0)
    EndIf
    EndFunc ;==>_RotateCaption

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

    Func _Minimize()
    GUISetState(@SW_MINIMIZE)
    EndFunc ;==>_Minimize

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

    Func _Maximize()
    GUISetState(@SW_MAXIMIZE)
    GUICtrlSetState($Btn_Max, $GUI_HIDE)
    GUICtrlSetState($Btn_Restore, $GUI_SHOW)
    EndFunc ;==>_Maximize

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

    Func _Restore()
    GUISetState(@SW_RESTORE)
    GUICtrlSetState($Btn_Restore, $GUI_HIDE)
    GUICtrlSetState($Btn_Max, $GUI_SHOW)
    EndFunc ;==>_Restore

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

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

    Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $nNotifyCode = BitShift($wParam, 16)
    Local $nID = BitAND($wParam, 0x0000FFFF)
    Local $hCtrl = $lParam
    Switch $nID
    Case $Btn_Min
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Minimize()
    EndIf
    Case $Btn_Max
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Maximize()
    EndIf
    Case $Btn_Restore
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Restore()
    EndIf
    Case $Btn_Close
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Exit()
    EndIf
    EndSwitch
    EndFunc ;==>WM_COMMAND

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

    Func _CreateColorTransition($iPosx, $iPosy, $iWidth, $iHeight, $nColorStart, $nColorEnd, $iAlignment = 0, $iWaveFaktor = 1)
    ; funkey
    Local $startRot, $startGruen, $startBlau, $endRot, $endGruen, $endBlau, $Color
    Local $ColorOffsetRot, $ColorOffsetGruen, $ColorOffsetBlau, $Grafik
    $startRot = _ColorGetRed($nColorStart)
    $startGruen = _ColorGetGreen($nColorStart)
    $startBlau = _ColorGetBlue($nColorStart)
    $endRot = _ColorGetRed($nColorEnd)
    $endGruen = _ColorGetGreen($nColorEnd)
    $endBlau = _ColorGetBlue($nColorEnd)
    $Grafik = GUICtrlCreateGraphic($iPosx, $iPosy, $iWidth, $iHeight, 0)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $iHeight += $iWaveFaktor - Mod($iHeight, $iWaveFaktor)
    Switch $iAlignment
    Case 0
    $ColorOffsetRot = ($endRot - $startRot) / ($iHeight / $iWaveFaktor)
    $ColorOffsetGruen = ($endGruen - $startGruen) / ($iHeight / $iWaveFaktor)
    $ColorOffsetBlau = ($endBlau - $startBlau) / ($iHeight / $iWaveFaktor)
    Switch Mod($iWaveFaktor, 2)
    Case 0
    For $w = 1 To $iWaveFaktor - 1 Step 2
    For $i = ($w - 1) * ($iHeight / $iWaveFaktor) To ($w) * ($iHeight / $iWaveFaktor) - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    For $i = $w * ($iHeight / $iWaveFaktor) To ($w + 1) * ($iHeight / $iWaveFaktor) - 1
    $Color = '0x' & Hex($endRot - $ColorOffsetRot * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2) & _
    Hex($endGruen - $ColorOffsetGruen * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2) & _
    Hex($endBlau - $ColorOffsetBlau * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    Next
    Case 1
    For $i = 0 To $iHeight - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    EndSwitch
    Case Else
    $ColorOffsetRot = ($endRot - $startRot) / ($iWidth / $iWaveFaktor)
    $ColorOffsetGruen = ($endGruen - $startGruen) / ($iWidth / $iWaveFaktor)
    $ColorOffsetBlau = ($endBlau - $startBlau) / ($iWidth / $iWaveFaktor)
    Switch Mod($iWaveFaktor, 2)
    Case 0
    For $w = 1 To $iWaveFaktor - 1 Step 2
    For $i = ($w - 1) * ($iWidth / $iWaveFaktor) To ($w) * ($iWidth / $iWaveFaktor) - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $iHeight)
    Next
    For $i = $w * ($iWidth / $iWaveFaktor) To ($w + 1) * ($iWidth / $iWaveFaktor) - 1
    $Color = '0x' & Hex($endRot - $ColorOffsetRot * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2) & _
    Hex($endGruen - $ColorOffsetGruen * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2) & _
    Hex($endBlau - $ColorOffsetBlau * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $iHeight)
    Next
    Next
    Case 1
    For $i = 0 To $iHeight - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    EndSwitch
    EndSwitch
    Return $Grafik
    EndFunc ;==>_CreateColorTransition

    [/autoit]
  • Kann man ein Doppelklick-Event auf ein Label abfangen? Oder gibt es da einen Workaround?

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_Res_Description=Eigene veränderliche Titelleiste
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
    #AutoIt3Wrapper_Res_LegalCopyright=funkey
    #AutoIt3Wrapper_Res_Language=3079
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <Color.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>

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

    Opt("GUIOnEventMode", 1)

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

    Const $WS_EX_COMPOSITED = 0x2000000
    Global $title = "Hallo Autoit.de ;-)"
    Global $hGui = GUICreate($title, 400, 500, -1, -1, BitOR($WS_POPUP, $WS_DLGFRAME, $WS_SIZEBOX), $WS_EX_COMPOSITED)
    ;~ GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    ;~ GUISetOnEvent($GUI_EVENT_RESTORE, "_Restore")

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

    GUISetIcon("shell32.dll", 42)
    GUICtrlCreateIcon("shell32.dll", 42, 2, 2, 16, 16, 0x0300)
    GUICtrlSetResizing ( -1,256+512+32+2)

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

    Global $Btn_Min = GUICtrlCreateButton('0', 348, 3, 16, 15) ; _
    ;~ GUICtrlSetOnEvent(-1, '_Minimize')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Minimieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Btn_Max = GUICtrlCreateButton('1', 364, 3, 16, 15) ;
    ;~ GUICtrlSetOnEvent(-1, '_Maximize')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Maximieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Btn_Restore = GUICtrlCreateButton('2', 364, 3, 16, 15) ;
    ;~ GUICtrlSetOnEvent(-1, '_Restore')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Verkleinern')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
    GUICtrlSetState(-1, $GUI_HIDE)

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

    Global $Btn_Close = GUICtrlCreateButton('r', 382, 3, 16, 15) ; x
    ;~ GUICtrlSetOnEvent(-1, '_Exit')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Schließen')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Lbl_Caption = GUICtrlCreateLabel(" " & $title, 0, 0, 400, 20, 0x4000200, 0x00100020)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetResizing(-1, 512)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetFont(-1, 9, 551, 0);, 'MS Sans Serif')

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

    Global $hChild = GUICreate('Child', 3200, 20, 0, 0, $WS_CHILD, -1, $hGui)
    Global $Ctrl_Grafik = _CreateColorTransition(0, 0, 3200, 20, 0xFF0000, 0x0B6295, 1, 4)
    GUISetState()
    GUISwitch($hGui)

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

    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

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

    GUISetState()

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

    AdlibEnable('_RotateCaption', 350)

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

    While 1
    Sleep(20000)
    WEnd

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

    Func _RotateCaption()
    Local $aPosC = WinGetPos($hChild), $aPosG = WinGetPos($hGui)
    If $aPosC[0] - $aPosG[0] <= -1600 Then
    WinMove($hChild, '', -20, 0)
    Else
    WinMove($hChild, '', $aPosC[0] - $aPosG[0] - 20, 0)
    EndIf
    EndFunc ;==>_RotateCaption

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

    Func _Minimize()
    GUISetState(@SW_MINIMIZE)
    EndFunc ;==>_Minimize

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

    Func _Maximize()
    GUISetState(@SW_MAXIMIZE)
    GUICtrlSetState($Btn_Max, $GUI_HIDE)
    GUICtrlSetState($Btn_Restore, $GUI_SHOW)
    EndFunc ;==>_Maximize

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

    Func _Restore()
    GUISetState(@SW_RESTORE)
    GUICtrlSetState($Btn_Restore, $GUI_HIDE)
    GUICtrlSetState($Btn_Max, $GUI_SHOW)
    EndFunc ;==>_Restore

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

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

    Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $nNotifyCode = BitShift($wParam, 16)
    Local $nID = BitAND($wParam, 0x0000FFFF)
    Local $hCtrl = $lParam
    Switch $nID
    Case $Btn_Min
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Minimize()
    EndIf
    Case $Btn_Max
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Maximize()
    EndIf
    Case $Btn_Restore
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Restore()
    EndIf
    Case $Btn_Close
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Exit()
    EndIf
    Case $Lbl_Caption
    MsgBox(262144 + 64,$nNotifyCode,"Das Label wurde geklickt")
    If $nNotifyCode = 5 Then
    _Maximize()
    EndIf
    EndSwitch
    EndFunc ;==>WM_COMMAND

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

    Func _CreateColorTransition($iPosx, $iPosy, $iWidth, $iHeight, $nColorStart, $nColorEnd, $iAlignment = 0, $iWaveFaktor = 1)
    ; funkey
    Local $startRot, $startGruen, $startBlau, $endRot, $endGruen, $endBlau, $Color
    Local $ColorOffsetRot, $ColorOffsetGruen, $ColorOffsetBlau, $Grafik
    $startRot = _ColorGetRed($nColorStart)
    $startGruen = _ColorGetGreen($nColorStart)
    $startBlau = _ColorGetBlue($nColorStart)
    $endRot = _ColorGetRed($nColorEnd)
    $endGruen = _ColorGetGreen($nColorEnd)
    $endBlau = _ColorGetBlue($nColorEnd)
    $Grafik = GUICtrlCreateGraphic($iPosx, $iPosy, $iWidth, $iHeight, 0)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $iHeight += $iWaveFaktor - Mod($iHeight, $iWaveFaktor)
    Switch $iAlignment
    Case 0
    $ColorOffsetRot = ($endRot - $startRot) / ($iHeight / $iWaveFaktor)
    $ColorOffsetGruen = ($endGruen - $startGruen) / ($iHeight / $iWaveFaktor)
    $ColorOffsetBlau = ($endBlau - $startBlau) / ($iHeight / $iWaveFaktor)
    Switch Mod($iWaveFaktor, 2)
    Case 0
    For $w = 1 To $iWaveFaktor - 1 Step 2
    For $i = ($w - 1) * ($iHeight / $iWaveFaktor) To ($w) * ($iHeight / $iWaveFaktor) - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    For $i = $w * ($iHeight / $iWaveFaktor) To ($w + 1) * ($iHeight / $iWaveFaktor) - 1
    $Color = '0x' & Hex($endRot - $ColorOffsetRot * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2) & _
    Hex($endGruen - $ColorOffsetGruen * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2) & _
    Hex($endBlau - $ColorOffsetBlau * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    Next
    Case 1
    For $i = 0 To $iHeight - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    EndSwitch
    Case Else
    $ColorOffsetRot = ($endRot - $startRot) / ($iWidth / $iWaveFaktor)
    $ColorOffsetGruen = ($endGruen - $startGruen) / ($iWidth / $iWaveFaktor)
    $ColorOffsetBlau = ($endBlau - $startBlau) / ($iWidth / $iWaveFaktor)
    Switch Mod($iWaveFaktor, 2)
    Case 0
    For $w = 1 To $iWaveFaktor - 1 Step 2
    For $i = ($w - 1) * ($iWidth / $iWaveFaktor) To ($w) * ($iWidth / $iWaveFaktor) - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $iHeight)
    Next
    For $i = $w * ($iWidth / $iWaveFaktor) To ($w + 1) * ($iWidth / $iWaveFaktor) - 1
    $Color = '0x' & Hex($endRot - $ColorOffsetRot * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2) & _
    Hex($endGruen - $ColorOffsetGruen * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2) & _
    Hex($endBlau - $ColorOffsetBlau * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $iHeight)
    Next
    Next
    Case 1
    For $i = 0 To $iHeight - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    EndSwitch
    EndSwitch
    Return $Grafik
    EndFunc ;==>_CreateColorTransition

    [/autoit]
  • Ich habe es so gemacht:

    Spoiler anzeigen
    [autoit]

    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_Compression=4
    #AutoIt3Wrapper_Res_Description=Eigene veränderliche Titelleiste
    #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
    #AutoIt3Wrapper_Res_LegalCopyright=funkey
    #AutoIt3Wrapper_Res_Language=3079
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    #include <Color.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    Opt("GUIOnEventMode", 1)

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

    Global $start
    Global $n = 0
    Global $MousePos = True
    Global $pos
    Global $clickspeed = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickSpeed")

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

    Const $WS_EX_COMPOSITED = 0x2000000
    Global $title = "Hallo Autoit.de ;-)"
    Global $hGui = GUICreate($title, 400, 500, -1, -1, BitOR($WS_POPUP, $WS_DLGFRAME, $WS_SIZEBOX), $WS_EX_COMPOSITED)
    ;~ GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
    ;~ GUISetOnEvent($GUI_EVENT_RESTORE, "_Restore")
    GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, '_PRIMARYdown')
    GUISetOnEvent($GUI_EVENT_PRIMARYUP, '_PRIMARYup')
    GUISetIcon("shell32.dll", 42)
    GUICtrlCreateIcon("shell32.dll", 42, 2, 2, 16, 16, 0x0300)
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 2)

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

    Global $Btn_Min = GUICtrlCreateButton('0', 348, 3, 16, 15) ; _
    ;~ GUICtrlSetOnEvent(-1, '_Minimize')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Minimieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Btn_Max = GUICtrlCreateButton('1', 364, 3, 16, 15) ;
    ;~ GUICtrlSetOnEvent(-1, '_Maximize')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Maximieren')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Btn_Restore = GUICtrlCreateButton('2', 364, 3, 16, 15) ;
    ;~ GUICtrlSetOnEvent(-1, '_Restore')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Verkleinern')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')
    GUICtrlSetState(-1, $GUI_HIDE)

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

    Global $Btn_Close = GUICtrlCreateButton('r', 382, 3, 16, 15) ; x
    ;~ GUICtrlSetOnEvent(-1, '_Exit')
    GUICtrlSetResizing(-1, 256 + 512 + 32 + 4)
    GUICtrlSetTip(-1, 'Schließen')
    GUICtrlSetFont(-1, 8, 0, 0, 'Marlett')

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

    Global $Lbl_Caption = GUICtrlCreateLabel(" " & $title, 0, 0, 400, 20, 0x4000200, 0x00000020)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetResizing(-1, 512)
    GUICtrlSetColor(-1, 0xFFFFFF)
    GUICtrlSetFont(-1, 9, 551, 0);, 'MS Sans Serif')

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

    Global $hChild = GUICreate('Child', 3200, 20, 0, 0, $WS_CHILD, -1, $hGui)
    Global $Ctrl_Grafik = _CreateColorTransition(0, 0, 3200, 20, 0xFF0000, 0x0B6295, 1, 4)
    GUISetState()
    GUISwitch($hGui)

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

    GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")

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

    GUISetState()

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

    AdlibEnable('_RotateCaption', 350)

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

    While 1
    Sleep(20000)
    WEnd

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

    Func _RotateCaption()
    Local $aPosC = WinGetPos($hChild), $aPosG = WinGetPos($hGui)
    If $aPosC[0] - $aPosG[0] <= -1600 Then
    WinMove($hChild, '', -20, 0)
    Else
    WinMove($hChild, '', $aPosC[0] - $aPosG[0] - 20, 0)
    EndIf
    EndFunc ;==>_RotateCaption

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

    Func _Minimize()
    GUISetState(@SW_MINIMIZE)
    EndFunc ;==>_Minimize

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

    Func _Maximize()
    GUISetState(@SW_MAXIMIZE)
    GUICtrlSetState($Btn_Max, $GUI_HIDE)
    GUICtrlSetState($Btn_Restore, $GUI_SHOW)
    EndFunc ;==>_Maximize

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

    Func _Restore()
    GUISetState(@SW_RESTORE)
    GUICtrlSetState($Btn_Restore, $GUI_HIDE)
    GUICtrlSetState($Btn_Max, $GUI_SHOW)
    EndFunc ;==>_Restore

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

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

    Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
    Local $nNotifyCode = BitShift($wParam, 16)
    Local $nID = BitAND($wParam, 0x0000FFFF)
    Local $hCtrl = $lParam
    Switch $nID
    Case $Btn_Min
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Minimize()
    EndIf
    Case $Btn_Max
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Maximize()
    EndIf
    Case $Btn_Restore
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Restore()
    EndIf
    Case $Btn_Close
    If $nNotifyCode = 0 Then
    GUICtrlSetState($Lbl_Caption, $GUI_FOCUS)
    _Exit()
    EndIf
    EndSwitch
    EndFunc ;==>WM_COMMAND

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

    Func _CreateColorTransition($iPosx, $iPosy, $iWidth, $iHeight, $nColorStart, $nColorEnd, $iAlignment = 0, $iWaveFaktor = 1)
    ; funkey
    Local $startRot, $startGruen, $startBlau, $endRot, $endGruen, $endBlau, $Color
    Local $ColorOffsetRot, $ColorOffsetGruen, $ColorOffsetBlau, $Grafik
    $startRot = _ColorGetRed($nColorStart)
    $startGruen = _ColorGetGreen($nColorStart)
    $startBlau = _ColorGetBlue($nColorStart)
    $endRot = _ColorGetRed($nColorEnd)
    $endGruen = _ColorGetGreen($nColorEnd)
    $endBlau = _ColorGetBlue($nColorEnd)
    $Grafik = GUICtrlCreateGraphic($iPosx, $iPosy, $iWidth, $iHeight, 0)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $iHeight += $iWaveFaktor - Mod($iHeight, $iWaveFaktor)
    Switch $iAlignment
    Case 0
    $ColorOffsetRot = ($endRot - $startRot) / ($iHeight / $iWaveFaktor)
    $ColorOffsetGruen = ($endGruen - $startGruen) / ($iHeight / $iWaveFaktor)
    $ColorOffsetBlau = ($endBlau - $startBlau) / ($iHeight / $iWaveFaktor)
    Switch Mod($iWaveFaktor, 2)
    Case 0
    For $w = 1 To $iWaveFaktor - 1 Step 2
    For $i = ($w - 1) * ($iHeight / $iWaveFaktor) To ($w) * ($iHeight / $iWaveFaktor) - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1 - (($w - 1) * $iHeight / $iWaveFaktor)), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    For $i = $w * ($iHeight / $iWaveFaktor) To ($w + 1) * ($iHeight / $iWaveFaktor) - 1
    $Color = '0x' & Hex($endRot - $ColorOffsetRot * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2) & _
    Hex($endGruen - $ColorOffsetGruen * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2) & _
    Hex($endBlau - $ColorOffsetBlau * ($i - ($w * $iHeight / $iWaveFaktor) + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    Next
    Case 1
    For $i = 0 To $iHeight - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    EndSwitch
    Case Else
    $ColorOffsetRot = ($endRot - $startRot) / ($iWidth / $iWaveFaktor)
    $ColorOffsetGruen = ($endGruen - $startGruen) / ($iWidth / $iWaveFaktor)
    $ColorOffsetBlau = ($endBlau - $startBlau) / ($iWidth / $iWaveFaktor)
    Switch Mod($iWaveFaktor, 2)
    Case 0
    For $w = 1 To $iWaveFaktor - 1 Step 2
    For $i = ($w - 1) * ($iWidth / $iWaveFaktor) To ($w) * ($iWidth / $iWaveFaktor) - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1 - (($w - 1) * $iWidth / $iWaveFaktor)), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $iHeight)
    Next
    For $i = $w * ($iWidth / $iWaveFaktor) To ($w + 1) * ($iWidth / $iWaveFaktor) - 1
    $Color = '0x' & Hex($endRot - $ColorOffsetRot * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2) & _
    Hex($endGruen - $ColorOffsetGruen * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2) & _
    Hex($endBlau - $ColorOffsetBlau * ($i - ($w * $iWidth / $iWaveFaktor) + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, $i, 0)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $i, $iHeight)
    Next
    Next
    Case 1
    For $i = 0 To $iHeight - 1
    $Color = '0x' & Hex($startRot + $ColorOffsetRot * ($i + 1), 2) & _
    Hex($startGruen + $ColorOffsetGruen * ($i + 1), 2) & _
    Hex($startBlau + $ColorOffsetBlau * ($i + 1), 2)
    GUICtrlSetGraphic(-1, $GUI_GR_COLOR, $Color)
    GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i)
    GUICtrlSetGraphic(-1, $GUI_GR_LINE, $iWidth, $i)
    Next
    EndSwitch
    EndSwitch
    Return $Grafik
    EndFunc ;==>_CreateColorTransition
    Func _PRIMARYdown()

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

    $pos = MouseGetPos()
    Select
    Case _CheckCtrlDblClick($hGui, $Lbl_Caption)
    If GUICtrlGetState ($Btn_Max) = "80" Then
    _Maximize()
    Else
    _Restore()
    EndIf
    Case Else
    $MousePos = False
    EndSelect
    EndFunc ;==>_PRIMARYdown

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

    Func _PRIMARYup()
    If $MousePos Then
    If $n = 2 Then
    $n = 0
    Else
    $start = TimerInit()
    EndIf
    EndIf
    EndFunc ;==>_PRIMARYup

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

    Func _CheckCtrlDblClick($GUI, $CTRL)
    $Pos = GUIGetCursorInfo ($GUI)
    If $Pos[4] = $CTRL Then
    $n += 1
    $MousePos = True
    If $n = 2 And (TimerDiff($start) < $clickspeed) Then
    Return True
    Else
    $start = TimerInit()
    $n = 1
    EndIf
    EndIf
    EndFunc ;==>_CheckCtrlDblClick

    [/autoit]

    Habe das von BugFix noch ein bischen umgebaut, ich hoffe er ist mir nicht böse^^

    mfg. Jam00