program WM_ScreenSaver;

uses
  Forms,
  Dialogs,
  SysUtils,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2};

{$E scr}

{$D SCRNSAVE WM_ScreenSaver} //w nowszych wersjach Windows ten opis jest ignorowany
{$R *.res}

var ParamStr1 :String ='';

begin
  Application.Initialize;
  Application.Title := 'WM_ScreenSaver';

  if (ParamCount>0) then ParamStr1:=LowerCase(Copy(ParamStr(1),1,2));

  if (ParamStr1='/c') or (ParamCount=0) then
    begin
    //ShowMessage(Application.Title+#13+'(c) Jacek Matulewski 2005'+#13+#13+'e-mail: jacek@phys.uni.torun.pl'+#13+'WWW: http://www.phys.uni.torun.pl/~jacek');
    Application.CreateForm(TForm2, Form2);
    Application.Run;
    end;

  if ParamStr1='/p' then
    begin
    //podglad wygaszacza ekranu
    Application.CreateForm(TForm1, Form1);
    Form1.PodepnijOkno(StrToIntDef(ParamStr(2),0));
    Application.Run;
    end;

  if ParamStr1='/a' then
    begin
    //ustawianie hasła w Windows 95, nie zaimplementowane
    Application.MessageBox('Changing of the screen saver password is not supported',PChar(Application.Title),48);
    end;

  if ParamStr1='/s' then
    begin
    //uruchamianie wygaszacza ekranu
    Application.CreateForm(TForm1, Form1);
    Application.Run;
    end;

end.
