;================================================================================================== ; $hWnd Fensterhandle ; $Ctrl_ID Control-ID ; $sText einzufügender Text, wird nichts übergeben bricht die Funktion ab ; $iDelay Verzögerung bis zum Beginn Einfügen nächstes Zeichen ; Erfordert ;================================================================================================== Func _txt_eff__fountain($hWnd, $Ctrl_ID, $sText='', $iDelay=-1) If $sText = '' Then Return If $iDelay < 0 Then $iDelay = 20 Local $static = _IsStatic($hWnd, $Ctrl_ID) Local $aTxt = StringSplit($sText, ''), $aPop[$aTxt[0]], $leftChars = '', $rightChars = '', $tmpLeft = '' Local $tmpVal, $i, $k, $start = Round($aTxt[0]/2), $spaceCnt = $start-1, $random, $char, $side = False For $i = 0 To UBound($aPop) -1 $aPop[$i] = $aTxt[$i+1] Next For $i = 1 To UBound($aTxt) -1 $random = Random(0, UBound($aPop)) $char = $aPop[$random] $aPop[$random] = $aPop[UBound($aPop)-1] If UBound($aPop)-1 > 2 Then ReDim $aPop[UBound($aPop)-1] If $static = 1 Then GUISetState(@SW_LOCK, $hWnd) If $side Then $rightChars = $char & $rightChars Else $tmpLeft &= $char $leftChars = _StringRepeat(' ', $spaceCnt) & $tmpLeft $spaceCnt -= 1 EndIf ControlSetText($hWnd, '', $Ctrl_ID, $leftChars & $rightChars) $side = Not $side If $static = 1 Then GUISetState(@SW_UNLOCK, $hWnd) Sleep($iDelay) Next Local $str = ControlGetText($hWnd, '', $Ctrl_ID), $strLen = StringLen($str) $spaceCnt = 0 $leftChars = StringLeft($str, $start) $rightChars = StringRight($str, $strLen-$start) $side = False $i = 0 Do If $side Then $rightChars = StringTrimLeft($rightChars, 1) Else $leftChars = StringTrimRight($leftChars, 1) $spaceCnt += 1 EndIf $side = Not $side If $static = 1 Then GUISetState(@SW_LOCK, $hWnd) ControlSetText($hWnd, '', $Ctrl_ID, _StringRepeat(' ', $spaceCnt) & $leftChars & $rightChars) If $static = 1 Then GUISetState(@SW_UNLOCK, $hWnd) Sleep($iDelay) $i += 1 Until $i = $strLen $tmpLeft = '' $leftChars = '' $rightChars = '' $spaceCnt = $start-1 $side = False Local $leftIndx = 1, $rightIndx = UBound($aTxt)-1 For $i = 1 To UBound($aTxt) -1 If $static = 1 Then GUISetState(@SW_LOCK, $hWnd) If $side Then $rightChars = $aTxt[$rightIndx] & $rightChars $rightIndx -= 1 Else $tmpLeft &= $aTxt[$leftIndx] $leftChars = _StringRepeat(' ', $spaceCnt) & $tmpLeft $spaceCnt -= 1 $leftIndx += 1 EndIf ControlSetText($hWnd, '', $Ctrl_ID, $leftChars & $rightChars) $side = Not $side If $static = 1 Then GUISetState(@SW_UNLOCK, $hWnd) Sleep($iDelay) Next EndFunc ;==>_txt_eff__fountain Func _IsStatic($winhandle, $control_id) Local $ret = DllCall("user32.dll", "int", "GetClassName", "hwnd", ControlGetHandle($winhandle, "", $control_id), "str", "", "int", 128) If StringInStr($ret[2], "Static") <> 0 Then Return 1 Return 0 EndFunc ;==>_IsStatic