home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / pcsecu1a / alarm.frm (.txt) next >
Encoding:
Visual Basic Form  |  1999-06-07  |  17.5 KB  |  483 lines

  1. VERSION 5.00
  2. Begin VB.Form Explorer 
  3.    BackColor       =   &H00FF0000&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "Computer Security Sysytem"
  6.    ClientHeight    =   9540
  7.    ClientLeft      =   0
  8.    ClientTop       =   0
  9.    ClientWidth     =   12870
  10.    DrawMode        =   15  'Merge Pen Not
  11.    DrawStyle       =   2  'Dot
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    Moveable        =   0   'False
  16.    PaletteMode     =   2  'Custom
  17.    ScaleHeight     =   477
  18.    ScaleMode       =   2  'Point
  19.    ScaleWidth      =   643.5
  20.    ShowInTaskbar   =   0   'False
  21.    StartUpPosition =   2  'CenterScreen
  22.    WhatsThisHelp   =   -1  'True
  23.    WindowState     =   2  'Maximized
  24.    Begin VB.TextBox Text1 
  25.       Height          =   375
  26.       Left            =   720
  27.       TabIndex        =   20
  28.       Top             =   3120
  29.       Width           =   1575
  30.    End
  31.    Begin VB.Timer Timer1 
  32.       Interval        =   60000
  33.       Left            =   1320
  34.       Top             =   1200
  35.    End
  36.    Begin VB.TextBox timeLeft 
  37.       Enabled         =   0   'False
  38.       Height          =   375
  39.       Left            =   3480
  40.       TabIndex        =   17
  41.       Text            =   "60"
  42.       Top             =   720
  43.       Width           =   855
  44.    End
  45.    Begin VB.CommandButton clear 
  46.       Caption         =   "Oops! I Hit the Wrong Button, Clear The Password I Entered"
  47.       Height          =   855
  48.       Left            =   9480
  49.       TabIndex        =   16
  50.       Top             =   8040
  51.       Width           =   2175
  52.    End
  53.    Begin VB.CommandButton padAsterik 
  54.       Caption         =   "*"
  55.       BeginProperty Font 
  56.          Name            =   "MS Sans Serif"
  57.          Size            =   15
  58.          Charset         =   0
  59.          Weight          =   400
  60.          Underline       =   0   'False
  61.          Italic          =   0   'False
  62.          Strikethrough   =   0   'False
  63.       EndProperty
  64.       Height          =   915
  65.       Left            =   8760
  66.       TabIndex        =   14
  67.       Top             =   6960
  68.       Width           =   1395
  69.    End
  70.    Begin VB.CommandButton padPound 
  71.       Caption         =   "#"
  72.       BeginProperty Font 
  73.          Name            =   "MS Sans Serif"
  74.          Size            =   12
  75.          Charset         =   0
  76.          Weight          =   700
  77.          Underline       =   0   'False
  78.          Italic          =   0   'False
  79.          Strikethrough   =   0   'False
  80.       EndProperty
  81.       Height          =   975
  82.       Left            =   4560
  83.       TabIndex        =   13
  84.       Top             =   6960
  85.       Width           =   1335
  86.    End
  87.    Begin VB.CommandButton cmdEnter 
  88.       Caption         =   "Enter"
  89.       BeginProperty Font 
  90.          Name            =   "Comic Sans MS"
  91.          Size            =   21.75
  92.          Charset         =   0
  93.          Weight          =   400
  94.          Underline       =   0   'False
  95.          Italic          =   0   'False
  96.          Strikethrough   =   0   'False
  97.       EndProperty
  98.       Height          =   975
  99.       Left            =   10320
  100.       TabIndex        =   10
  101.       Top             =   4920
  102.       Width           =   1935
  103.    End
  104.    Begin VB.CommandButton pad0 
  105.       Caption         =   "0"
  106.       Height          =   975
  107.       Left            =   6720
  108.       TabIndex        =   9
  109.       Top             =   6960
  110.       Width           =   1335
  111.    End
  112.    Begin VB.CommandButton pad7 
  113.       Caption         =   "7"
  114.       Height          =   975
  115.       Left            =   4560
  116.       TabIndex        =   8
  117.       Top             =   2640
  118.       Width           =   1335
  119.    End
  120.    Begin VB.CommandButton pad4 
  121.       Caption         =   "4"
  122.       Height          =   975
  123.       Left            =   4560
  124.       TabIndex        =   7
  125.       Top             =   4080
  126.       Width           =   1335
  127.    End
  128.    Begin VB.CommandButton pad5 
  129.       Caption         =   "5"
  130.       Height          =   975
  131.       Left            =   6720
  132.       TabIndex        =   6
  133.       Top             =   4080
  134.       Width           =   1335
  135.    End
  136.    Begin VB.CommandButton pad2 
  137.       Caption         =   "2"
  138.       Height          =   975
  139.       Left            =   6720
  140.       TabIndex        =   5
  141.       Top             =   5520
  142.       Width           =   1335
  143.    End
  144.    Begin VB.CommandButton pad9 
  145.       Caption         =   "9"
  146.       Height          =   975
  147.       Left            =   8760
  148.       TabIndex        =   4
  149.       Top             =   2640
  150.       Width           =   1335
  151.    End
  152.    Begin VB.CommandButton pad6 
  153.       Caption         =   "6"
  154.       Height          =   975
  155.       Left            =   8760
  156.       TabIndex        =   3
  157.       Top             =   4080
  158.       Width           =   1335
  159.    End
  160.    Begin VB.CommandButton pad3 
  161.       Caption         =   "3"
  162.       Height          =   975
  163.       Left            =   8760
  164.       TabIndex        =   2
  165.       Top             =   5520
  166.       Width           =   1335
  167.    End
  168.    Begin VB.CommandButton pad8 
  169.       Caption         =   "8"
  170.       Height          =   975
  171.       Left            =   6720
  172.       TabIndex        =   1
  173.       Top             =   2640
  174.       Width           =   1335
  175.    End
  176.    Begin VB.CommandButton pad1 
  177.       Caption         =   "1"
  178.       Height          =   975
  179.       Left            =   4560
  180.       TabIndex        =   0
  181.       Top             =   5520
  182.       Width           =   1335
  183.    End
  184.    Begin VB.TextBox EnteredCode 
  185.       Enabled         =   0   'False
  186.       Height          =   405
  187.       Left            =   5400
  188.       TabIndex        =   12
  189.       ToolTipText     =   "You Entered"
  190.       Top             =   8280
  191.       Width           =   3495
  192.    End
  193.    Begin VB.Label Label4 
  194.       AutoSize        =   -1  'True
  195.       BackColor       =   &H00FF0000&
  196.       Caption         =   "Minutes You Will Automatically Be Shut Down!!"
  197.       BeginProperty Font 
  198.          Name            =   "Comic Sans MS"
  199.          Size            =   9.75
  200.          Charset         =   0
  201.          Weight          =   400
  202.          Underline       =   0   'False
  203.          Italic          =   0   'False
  204.          Strikethrough   =   0   'False
  205.       EndProperty
  206.       Height          =   270
  207.       Left            =   4440
  208.       TabIndex        =   19
  209.       Top             =   720
  210.       Width           =   4245
  211.    End
  212.    Begin VB.Label Label3 
  213.       AutoSize        =   -1  'True
  214.       BackColor       =   &H00FF0000&
  215.       Caption         =   "If you do not enter a password in: "
  216.       BeginProperty Font 
  217.          Name            =   "Comic Sans MS"
  218.          Size            =   9.75
  219.          Charset         =   0
  220.          Weight          =   400
  221.          Underline       =   0   'False
  222.          Italic          =   0   'False
  223.          Strikethrough   =   0   'False
  224.       EndProperty
  225.       Height          =   270
  226.       Left            =   240
  227.       TabIndex        =   18
  228.       Top             =   720
  229.       Width           =   3180
  230.    End
  231.    Begin VB.Label Label2 
  232.       BackColor       =   &H00FF0000&
  233.       Caption         =   "Entered Password:"
  234.       BeginProperty Font 
  235.          Name            =   "Comic Sans MS"
  236.          Size            =   14.25
  237.          Charset         =   0
  238.          Weight          =   400
  239.          Underline       =   0   'False
  240.          Italic          =   0   'False
  241.          Strikethrough   =   0   'False
  242.       EndProperty
  243.       Height          =   375
  244.       Left            =   2520
  245.       TabIndex        =   15
  246.       Top             =   8280
  247.       Width           =   2655
  248.    End
  249.    Begin VB.Label Label1 
  250.       AutoSize        =   -1  'True
  251.       BackColor       =   &H00FF0000&
  252.       Caption         =   "Computer Security System"
  253.       BeginProperty Font 
  254.          Name            =   "Comic Sans MS"
  255.          Size            =   27.75
  256.          Charset         =   0
  257.          Weight          =   400
  258.          Underline       =   0   'False
  259.          Italic          =   0   'False
  260.          Strikethrough   =   0   'False
  261.       EndProperty
  262.       Height          =   780
  263.       Left            =   3000
  264.       TabIndex        =   11
  265.       Top             =   1800
  266.       Width           =   6900
  267.    End
  268.    Begin VB.Shape yellow 
  269.       BackColor       =   &H0000FFFF&
  270.       BackStyle       =   1  'Opaque
  271.       FillColor       =   &H0000FFFF&
  272.       Height          =   735
  273.       Left            =   2640
  274.       Shape           =   3  'Circle
  275.       Top             =   3360
  276.       Visible         =   0   'False
  277.       Width           =   975
  278.    End
  279.    Begin VB.Shape green 
  280.       BackColor       =   &H0000C000&
  281.       BackStyle       =   1  'Opaque
  282.       BorderStyle     =   6  'Inside Solid
  283.       Height          =   735
  284.       Left            =   2760
  285.       Shape           =   3  'Circle
  286.       Top             =   5280
  287.       Visible         =   0   'False
  288.       Width           =   735
  289.    End
  290.    Begin VB.Shape red 
  291.       BackColor       =   &H000000FF&
  292.       BackStyle       =   1  'Opaque
  293.       BorderStyle     =   6  'Inside Solid
  294.       Height          =   735
  295.       Left            =   2760
  296.       Shape           =   3  'Circle
  297.       Top             =   4320
  298.       Visible         =   0   'False
  299.       Width           =   735
  300.    End
  301. Attribute VB_Name = "Explorer"
  302. Attribute VB_GlobalNameSpace = False
  303. Attribute VB_Creatable = False
  304. Attribute VB_PredeclaredId = True
  305. Attribute VB_Exposed = False
  306. '****Updated Version, May 29,1999****
  307. 'Higher Level Of Security!! Now With Disabled CTRL+ALT+DEL keys and mouse trap!
  308. 'Even Higher Level Of Seciurity!! Now With 'Always On Top' Function and Encryption also with optional All Acess Administrators Code!
  309. '*********************************************************************
  310. '*********************************************************************
  311. ' Step 1: create 10 command buttons, name them: pad0, pad1, pad2, etc. all they way from 0-9
  312. ' Step 2: create 4 more command buttons, name them: padAsterik, cmdEnter, and padPound, and clear
  313. ' Step 3: Set the caption to the command buttons according to their names
  314. ' Ex1. pad0 would have a caption of 0
  315. ' Ex2. padAsterik would have a caption of *
  316. ' Ex3. padPound would have a caption of #
  317. ' Ex.4 Clear would have a caption of 'Clear the code i entered, its wrong'
  318. ' Step4: create 2 textboxes: EnteredCode.text, CorrectCode.text
  319. ' Step5: set these textboxes to be behind a command button, they should not be viewable to the user
  320. ' Step6: Name your form Explorer
  321. ' Step7: Follow these settings for 'Explorer'
  322. ' BorderSyle...0 - None
  323. ' Caption...Computer Security System
  324. ' FillStyle...1 - Transparent
  325. ' Height 6465
  326. ' Movable...False
  327. ' ScaleWidth... 516.75
  328. ' ShowInTaskbar...False
  329. ' Width...10335
  330. ' WindowState...2 - Maximized
  331. ' Step 8: Set the name of the project to Explore
  332. ' Step 9: Select the Project menu in VB 5.0 (don't know if its in any other version)
  333. ' Step10: Select 'Explore Properties'
  334. ' Step11: Follow this:
  335. ' In the default folder, 'General'
  336. ' set the 'StartUp Object' combobox to 'Explorer
  337. ' Project Name: Explore
  338. ' Project Description: Security System
  339. ' Select the next folder tab, 'Make'
  340. ' Change the Icon to whatever you want
  341. ' Title: Explorer
  342. ' Step12: Create 3 Shapes, make them circles, 1 red, 1 green, 1 yellow
  343. '   Name them 'yellow' 'green' and 'red' Also, make them all NOT visible
  344. 'WARNING: This will not protect all computers, this is just a thing I made
  345. ' to keep my brothers of my computer
  346. ' Finally, the last step,well actually the second to last step
  347. ' Copy Coding below EXACTLY
  348. ' Now, the last step, after you save it and everything and you compile it
  349. ' place a shortcut in the start menu so it will startup with your computer
  350. '   or find another way to load on startup, such as Win.INI or the Registry
  351. ' Note: If you cannot get this to work email me and ill send the working Source code
  352. ' And I also Highly RECCOMEND that you use my source, because I may have left out some settings
  353. ' for the Form: Explorer
  354. ' Original Code Created by Tyler Robbins, Tuesday and Wednesday May 26, and 27 1999
  355. ' Updated Code Created by Tyler Robbins, Saturday, May 29 1999
  356. ' Updated Code Created by Tyler Robbins, Monday June 7 1999
  357. '**************************************************************
  358. '***************************************************************
  359. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  360. Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
  361. Private Sub clear_Click()
  362. EnteredCode.Text = "" 'clears the entered code
  363. End Sub
  364. Private Sub cmdEnter_Click() 'Cmdenter: executes the alarm process
  365. If EnteredCode.Text = Text1.Text Or EnteredCode.Text = "#1010861057117975163677064*" Then 'if user's entered code is the same as the password then
  366.             If EnteredCode.Text = "#1010861057117975163677064*" Then
  367.                 allacess = "yes"
  368.             Else
  369.             End If
  370.              yellow.Visible = False 'turn off yellow light
  371.         green.Visible = True 'turn on green light
  372.             If allacess = "yes" Then
  373.                 MsgBox ("All Acess Administrative Password Accepted")
  374.             Else
  375.             MsgBox ("Correct Password")
  376.             End If
  377. MsgBox ("Access Granted!!")
  378. Else 'if the user's entered code isn't the same as the password then
  379. yellow.Visible = False 'turn off yellow light
  380. red.Visible = True 'turns on yellow light
  381. MsgBox ("Sorry, Incorrect Password, Have A Good Day!!") '
  382. returnvalue = Shell("c:\windows\rundll.exe user.exe,exitwindows", 1) 'Shuts down the computer
  383. End If
  384. End Sub
  385. Private Sub Form_Load()
  386. Call Disable_Ctrl_Alt_Del ' Disables CTRL+ALT+DEL
  387. EnableTrap Explorer 'Enables Mouse Trapping
  388. Text1.Visible = False
  389. allacess = ""
  390. CorrectCode = ""
  391. EnteredCode.Text = "" 'any of the numbers 0-9, "#", and "*"
  392. yellow.Visible = True 'tells the yellow circle, or standby light to be on
  393. worm = GetSetting("xyzxx", 0, "c") 'Finds out how many times this program
  394. worm = Val(worm) + 1                          'has been loaded
  395. SaveSetting "xyzxx", 0, "c", worm
  396. If worm = 1 Then 'set password and ask if you want timer
  397. PW = InputBox("Enter What You Want Your Password to be, It May Be Up to 44 digits long Please, Numbers Only")
  398. SaveSetting "xyzxx", 0, "R", PW * 101086.1057            'Encryption
  399. MsgBox ("Reminder: Your Password is: ")
  400. MsgBox PW
  401. MsgBox ("Do not forget this password, since this is your 1st use this is the only time it will be displayed")
  402. TimerSelect = InputBox("Do you want a timer that will automatically shut down your computer after 1 hour of the password not being entered? [Type yes or no]")
  403. SaveSetting "xyzxx", 0, "T", TimerSelect
  404. End If
  405. CorrectCode = GetSetting("xyzxx", 0, "R")
  406. Text1.Text = CorrectCode / 101086.1057 ' Decryption
  407. timercontroller = GetSetting("xyzxx", 0, "T")
  408. If timercontroller = "no" Then
  409. Label3.Visible = False
  410. Label4.Visible = False
  411. Timer1.Enabled = False
  412. timeLeft.Visible = False
  413. End If
  414. End Sub
  415. Sub AlwaysOnTop(FrmID As Form, OnTop As Integer)
  416.     ' This function uses an argument to determine whether
  417.     ' to make the specified form always on top or not
  418.     Const SWP_NOMOVE = 2
  419.     Const SWP_NOSIZE = 1
  420.     Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  421.     Const HWND_TOPMOST = -1
  422.     Const HWND_NOTOPMOST = -2
  423.     If OnTop Then
  424.         OnTop = SetWindowPos(FrmID.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  425.     Else
  426.         OnTop = SetWindowPos(FrmID.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  427.     End If
  428. End Sub
  429. Private Sub Explorer_Unload()
  430. Call Enable_Ctrl_Alt_Del 'Re-Enables CTRL+ALT+DEL
  431. DisableTrap Explorer 'Re enables the mouse to move around the screen
  432. End Sub
  433. Private Sub pad0_Click()
  434. EnteredCode = EnteredCode & "0" 'Enteredcode(or the code the user has entered)...
  435. End Sub                         'gets a 0 added to it
  436. Private Sub pad1_Click()
  437. EnteredCode = EnteredCode & "1" 'entercode gets a 1 added to it
  438. End Sub
  439. Private Sub pad2_Click()
  440. EnteredCode = EnteredCode & "2" 'entercode gets a 2 added to it
  441. End Sub
  442. Private Sub pad3_Click()
  443. EnteredCode = EnteredCode & "3" 'entercode gets a 3 added to it
  444. End Sub
  445. Private Sub pad4_Click()
  446. EnteredCode = EnteredCode & "4" 'entercode gets a 4 added to it
  447. End Sub
  448. Private Sub pad5_Click()
  449. EnteredCode = EnteredCode & "5" 'entercode gets a 5 added to it
  450. End Sub
  451. Private Sub pad6_Click()
  452. EnteredCode = EnteredCode & "6" 'entercode gets a 6 added to it
  453. End Sub
  454. Private Sub pad7_Click()
  455. EnteredCode = EnteredCode & "7" 'entercode gets a 7 added to it
  456. End Sub
  457. Private Sub pad8_Click()
  458. EnteredCode = EnteredCode & "8" 'entercode gets a 8 added to it
  459. End Sub
  460. Private Sub pad9_Click()
  461. EnteredCode = EnteredCode & "9" 'entercode gets a 9 added to it
  462. End Sub
  463. Private Sub padAsterik_Click()
  464. EnteredCode = EnteredCode & "*" 'entercode gets a * added to it
  465. End Sub
  466. Private Sub padPound_Click()
  467. EnteredCode = EnteredCode & "#" 'entercode gets a # added to it
  468. End Sub
  469. Private Sub Timer1_Timer()
  470. Timer1.Enabled = False
  471. Timer1.Enabled = True
  472. timeLeft = timeLeft - 1
  473. If timeLeft = 0 Then
  474. returnvalue = Shell("c:\windows\rundll.exe user.exe,exitwindows", 1)
  475. End If
  476. End Sub
  477. ' Ok, this shows what a 12 year old that has been programming in VB for 3 or 4 weeks can do
  478. ' I used no books, but all you out there, Try using the VB Help File!!
  479. ' Its hard to understand at first but you'll get the hang of it
  480. ' Also, if you have a background in QuickBasic, or Basic, then you pretty
  481. ' Much know the basics of this program
  482. ' -Tyler Robbins May, 26 1999
  483.