Jump to content

ScreenSaver Demo - Matrix included


MrCreatoR
 Share

Recommended Posts

Hi there,

This is a demonstration script on how to make your own screensaver - screensaver is basicaly an exe-program, but renamed to *.scr extension.

  • When we run the screensaver, or if we sellect Test (Check) Item from the context menu of the file, it executed with /S command line.
  • When we sellect Options item from the context menu of the file, the screensaver executed with no command line passed.
  • When we sellect Install item from the context menu of the file, the screensaver executed with /p first command line ($CmdLine[1]), and a handle to DC (to show our preview in desktop properties dialog) is the second command line ($CmdLine[2]).
  • When we press the "Options" button from the screensaver properties dialog (right mouse button on the screensaver -> "Install" item), the /c: command passed to our script (screensaver).

And then we can run screensaver when it required, or we can show Options dialog, wich can be a simple GUI.

Here is an obstraction example on how we can make working screensaver:

#include <GuiConstants.au3>

If $CmdLineRaw = "/S" Then
    ScreenSaver_Proc()
ElseIf $CmdLine[0] = 0 Or StringLeft($CmdLineRaw, 3) = "/c:" Then
    SCR_Options_Proc(StringLeft($CmdLineRaw, 3) = "/c:")
EndIf

Func SCR_Options_Proc($DisableParent=0)
    Local $iMsg, $ParentHwnd = 0
    
    ;If "/c:" passed as commandline, that's mean that the "Options" button was pressed from the screensaver installation dialog
    ;therefore we can disable the parent dialog and open our Options dialog as child
    If $DisableParent = 1 Then
        $ParentHwnd = WinGetHandle("")
        WinSetState($ParentHwnd, "", @SW_DISABLE)
    EndIf
    
    Local $GUI = GuiCreate("ScreenSaver Options", 250, 120, -1, -1, -1, $WS_EX_TOOLWINDOW+$WS_EX_TOPMOST, $ParentHwnd)
    
    GUICtrlCreateLabel("Our Options go here", 30, 20, 200, 30)
    GUICtrlSetFont(-1, 16)
    
    Local $Preview_Button = GUICtrlCreateButton("Preview", 10, 80, 70, 20)
    
    GUISetState()
    
    While 1
        $iMsg = GUIGetMsg()
        Switch $iMsg
            Case $GUI_EVENT_CLOSE
                ;Enable back the parent dialog
                If $DisableParent = 1 Then WinSetState($ParentHwnd, "", @SW_ENABLE)
                Exit
            Case $Preview_Button
                ScreenSaver_Proc()
        EndSwitch
    WEnd
EndFunc

Func ScreenSaver_Proc()
    MsgBox(262144+64, "ScreenSaver", "Our ScreenSaver")
EndFunc

When we compile this script, and rename it from Script.exe to Script.scr, it will work as real ScreenSaver!!!

Or we can add this part of code to the begining of this script, and the compilation process will be executed when we start the script (If Not @Compiled)...

If Not @Compiled Then
    $AutoItPath = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir")
    $AutoItExe = $AutoItPath & "\Aut2Exe\Aut2exe.exe"
    
    $SCR_Name = StringTrimRight(@ScriptName, 4)
    $SCR_Path = StringTrimRight(@ScriptFullPath, 3) & "scr"
    $SCR_Icon = $AutoItPath & "\Icons\filetype-blank.ico"
    
    RunWait($AutoItExe & ' /in "' & FileGetShortName(@ScriptFullPath) & '" /out "' & $SCR_Path & '" /icon "' & $SCR_Icon & '"')
    
    If @error Or Not FileExists($SCR_Path) Then
        MsgBox(48, "Error!", "There was an error to comile the SCR file.")
        Exit
    EndIf
    
    MsgBox(64, "Done!", "Compiling is finished!" & @LF & $SCR_Name & " is saved as:" & @LF & @LF & $SCR_Path)
    Exit
