home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / scrnsave / scrnsave.frm < prev    next >
Encoding:
Text File  |  1995-05-07  |  2.1 KB  |  53 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   0  'None
  6.    ClientHeight    =   3720
  7.    ClientLeft      =   1245
  8.    ClientTop       =   1605
  9.    ClientWidth     =   7485
  10.    ControlBox      =   0   'False
  11.    Height          =   4125
  12.    Icon            =   SCRNSAVE.FRX:0000
  13.    Left            =   1185
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   3720
  18.    ScaleWidth      =   7485
  19.    Top             =   1260
  20.    Width           =   7605
  21.    WindowState     =   2  'Maximized
  22. End
  23. Dim Event As Integer 'Declare Variable for the status of events.
  24. Declare Function ShowCursor Lib "User" (ByVal cShow As Integer) As Integer 'Mouse Show/Hide API Call.
  25.  
  26. Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
  27. Event = True 'Set event variable to true, for reading in the Form_Load Procedure.
  28. End Sub
  29.  
  30. Sub Form_Load ()
  31.     If App.PrevInstance = True Then End 'If program allready loaded, cancel this instance.
  32.     If UCase$(Command$) = "/C" Then MsgBox "This saver has no settings window.", , "Blanker": End 'Give message when Controll window should be shown.
  33.     Do: Loop Until ShowCursor(False) < 0 'Hide cursor (Loop is done because It doesn't allways work).
  34.     WindowState = 2 'Maximize Window
  35.     visible = True 'Show Blank Window
  36.     While Event = False 'Loop until an event occurs.
  37.         DoEvents 'Allow event trapping
  38.     Wend
  39.     Do: Loop Until ShowCursor(True) > 0 'Show cursor
  40.     End
  41. End Sub
  42.  
  43. Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  44. Event = True 'Set event variable to true, for reading in the Form_Load Procedure.
  45. End Sub
  46.  
  47. Sub Form_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  48. Static OldX%, oldY% 'Define variables
  49. If OldX% = 0 And oldY% = 0 Then OldX% = X: oldY% = Y: Exit Sub 'Set Coordinates
  50. If OldX% <> X Or oldY% <> Y Then Event = True 'Set event variable to true, for reading in the Form_Load Procedure, if the mouse has moved.
  51. End Sub
  52.  
  53.