Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <WindowsConstants.au3>
- #include <EditConstants.au3>
- IdleBox("Idle Box by Sprenger120" & @CRLF & "vorgänge die etwas dauern kann man hiermit überbrücken ^^")
- Sleep(10000)
- IdleBox("",False)
- Func IdleBox($sText, $fExit = False)
- Local Static $hGUI_IdleBox
- Local Const $iMaxLineLenght = 50
- Local $iStringLen, $iLineCount = 1, $iLineLenght = $iMaxLineLenght
- Local $iWidth, $iHeight, $iStart = 1, $iLastFound
- ;By Sprenger120
- Switch $fExit
- Case False
- $iStringLen = StringLen($sText)
- ;Alle CRLF's suchen
- While 1
- $iLastFound = StringInStr($sText, @CRLF, 1, $iLineCount, $iStart)
- If $iLastFound = 0 Then ExitLoop
- $iStart = $iLastFound
- $iLineCount += 1
- WEnd
- $iLineCount -= 1
- ;benötige zeilenanzahl ermitteln
- $iLineCount += Int($iStringLen / $iMaxLineLenght)
- If Mod($iStringLen, $iMaxLineLenght) Then $iLineCount += 1 ; den "überhang" mit dazuzählen
- If $iStringLen < $iMaxLineLenght Then $iLineLenght = $iStringLen
- ;GUI Größe
- $iWidth = $iLineLenght * 5
- $iHeight = $iLineCount * 15
- $hGUI_IdleBox = GUICreate("", $iWidth, $iHeight, -1, -1, BitOR($WS_POPUP, $WS_BORDER), $WS_EX_TOPMOST);, $hGUI_Main)
- GUISetBkColor(0xFFFFFF)
- GUICtrlCreateLabel($sText, 1, 1, $iWidth, $iHeight, 0)
- GUICtrlSetBkColor(-1, 0xFFFFFF)
- GUISetState(@SW_SHOW, $hGUI_IdleBox)
- Case True
- GUIDelete($hGUI_IdleBox)
- EndSwitch
- EndFunc ;==>IdleBox
Advertisement
Add Comment
Please, Sign In to add comment