Class TfrmFullScreen (unit savRun)

Inherits from

TForm

this unit implements the full-scree-mode of my screen saver look out for comments on special issues. BTW: I set the background color to this nice green, to ensure the background gets never painted. I thought it would be easy to detect the unwanted painting of this green. Version 1.0 Author: Meik Weber IMPORTANT: See Copyright and disclaimer in README.TXT and Project Source

Constructors



Functions

procedure FormClose(Sender: TObject; var Action: TCloseAction);

make the window topmost

procedure FormCreate(Sender: TObject);

disable the mouse again

procedure FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

you will recieve at least one mosue move after startup

procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);

you may recieve one after startup (think for the test button

procedure FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);


procedure FormPaint(Sender: TObject);

if the graphics is not yet running, create the thread

procedure FormShow(Sender: TObject);

enable every Win95 system key

procedure Timer1Timer(Sender: TObject);

the timer serves as a Mouse-Reset.

procedure Closeifok;

this function checks for password if necessary and closes the screen-saver if pwd was correct

procedure CloseSaver;

hide mouse cursor

procedure CreateParams (var Params : TCreateParams);

do not activate the saver more than once

procedure MouseEvent;

this is the generic mouse event.

procedure WMEraseBkgnd (var Msg : TMessage);

tell the saver to repaint this rectangle

procedure WMKeyDown (var Msg : TWMKeyDown);

this shows how many mouse-events (Button-Up and Move) are ignored before the saver gets closed.

procedure WMSysCommand (var Msg : TWMSysCommand);

oh no, never write the background

procedure WMSysKeyDown (var Msg : TWMSysKeyDown);


Properties

Events

Variables

Timer1 : TTimer;


IgnoreMouse : Integer;

Private declarations

MyThread : TSaverThread;

now comes my custom stuff


Constructors


Functions


procedure FormClose(Sender: TObject; var Action: TCloseAction);

make the window topmost


procedure FormCreate(Sender: TObject);

disable the mouse again


procedure FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);

you will recieve at least one mosue move after startup


procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);

you may recieve one after startup (think for the test button


procedure FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);


procedure FormPaint(Sender: TObject);

if the graphics is not yet running, create the thread


procedure FormShow(Sender: TObject);

enable every Win95 system key


procedure Timer1Timer(Sender: TObject);

the timer serves as a Mouse-Reset. It is here to avoid the screen saver being deactivated by bumps on the table if the user has a high-resultion-mouse. This constantly resets the 'IgnoreMouse' variable every 2 seconds. The value of 'TicksToIgnore' controls how nice your saver behaves to these unwanted mouse movements. You may want to change the time-value or you may want to disable or delete this timer as MS Screen Savers don't do stuff like this, but I found it very useful


procedure Closeifok;

this function checks for password if necessary and closes the screen-saver if pwd was correct


procedure CloseSaver;

hide mouse cursor


procedure CreateParams (var Params : TCreateParams);

do not activate the saver more than once


procedure MouseEvent;

this is the generic mouse event. It is best to ignore some mouse events, instead of terminating or showing the password dlg. I figured out that it is best to ignore 2 mouse events after startup or pwd-dialog, even if a lot of documentation I saw tells me I should only ignore 1 event


procedure WMEraseBkgnd (var Msg : TMessage);

tell the saver to repaint this rectangle


procedure WMKeyDown (var Msg : TWMKeyDown);

this shows how many mouse-events (Button-Up and Move) are ignored before the saver gets closed. It should be at least 2, or you may observe that your saver does not start (or closes immediately after activation


procedure WMSysCommand (var Msg : TWMSysCommand);

oh no, never write the background


procedure WMSysKeyDown (var Msg : TWMSysKeyDown);


Properties


Events


Variables


Timer1 : TTimer;


IgnoreMouse : Integer;

Private declarations


MyThread : TSaverThread;

now comes my custom stuff