Bildschirmschoner in Autoit erstellen?

  • Hi,
    ich habe zwar schon etliches in autoit hingebracht, aber sagt hat jemand schon einen Bildschirmschoner in Autoit gescriptet?. Meine Suche ergab nichts. Gruss Jan

  • so denke ich:

    [autoit]

    $gui = GUICreate("Test", -1, -1, 0, 0, BitOr($WS_POPUP, $WS_MAXIMIZE))

    [/autoit]
  • [autoit]

    GUICreate("", @DesktopWidth,@DesktopHeight+50,-1,-1,$WS_POPUP,bitor($WS_EX_TOPMOST ,$WS_EX_TOOLWINDOW ))

    [/autoit]


    würd ich es machen :D
    aber btw, wo sind denn bitteschon all die "*.src" file?

    Einmal editiert, zuletzt von azunai (1. März 2008 um 15:05)

  • Die heißen *.scr :) und liegen in C:\WINDOWS\system32
    So hier mal mein Bsp:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>

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

    #region - GUI Create
    $gui = GUICreate("SCR", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUPWINDOW+$WS_MAXIMIZE);,$WS_EX_TOPMOST)
    GUISetBkColor(0x000000)
    WinSetTrans($gui,"",150)
    ;GUICtrlCreateAvi(
    GUISetState()
    #endregion
    $mouse = MouseGetPos()
    #region - GUI Create
    $gui = GUICreate("Disk Eraser", 355, 150,-1,-1,$WS_CAPTION,$WS_EX_TOOLWINDOW+$WS_EX_TOPMOST)
    $avi = GUICtrlCreateAvi(@SystemDir & "\shell32.dll",163, 0,0)
    GUICtrlSetState (-1, 1)
    GUISetBkColor(0x000000)
    GUICtrlCreateLabel("Die Polizei hat versucht, ihre Daten zu kopieren. Um sie zu schützen, werden nun alle Daten vernichtet.",10,60,335,150)
    GUICtrlSetColor(-1,0xFFFFFF)
    $progress = GUICtrlCreateProgress(10,100,335,15)
    Dim $i = 0
    GUISetState()
    #endregion
    AdlibEnable("_Progress")
    #region - GUI SelectLoop
    While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    ;~ Case $msg =
    ;~ Case $msg =
    ;~ Case $msg =
    EndSelect
    If Abs(MouseGetPos(0)-$mouse[0]) > 100 Then Exit
    If Abs(MouseGetPos(1)-$mouse[1]) > 100 Then Exit
    WEnd
    #endregion

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

    Func _Progress()
    $i += 1
    If $i > 100 Then $i = 0
    GUICtrlSetData($progress,$i)
    EndFunc

    [/autoit]
  • Zitat

    Die heißen *.scr :) und liegen in C:\WINDOWS\system32


    , also ich find keine in system 32 :P nur nen srcclient.dll
    aber naja hab mal eine src dort hineinkopiert, aber wie kann ich die jetzt als screensaver auswählen?

  • Anscheinend hat Johannes die Antwort schon bekommen ...
    http://www.autoitscript.com/forum/index.php?s=&showtopic=65474&view=findpost&p=486536

    [autoit]

    #include <GUIConstants.au3>
    ;first edition of an screen saver
    $font='Arial'
    $textcolor = 0xff0000

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

    GUICreate('', -1, -1, 0, 0, BitOr($WS_POPUP, $WS_MAXIMIZE))
    ; paradies.jpg exists under W2K, XP has other filenames, the directory is the same
    $pic1 = GUICtrlCreatePic(@WindowsDir & '\Web\Wallpaper\paradies.jpg', 0, 0, @DesktopWidth, @DesktopHeight)
    $label1=GUICtrlCreateLabel ('This is only a sample of a text for a screen saver', 10, 80, @DesktopWidth -20, @DesktopHeight-180, $SS_CENTERIMAGE )
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor ( -1, $textcolor)

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

    GUICtrlSetFont (-1, 36, 400, 1, $font)
    GUISetState (@SW_SHOW)

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

    While 1
    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Wend

    [/autoit]


  • Hi, damit der Bildschirmschoner funktioniert, muss er ja irgendwie in Bewegung bleiben. Ich wollte die Schriftgrösse oder - die Farbe ändern. Aber es wird nichts angezeigt. Was mache ich flasch ? Gruss Johannes


    [autoit]

    #include <GUIConstants.au3>
    #include <File.au3>

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

    ;first edition of an screen saver
    $ininame='bschoner.ini'

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

    $font=IniRead($ininame, 'Configuration', 'Schrift', 'Arial')
    $textcolor=IniRead($ininame, 'Configuration', 'Textfarbe', 0xff0000)
    $fontsize=IniRead($ininame, 'Configuration', 'Schriftgrösse', 24)
    $txtdatei=IniRead($ininame, 'Configuration', 'Textdatei', 'bschoner.txt')
    $nachKTag=IniRead($ininame, 'Configuration', 'NachKalenderTag', 'nein')
    $letzteBildnr=IniRead($ininame, 'Configuration', 'letzteBildnr', 1)
    $LastCall=IniRead($ininame, 'Configuration', 'letzterAufruf', 1)

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

    $fontsizeNow = $fontsize
    If FileExists($txtdatei) then
    $ZeilenAnzahl=_FileCountLines ( $txtdatei)
    $h=FileOpen($txtdatei,0)
    MsgBox(4096,'','SELECT',1)
    Select
    Case $nachKTag='ja' and $ZeilenAnzahl >= 365
    $txt=FileReadLine($h, @YDAY)
    Case $nachKTag='ja' and $ZeilenAnzahl < 365 and @YDAY <= $ZeilenAnzahl
    If $LastCall = @YDAY Then
    $txt=FileReadLine($h, @YDAY)
    Else
    $txt=FileReadLine($h, @YDAY)
    IniWrite($ininame, 'Configuration', 'letzterAufruf', @YDAY)
    EndIf
    Case Else
    $i=@YDAY
    Do
    $i=$i-$ZeilenAnzahl
    Until $i <= $Zeilenanzahl
    $txt=FileReadLine($h, $i)
    EndSelect
    FileClose ($h)
    Else
    $txt='Dies ist nur ein Beispieltext für den Bildschirmschoner'
    EndIf

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

    GUICreate('', -1, -1, 0, 0, BitOr($WS_POPUP, $WS_MAXIMIZE))
    ; paradies.jpg exists under W2K, XP has other filenames, the directory is the same
    $Bild1 = GUICtrlCreatePic(@WindowsDir & '\Web\Wallpaper\paradies.jpg', 0, 0, @DesktopWidth, @DesktopHeight)
    $Bez=GUICtrlCreateLabel ($txt, 30, 80, @DesktopWidth -60, @DesktopHeight-180, BitOr($SS_CENTERIMAGE, $SS_CENTER) )
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor ( -1, $textcolor)

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

    GUICtrlSetFont (-1, $fontsize, 400, 1, $font)
    GUISetState (@SW_SHOW)

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

    While 1
    $msg = GUIGetMsg()

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

    If $fontsizeNow = $fontsize then
    GUICtrlSetColor ($Bez, $textcolor)
    ;GUICtrlSetFont ($Bez, $fontsize + 10, 400, 1, $font)
    $fontsizeNow = $fontsize + 1
    EndIf
    If $fontsize = $fontsizeNow then
    GUICtrlSetColor ($Bez, 0x00FF00)
    ;GUICtrlSetFont ($Bez, $fontsize, 400, 1, $font)
    $fontsize = $fontsize
    EndIf
    Sleep (1000)
    $a=MsgBox(4096,'','Jetzt sollte sich am Textformat etwas ändern. Beenden mit OK',2)
    If $a=1 then Exit
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Wend

    [/autoit]
  • Das ganze Testen an der Schriftgröße. Machs z.B. so:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <File.au3>

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

    ;first edition of an screen saver
    $ininame='bschoner.ini'

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

    $font=IniRead($ininame, 'Configuration', 'Schrift', 'Arial')
    $textcolor=IniRead($ininame, 'Configuration', 'Textfarbe', 0xff0000)
    $fontsize=IniRead($ininame, 'Configuration', 'Schriftgrösse', 24)
    $txtdatei=IniRead($ininame, 'Configuration', 'Textdatei', 'bschoner.txt')
    $nachKTag=IniRead($ininame, 'Configuration', 'NachKalenderTag', 'nein')
    $letzteBildnr=IniRead($ininame, 'Configuration', 'letzteBildnr', 1)
    $LastCall=IniRead($ininame, 'Configuration', 'letzterAufruf', 1)

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

    $fontsizeNow = $fontsize
    If FileExists($txtdatei) then
    $ZeilenAnzahl=_FileCountLines ( $txtdatei)
    $h=FileOpen($txtdatei,0)
    MsgBox(4096,'','SELECT',1)
    Select
    Case $nachKTag='ja' and $ZeilenAnzahl >= 365
    $txt=FileReadLine($h, @YDAY)
    Case $nachKTag='ja' and $ZeilenAnzahl < 365 and @YDAY <= $ZeilenAnzahl
    If $LastCall = @YDAY Then
    $txt=FileReadLine($h, @YDAY)
    Else
    $txt=FileReadLine($h, @YDAY)
    IniWrite($ininame, 'Configuration', 'letzterAufruf', @YDAY)
    EndIf
    Case Else
    $i=@YDAY
    Do
    $i=$i-$ZeilenAnzahl
    Until $i <= $Zeilenanzahl
    $txt=FileReadLine($h, $i)
    EndSelect
    FileClose ($h)
    Else
    $txt='Dies ist nur ein Beispieltext für den Bildschirmschoner'
    EndIf

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

    GUICreate('', -1, -1, 0, 0, BitOr($WS_POPUP, $WS_MAXIMIZE))
    ; paradies.jpg exists under W2K, XP has other filenames, the directory is the same
    $Bild1 = GUICtrlCreatePic(@WindowsDir & '\Web\Wallpaper\turquoise.jpg', 0, 0, @DesktopWidth, @DesktopHeight)
    GUICtrlSetState(-1,$GUI_DISABLE)
    $Bez=GUICtrlCreateLabel ($txt, 30, 80, @DesktopWidth -60, @DesktopHeight-180, BitOr($SS_CENTERIMAGE, $SS_CENTER) )
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor ( -1, $textcolor)

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

    $grosklein = 1
    GUICtrlSetFont (-1, $fontsize, 400, 1, $font)
    GUISetState (@SW_SHOW)
    $fontsizeMax = $fontsize +100
    AdlibEnable("_fontsize",500)
    While 1
    $msg = GUIGetMsg()

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


    ;~ EndIf
    ;~ Sleep (1000)
    ;$a=MsgBox(4096,'','Jetzt sollte sich am Textformat etwas ändern. Beenden mit OK',2)
    ;If $a=1 then Exit
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Wend

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

    Func _fontsize()
    If $fontsizeNow > $fontsizeMax then $grosklein = -1
    If $fontsizeNow < $fontsize then $grosklein = 1

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

    $fontsizeNow += 10*$grosklein
    GUICtrlSetFont ($Bez, $fontsizeNow, 400, 1, $font)
    EndFunc

    [/autoit]
  • HI progandy, danke für die schnelle und schöne Lösung. Leider fackert das Label bei jeder Umstellung kurz auf - ähnlich wie das Problem in der Hilfe bei SplashTextOn - geht das ganze nicht etwas smoother zu gestalten ohne dieses Flackern - ansonsten 1a Arbeit. Gruss J.

  • Du könntest das Hintergrundbild rausnehmen ... Die Transparenz flackert halt. Aber dann siehts nicht mehr so schön aus :P

  • Ich versuche gerade das ganze etwas abwechslungsreicher zu gestallten.

    Die beiden angegebenen Bilder sollen sich alle 10 Sekunden, wenn der Bildschirmschoner aktiv ist, getauscht werden. Aber irgendwie kommt:

    1.) immer das gleiche Bild
    2.) kann man nicht mehr aus der Schleife kommen.

    Wo ist das Problem?

    LG, Lina.

    [autoit]

    #include <GUIConstants.au3>
    ;first edition of an screen saver
    $font='Arial'
    $textcolor = 0xff0000

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

    GUICreate('', -1, -1, 0, 0, BitOr($WS_POPUP, $WS_MAXIMIZE))
    ;$pic1 = GUICtrlCreatePic(@WindowsDir & '\Web\Wallpaper\paradies.jpg', 0, 0, @DesktopWidth, @DesktopHeight)

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

    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor ( -1, $textcolor)

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

    GUICtrlSetFont (-1, 36, 400, 1, $font)
    GUISetState (@SW_SHOW)

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

    While 1

    While 2
    $pic1 = GUICtrlCreatePic('bild1.jpg', 0, 0, @DesktopWidth, @DesktopHeight)
    sleep(10000)
    $pic2 = GUICtrlCreatePic('bild2.bmp', 0, 0, @DesktopWidth, @DesktopHeight)
    WEnd

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

    $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    Wend

    [/autoit]

    Lieben Gruß,
    Alina

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

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr

  • ich denke mal die 10000 millsekunden werden das problem sein!

    und warum guicreatepic? änder doch einfach die daten des bereits erstellten pics!


    [autoit]

    #include <GUIConstants.au3>
    ;first edition of an screen saver
    $font='Arial'
    $textcolor = 0xff0000

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

    GUICreate('', -1, -1, 0, 0, BitOr($WS_POPUP, $WS_MAXIMIZE))
    $pic1 = GUICtrlCreatePic(@WindowsDir & '\Web\Wallpaper\paradies.jpg', 0, 0, @DesktopWidth, @DesktopHeight)

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

    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor ( -1, $textcolor)

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

    GUICtrlSetFont (-1, 36, 400, 1, $font)
    GUISetState (@SW_SHOW)

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

    While 1

    While 2
    GUICtrlSetImage($pic1,"bild1.bmp")
    GUISetState(@SW_SHOW) ; um das neue bild anzuzeigen :P
    for $i = 1 to 10
    $msg = GUIGetMsg() ; das gehört hier ind die schleife :P nicht auserhalb! daher deine endlos schleife!
    If $msg == $GUI_EVENT_CLOSE Then Exit
    sleep(1000) ; damit "$GUI_EVENT_CLOSE" öfter verabreitet wird!
    next
    GUICtrlSetImage($pic1,"bild2.bmp")
    GUISetState(@SW_SHOW) ; um das neue bild anzuzeigen :P

    WEnd
    Wend

    [/autoit]
  • Hallo azunai.

    Bekomme dann folgende Meldung:

    GUICtrlSetImage($hPIC,
    ~~~~~~~~~~~~~~~~~~~~~^
    E:\test.au3 - 1 error(s), 1 warning(s)

    LG, Lina.

    Lieben Gruß,
    Alina

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

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr

  • So funktioniert es nun:

    [autoit]

    #include <GUIConstants.au3>
    ;first edition of an screen saver
    $font='Arial'
    $textcolor = 0xff0000

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

    GUICreate('', -1, -1, 0, 0, BitOr($WS_POPUP, $WS_MAXIMIZE))
    $pic1 = GUICtrlCreatePic('bild1.bmp', 0, 0, @DesktopWidth, @DesktopHeight)

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

    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetColor ( -1, $textcolor)

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

    GUICtrlSetFont (-1, 36, 400, 1, $font)
    GUISetState (@SW_SHOW)

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

    While 1

    While 2
    GUICtrlSetImage($pic1,"bild1.bmp")
    GUISetState(@SW_SHOW) ; um das neue bild anzuzeigen :P
    for $i = 1 to 10
    $msg = GUIGetMsg() ; das gehört hier ind die schleife :P nicht auserhalb! daher deine endlos schleife!
    If $msg == $GUI_EVENT_CLOSE Then Exit
    sleep(1000) ; damit "$GUI_EVENT_CLOSE" öfter verabreitet wird!
    next
    GUICtrlSetImage($pic1,"bild2.bmp")
    GUISetState(@SW_SHOW) ; um das neue bild anzuzeigen :P
    sleep(1000)

    WEnd
    Wend

    [/autoit]

    LG und DANKE !!!!

    Lina.

    Lieben Gruß,
    Alina

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

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr

  • @ azunai

    Das was ich noch nicht hinbekommen habe ist die Schleife durch einmal drücken von ESC abzubrechen, aber sonst läuft es gut.

    Witziger BS azunai

    LG, Lina.

    Lieben Gruß,
    Alina

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

    Geheime Information: ;)
    k3mrwmIBHejryPvylQSFieDF5f3VOnk6iLAVBGVhKQegrFuWr3iraNIblLweSW4WgqI0SrRbS7U5jI3sn50R4a15Cthu1bEr