home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / various / noboot / nbsample.frm < prev    next >
Text File  |  1995-02-27  |  4KB  |  139 lines

  1. VERSION 2.00
  2. Begin Form NBSample 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   0  'None
  6.    Caption         =   "No Boot Sample"
  7.    ClientHeight    =   2025
  8.    ClientLeft      =   2280
  9.    ClientTop       =   2625
  10.    ClientWidth     =   6465
  11.    Height          =   2550
  12.    Left            =   2220
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   2025
  15.    ScaleWidth      =   6465
  16.    Top             =   2160
  17.    Width           =   6585
  18.    Begin MabryNoBoot NoBoot1 
  19.       Height          =   420
  20.       Left            =   600
  21.       Top             =   1440
  22.       Width           =   420
  23.    End
  24.    Begin Timer Timer1 
  25.       Enabled         =   0   'False
  26.       Interval        =   1
  27.       Left            =   120
  28.       Top             =   1440
  29.    End
  30.    Begin Label Label2 
  31.       AutoSize        =   -1  'True
  32.       BackColor       =   &H00000000&
  33.       Caption         =   "While this sample is running, try to use Ctrl-Alt-Del.  You can exit this sample by pressing the Space bar."
  34.       ForeColor       =   &H00FFFFFF&
  35.       Height          =   195
  36.       Left            =   120
  37.       TabIndex        =   1
  38.       Top             =   120
  39.       Width           =   8865
  40.    End
  41.    Begin Label Label1 
  42.       AutoSize        =   -1  'True
  43.       BackColor       =   &H00000000&
  44.       Caption         =   "Mabry Software.  Software nuts and bolts -- no screws."
  45.       FontBold        =   -1  'True
  46.       FontItalic      =   0   'False
  47.       FontName        =   "MS Sans Serif"
  48.       FontSize        =   13.5
  49.       FontStrikethru  =   0   'False
  50.       FontUnderline   =   0   'False
  51.       ForeColor       =   &H0000C000&
  52.       Height          =   360
  53.       Left            =   240
  54.       TabIndex        =   0
  55.       Top             =   840
  56.       Width           =   7575
  57.    End
  58. End
  59. Option Explicit
  60.  
  61. Declare Function ShowCursor Lib "User" (ByVal bShow As Integer) As Integer
  62.  
  63. Dim CursorCount As Integer
  64. Dim QuitFlag As Integer
  65.  
  66. Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
  67.     If KeyCode = Asc(" ") Then
  68.         QuitFlag = True
  69.     End If
  70. End Sub
  71.  
  72. Sub Form_Load ()
  73.     NoBoot1 = False
  74.  
  75.     Randomize
  76.     On Error Resume Next
  77.  
  78.     If UCase(Command$) <> "/S" Or App.PrevInstance Then End
  79.  
  80.     If UCase(Command$) = "/C" Then
  81.         MsgBox "This screen saver has no options.", 64, "NoBoot Sample Saver"
  82.         End
  83.     End If
  84.  
  85.     QuitFlag% = False
  86.     CursorCount = ShowCursor(False) + 1
  87.  
  88.     Do While ShowCursor(False) >= -1
  89.     Loop
  90.  
  91.     Do While ShowCursor(True) < -1
  92.     Loop
  93.  
  94.     NBSample.Move 0, 0, Screen.Width, Screen.Height
  95.  
  96.     DoEvents
  97.  
  98.     Me.Show
  99.     timer1.Enabled = True
  100. End Sub
  101.  
  102. Sub Form_Unload (Cancel As Integer)
  103.     NoBoot1 = True
  104.  
  105.     Unload NBSample
  106.  
  107.     ' reset cursor to its old state
  108.     Do While ShowCursor(False) >= CursorCount
  109.     Loop
  110.  
  111.     Do While ShowCursor(True) < CursorCount
  112.     Loop
  113.  
  114.     End
  115. End Sub
  116.  
  117. Sub Timer1_Timer ()
  118.     Static xLast
  119.  
  120.     If QuitFlag = True Then Unload NBSample
  121.  
  122.     If xLast = 0 Then
  123.         xLast = NBSample.Width
  124.         Label1.Top = ((NBSample.Height - Label1.Height) * Rnd)
  125.     Else
  126.         xLast = xLast - NBSample.TextWidth(" ")
  127.  
  128.         If xLast = 0 Then
  129.             xLast = -1
  130.         ElseIf xLast + Label1.Width < 0 Then
  131.             xLast = NBSample.Width
  132.             Label1.Top = ((NBSample.Height - Label1.Height) * Rnd)
  133.         End If
  134.     End If
  135.  
  136.     Label1.Left = xLast
  137. End Sub
  138.  
  139.