EndIf

In the archive there is ready examples, one is Matrix (the best one ;) ), and the others are simple runing text screensaver and obstraction example on how to built your own ScreenSaver.

ScreenShots of the Matrix ScreenSaver:

____ Options dialog: ScreenSaver FullScreen:

Posted Image Posted Image

With this screensaver script, you can compile it from the Options dialog, after that the screensaver will be ready as stand-alone application (for the compiling process requierd AutoIt + the script itself must stay uncompiled).

The credits for this one goes to the Jex and to jokke - for the initial concept and the main engine of this screensaver.

P.S

It plays a background sound now :)

;===================================

Previous total downloads: 9 :P

[Download]

Change log:

[Dec 1 2007, 12:23 PM]:

  • Now compatible with AutoIt 3.3.0.0.
  • Few minor improvements to the code.

[Dec 01 2007, 12:27 AM]:

  • Now the sound will loop untill the screensaver is closed (<Sound.au3> used).
  • Now the preview in the desktop properties dialog displayed as it should be.
  • Now the real Matrix font used for the letters falling.
  • Now the screensaver program will not be executed if it called with the same command line again.
  • Added options to set Begin/End Coolor of the Matrix letters.
  • The array of letters now created at the start, instead of using every time Chr() - it was slowing down the MatrixInitialize() process.
  • Fixed the bug with the font size - now the value is saved properly.
  • Prevented High CPU usage by the screensaver in some cases.

[Nov 29 2007, 01:53 AM]:

  • Now the sound can be Disabled/Enable.
  • Now there is Option to set Matrix chars font size.
Edited by MrCreatoR

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Thanks MsCreatoR.

There have been a few screen savers in example scripts but I haven't noticed any that can be previewed in the screen saver tab of the desktop properties window. That would be a nice finishing touch.

I think I read somewhere a long time ago that when it is previewed the screen saver is run with a parameter which is the handle for the DC where it has to be drawn.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I haven't noticed any that can be previewed in the screen saver tab of the desktop properties window. That would be a nice finishing touch.

But in this example it can be previewed :)

I think I read somewhere a long time ago that when it is previewed the screen saver is run with a parameter which is the handle for the DC where it has to be drawn

I am not sure if i understand, but if you compile this script (to *.scr file) :

MsgBox(0, "", $CmdLineRaw)

And press the Preview button (from the properties dialog), you will see that it executed first with /s param, and then it execute second time with /p number param (where is the number it is some kind of long number :P ). But i have no idea why it executed second time ;) ...

P.S

Updated first post:

* Now the sound can be Disabled/Enable.

* Now there is Option to set Matrix chars font size.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

But in this example it can be previewed :P

What I mean is when you choose Desktop properties, select the screensaver tab and select the screen saver from the drop down list. Before you choose preview it should show in the screen saver in the monitor on the screensaver tab. It doesn't do that when I try it.

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Before you choose preview it should show in the screen saver in the monitor on the screensaver tab

Oh i see now, thanks.. but i have no idea on how to make it work, i guessing that some API calls needed to update that screen (using passed DC), and also i think there will be need to make a small GUI/controls wich will imitate the full screensaver process..

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

That is so cool! I really like all the examples, and the code is nice and neat ;) Good work! And it's very easy to understand. :P

Edit: Is there any way to stop the flickering in the moving message?

Edit: How did you find out the command line parmeters for a screen saver? Just insterested.. :)

Edited by JustinReno
Link to comment
Share on other sites

Oh i see now, thanks.. but i have no idea on how to make it work, i guessing that some API calls needed to update that screen (using passed DC), and also i think there will be need to make a small GUI/controls wich will imitate the full screensaver process..

I added this line to the screen saver

msgbox(0,'params are',$CmdLineRaw)

then selected it for the screen saver in DeskTop properties. The parameter was "/p 6492364" and I think the number is the handle DC where it should be drawn.

