home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form PassCheck
- Appearance = 0 'Flat
- BorderStyle = 3 'Fixed Dialog
- ClientHeight = 2448
- ClientLeft = 2040
- ClientTop = 4200
- ClientWidth = 4668
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 2772
- Icon = "Passchek.frx":0000
- Left = 1992
- LinkTopic = "Form4"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2448
- ScaleWidth = 4668
- ShowInTaskbar = 0 'False
- Top = 3924
- Width = 4764
- Begin VB.TextBox Text1
- Height = 360
- Left = 1704
- TabIndex = 4
- Top = 1452
- Width = 2376
- End
- Begin VB.Timer Timer1
- Interval = 30000
- Left = 120
- Top = 1680
- End
- Begin VB.CommandButton Command2
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 372
- Left = 2976
- TabIndex = 1
- Top = 1980
- Width = 1116
- End
- Begin VB.CommandButton Command1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "OK"
- Default = -1 'True
- Height = 372
- Left = 852
- TabIndex = 0
- Top = 1980
- Width = 1104
- End
- Begin VB.Label Label2
- Appearance = 0 'Flat
- AutoSize = -1 'True
- Caption = "Password:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 192
- Left = 720
- TabIndex = 3
- Top = 1140
- Width = 756
- End
- Begin VB.Label Label1
- BorderStyle = 1 'Fixed Single
- Caption = "The screen saver you are using is password protected. You must type in the screen saver password to turn off the screen saver."
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 7.8
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 930
- Left = 600
- TabIndex = 2
- Top = 60
- Width = 3720
- End
- Begin VB.Image Image1
- BorderStyle = 1 'Fixed Single
- Height = 384
- Left = 60
- Top = 156
- Width = 384
- End
- Attribute VB_Name = "PassCheck"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- 'For information about this program see the declarations
- 'section of the JDSaver.BAS module.
- 'This form is the Password form which is displayed at program
- 'exit when Password protection is enabled.
- Option Explicit
- Private Sub Command1_Click()
- Dim CR_LF$
- CR_LF = Chr$(13) + Chr$(10)
- 'Test the word entered to see if it matches
- 'the preset password
- If encrypt(CStr(text1.Text)) = Password Then
- PassChck = True
- Else
- MsgBox "Incorrect password;" & CR_LF & CR_LF & "Check your screen saver password and try again.", 16, ""
- PassChck = False
- End If
- Unload PassCheck
- End Sub
- Private Sub Command2_Click()
- 'Ignore any entries made and continue with the
- 'screen saver.
- PassChck = False
- Unload PassCheck
- End Sub
- Private Sub Form_Load()
- Dim ret%, x%
- Dim styleFlags&
- 'Show the mouse cursor so the user can see where to click
- Do
- Loop Until ShowCursor(True) > 5
- MouseMoves = 0
- Centerform Me
- Image1 = Icon
- 'Change the textbox style to show asterisks as characters
- 'are entered.
- styleFlags = GetWindowLong(text1.hWnd, GWL_STYLE)
- styleFlags = styleFlags Or ES_PASSWORD
- styleFlags = setWindowLong(text1.hWnd, GWL_STYLE, styleFlags)
- styleFlags = SendMessage(text1.hWnd, EM_SETPASSWORDCHAR, 42, 0&)
- 'Make the form TOPMOST, so it will show above the screen saver
- tempLong = SetWindowPos(PassCheck.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
- End Sub
- Private Sub Form_Paint()
- 'Make sure we start with the focus in the textbox
- text1.SetFocus
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- 'If a valid password has not been entered then we are
- 'returning to an operating screen saver, so we need to
- 're-hide the mouse cursor.
- If Not PassChck Then
- Do
- Loop Until ShowCursor(False) < -5
- End If
- End Sub
- Private Sub text1_Change()
- 'Reset the timer because there has
- 'been user input.
- Timer1.Enabled = False
- Timer1.Enabled = True
- End Sub
- Private Sub Timer1_Timer()
- 'We have a timer set for 30 seconds
- 'If there is no user input in that time,
- 'close the PassCheck form.
- PassChck = False
- Unload PassCheck
- End Sub
-