home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1992 / 17 / savenow / savenow.pas < prev    next >
Pascal/Delphi Source File  |  1992-07-14  |  673b  |  23 lines

  1. {$R-,S-,L-,D-}
  2. PROGRAM SaveNow;
  3. {$R SAVENOW}
  4. USES WinTypes, WinProcs, Strings;
  5. VAR SSName : ARRAY[0..150] OF Char;
  6. BEGIN
  7.   IF GetProfileInt('Windows', 'ScreenSaveActive', 0) = 0 THEN
  8.     MessageBox(0, 'Use Control Panel to select a screen saver',
  9.       'ERROR', mb_Ok + mb_IconStop)
  10.   ELSE
  11.     BEGIN
  12.       GetPrivateProfileString('boot', 'SCRNSAVE.EXE', '',
  13.         SSName, 150, 'SYSTEM.INI');
  14.       IF SSName[0]=#0 THEN
  15.         MessageBox(0, 'Use Control Panel to select a screen saver',
  16.           'ERROR', mb_Ok + mb_IconStop)
  17.       ELSE
  18.         BEGIN
  19.           StrCat(SSName, ' /S');
  20.           WinExec(SSName, sw_Normal);
  21.         END;
  22.     END;
  23. END.