You need to add something like _Singleton("MsCreatoR was here") because I think that windows will start the screen saver after every period so you will end up with miltiple instances otherwise.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

The Maxtrix screensaver is in one word: GREAT :P

Only you sould change the speed of the maxtix chars going down..

Its a bit slow ;)

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

@JustinReno

Is there any way to stop the flickering in the moving message?

Try to play with the colors and the speed (and set some styles to the label), but i don't think you can get perfect movments of the label text :)

How did you find out the command line parmeters for a screen saver?

I just runned compiled script (*.scr) with this:

MsgBox(0, "", $CmdLineRaw)

:P

@martin

The parameter was "/p 6492364" and I think the number is the handle DC where it should be drawn

Yes i see it too, and guess what? i figured out how to put there our own preview (only a *.bmp image) !!! :P - Thanks to you (for the DC hint)!

I collected many of AL3Library function to one: Set_SCR_Preview($sImage) - almoust pure API :)

It took me a while, but i think it work ok now... i will upload the solution soon ;)

And also i added Matrix Code Font to the "package" (it will be compiled and installed with the screensaver) - o now it will looks more like real "matrix effect" :(

You need to add something like _Singleton("MsCreatoR was here") because I think that windows will start the screen saver after every period so you will end up with miltiple instances otherwise.

I don't think that screensaver will executed if it already runs, but it's not a bad idea to add this kind of checking, thanks.

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

urm broken link

Work for me on all three browsers on my system (IE/Firefox/Opera) :)

Anyway, the screensaver updated (and the download link):

  • Now the sound will loop untill the screensaver is closed (<Sound.au3> used).
  • Now the preview in the desktop properties dialog displayed as it should be.
  • Now the real Matrix font used for the letters falling (Matrix Code Font.ttf).
  • Now the screensaver program will not be executed if it called with the same command line again.
  • Added options to set Begin/End Coolor of the Matrix letters.
  • The array of letters now created at the start, instead of using every time Chr() - it was slowing down the MatrixInitialize() process.
  • Fixed the bug with the font size - now the value is saved properly.
  • Prevented High CPU usage by the screensaver in some cases.

P.S

@martin

About the preview... i would like to hear (read ^_^ ) what do you think about it? Maybe you know how to refresh the image without destroy it and create it again every time in the loop :) ...

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Work for me on all three browsers on my system (IE/Firefox/Opera) ;)

Anyway, the screensaver updated (and the download link):

  • Now the sound will loop untill the screensaver is closed (<Sound.au3> used).
  • Now the preview in the desktop properties dialog displayed as it should be.
  • Now the real Matrix font used for the letters falling (Matrix Code Font.ttf).
  • Now the screensaver program will not be executed if it called with the same command line again.
  • Added options to set Begin/End Coolor of the Matrix letters.
  • The array of letters now created at the start, instead of using every time Chr() - it was slowing down the MatrixInitialize() process.
  • Fixed the bug with the font size - now the value is saved properly.
  • Prevented High CPU usage by the screensaver in some cases.

P.S

@martin

About the preview... i would like to hear (read ^_^ ) what do you think about it? Maybe you know how to refresh the image without destroy it and create it again every time in the loop :) ...

It's looking very good MsCreatoR. :)

(But I haven't studied it enough to fully understand it yet, you're getting too smart.)

I'll think about the refresh. What I would have expected was that the screen saver was drawn as normal but maybe in a hidden window or in a window off screen, and it would be copied to the preview window evry 300mS say using something like _GDIP_GraphicsDrawImageRectRect to give a scaled view rather than using a fixed image.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

@JustinReno

Try to play with the colors and the speed (and set some styles to the label), but i don't think you can get perfect movments of the label text :)

I just runned compiled script (*.scr) with this:

MsgBox(0, "", $CmdLineRaw)

;)

@martin

