home *** CD-ROM | disk | FTP | other *** search
/ Multimédia la Compil' 2 / Sybex_Multimedia_La_Compil_2.iso / pics / picss.bas < prev    next >
BASIC Source File  |  1995-06-01  |  2KB  |  35 lines

  1. DefInt A-Z
  2. Option Explicit
  3. Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  4. Global X%, EndFlg%, S$, S2$, SUCCESS%, WinDir$
  5.  
  6. Sub Main ()
  7. 'Source Code on SCREEN SAVER Protion of PICS.INI consists of this 1 File PICSS.BAS
  8. 'For the REST of the PICS Program Source Code (ie PICS.MAK contaqining PICS.EXE) you'll have to contact the Author Dave Charbonnet 504-899-5663 504-866-2120
  9. If APP.PrevInstance Then End
  10. Err = 0: On Error GoTo ErrHand
  11.  
  12. Dim Temp As String * 20
  13. SUCCESS% = GetWindowsDirectory(Temp, 20)
  14. If SUCCESS% = 0 Then MsgBox "Error Finding Windows Dir in PICS.SCR"
  15. WinDir$ = Left$(Temp, InStr(Temp, Chr$(0)) - 1)
  16.  
  17. S$ = "PICS" 'Name of Program to Run as Screen Saver
  18. S2$ = WinDir$ + "\" + S$ + ".EXE"
  19. 'S$ = "CALC"  'Name of Program to Run as Screen Saver
  20. 'S$ = "\COMMAND.COM"  'Name of Program to Run as Screen Saver
  21. EndFlg% = True      'Check if Pics.EXE is Running
  22. AppActivate (S$)    'Checks EndFlg% if still True was already Running so send Code to it to Start Running if Paused or Minimized
  23. If EndFlg% Then SendKeys "{ENTER}+^'": End  'Must be Running Already so send  Enter to Restore Size & Sepc Copd Shift Ctrl ' for Built In Code to UnPause
  24. If Dir$(S2$) = "" Then MsgBox "Program " + S$ + ".EXE Not Found in Windows Directory"
  25. X% = Shell(S2$ + " " + Command$, 1): End
  26. MsgBox "PICS SCREEN SAVER RAN PAST END!!!!!"
  27. Exit Sub
  28.  
  29. ErrHand:
  30. If Err = 5 Then EndFlg% = False: Err = 0: Resume Next 'IF Pics.EXE is Running then DO Not Blank
  31. MsgBox "ERROR #" & Err & " in Pics SCREEN SAVER": MsgBox (APP.Title)
  32. Resume Next
  33. End Sub
  34.  
  35.