Yes i see it too, and guess what? i figured out how to put there our own preview (only a *.bmp image) !!! :) - Thanks to you (for the DC hint)!

I collected many of AL3Library function to one: Set_SCR_Preview($sImage) - almoust pure API :D

It took me a while, but i think it work ok now... i will upload the solution soon ^_^

And also i added Matrix Code Font to the "package" (it will be compiled and installed with the screensaver) - o now it will looks more like real "matrix effect" ;)

I don't think that screensaver will executed if it already runs, but it's not a bad idea to add this kind of checking, thanks.

Thank you!

Link to comment
Share on other sites

  • 4 months later...

Hi Guys,

Thanks for posting your screensaver script -- it's great!

I'm not able to install fonts on the work computer, but the "Symbol" font makes it look pretty cool. The computer at work isn't very fast, so I'm not seeing the strings of symbols waterfalling down the screen like the movie, but it still has at least a nice basic Matrix effect.

___________

There's a problem with the script. It's in the section where you're trying to do the preview.

You put the following code inside a loop:

While Not WinActive("[CLASS:#32770]", $SSP_Text)
        Run("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1")
        If @error Then Return SetError(1)
        Sleep(1)
    WEnd

Yikes! That tells the system to open window after window of the windows screensaver tab -- crashes the computer!

You'd be better off doing something like this:

Run("rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1")
    While Not WinActive("[CLASS:#32770]", $SSP_Text)
        If @error Then Return SetError(1)
        Sleep(1)
    WEnd

At least it won't crash the computer.

Also, there's a problem in this line:

Local $sChooseColor = _ChooseColor(2, $sSetColor, 2, $GUI)

There's one too many parameters...

It should probably be:

Local $sChooseColor = _ChooseColor(2, $sSetColor, 2)

Was the $GUI needed for something?

The preview doesn't seem to work on the XP computers I've tried this screensaver on... have you come up with a fix?

Thanks!

Link to comment
Share on other sites

That tells the system to open window after window of the windows screensaver tab -- crashes the computer!

On my system (Win XP) only one such window can be opened, and the idea here is to keep trying opening that window until it will be opened :), because sometimes (again, on *my* system) it wont open the first time.

Also, there's a problem in this line:

CODE

Local $sChooseColor = _ChooseColor(2, $sSetColor, 2, $GUI)

There's one too many parameters...

Nope, you must use the latest stable AutoIt version :party:

The preview doesn't seem to work on the XP computers

XP isn't a computer, it's a system, so my guess is, that the computer that you checking on, have some difficulties that might be related to video device :)...

 

Spoiler

Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1

AutoIt_Rus_Community.png AutoIt Russian Community

My Work...

Spoiler

AutoIt_Icon_small.pngProjects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize Program

AutoIt_Icon_small.pngUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF
 
AutoIt_Icon_small.pngExamples: 
ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo

Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating AutoIt_Rating.gif)

* === My topics === *

==================================================
My_Userbar.gif
==================================================

 

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

Link to comment
Share on other sites

Hi -- sorry... I wasn't trying to nit-pick, I was trying to give you some help with this script, which in previous posts you had mentioned you were still working on and hadn't figured out the bugs yet such as how to get the preview to show.

Ahhhh... and you're right: I've been using v3.2.2.0

I'm using a laptop at home, and a PC at work... and both computers compiled the program correctly once I made the previously mentioned changes.

(you never want to request the system open a program over and over again until AutoIt sees it -- it did lock up both of the computers I tried it on.)

I'll try it again with v3.2.10.0 - Thanks!

Link to comment
Share on other sites

  • 4 months later...

Hi there,

TNX for the script CreatoR!

Had some difficulties with your script, when using latest stable AutoIt.

Since the includes changed with Version 3.2.12 You should edit the Include-Section. The new required ones are IMHO

Old:

#include <GUIConstants.au3>

New:

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

regards

jr99

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...