home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Register_O2133071132008.psc / frmmain.frm < prev    next >
Text File  |  2008-10-31  |  7KB  |  222 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form frmmain 
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "RegThem"
  6.    ClientHeight    =   5040
  7.    ClientLeft      =   45
  8.    ClientTop       =   375
  9.    ClientWidth     =   5070
  10.    Icon            =   "frmmain.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   5040
  16.    ScaleWidth      =   5070
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.Timer tmr 
  19.       Enabled         =   0   'False
  20.       Interval        =   1500
  21.       Left            =   5400
  22.       Top             =   120
  23.    End
  24.    Begin RegThem.XandersXPProgressBar pb 
  25.       Height          =   255
  26.       Left            =   120
  27.       TabIndex        =   3
  28.       Top             =   4680
  29.       Width           =   4815
  30.       _ExtentX        =   8493
  31.       _ExtentY        =   450
  32.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  33.          Name            =   "MS Sans Serif"
  34.          Size            =   8.25
  35.          Charset         =   0
  36.          Weight          =   400
  37.          Underline       =   0   'False
  38.          Italic          =   0   'False
  39.          Strikethrough   =   0   'False
  40.       EndProperty
  41.       BrushStyle      =   0
  42.       Color           =   13405804
  43.       Scrolling       =   3
  44.       Value           =   62
  45.    End
  46.    Begin VB.FileListBox filelist 
  47.       Height          =   4185
  48.       Left            =   6240
  49.       TabIndex        =   1
  50.       Top             =   120
  51.       Width           =   3135
  52.    End
  53.    Begin MSComctlLib.ListView files 
  54.       Height          =   4095
  55.       Left            =   120
  56.       TabIndex        =   0
  57.       Top             =   120
  58.       Width           =   4815
  59.       _ExtentX        =   8493
  60.       _ExtentY        =   7223
  61.       View            =   3
  62.       LabelWrap       =   -1  'True
  63.       HideSelection   =   -1  'True
  64.       GridLines       =   -1  'True
  65.       _Version        =   393217
  66.       ForeColor       =   -2147483640
  67.       BackColor       =   -2147483643
  68.       BorderStyle     =   1
  69.       Appearance      =   1
  70.       NumItems        =   3
  71.       BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  72.          Text            =   "Name"
  73.          Object.Width           =   2646
  74.       EndProperty
  75.       BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  76.          Alignment       =   2
  77.          SubItemIndex    =   1
  78.          Text            =   "Type"
  79.          Object.Width           =   1058
  80.       EndProperty
  81.       BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
  82.          Alignment       =   2
  83.          SubItemIndex    =   2
  84.          Text            =   "Location"
  85.          Object.Width           =   4621
  86.       EndProperty
  87.    End
  88.    Begin VB.Label txt 
  89.       BackStyle       =   0  'Transparent
  90.       Caption         =   "Label1"
  91.       Height          =   255
  92.       Left            =   120
  93.       TabIndex        =   2
  94.       Top             =   4320
  95.       Width           =   4695
  96.    End
  97. End
  98. Attribute VB_Name = "frmmain"
  99. Attribute VB_GlobalNameSpace = False
  100. Attribute VB_Creatable = False
  101. Attribute VB_PredeclaredId = True
  102. Attribute VB_Exposed = False
  103. '////////////////////////////////////////////////////////////////////////////////////////////////
  104. '///Coded By    :   Ratul Ahmed/////
  105. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106. '///I Love my sweet Bangladesh////
  107. '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108. '///////////////////////////////
  109. '                               ////////////////////////////////////////////////////////////////
  110.  
  111.  
  112.  
  113. Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
  114. Private Declare Function InitCommonControls Lib "comctl32.dll" () As Long
  115. Dim IngSuccess As Long
  116. Dim v As Integer
  117. Dim sys As String
  118.  
  119. Private Sub get_OCX()
  120. filelist.Pattern = "*.ocx"  '.............................Set File filters to *.OCX
  121. filelist.Path = App.Path    '.............................Set File List Path
  122. If filelist.ListCount <> 0 Then pb.Max = filelist.ListCount
  123. pb.Value = 0
  124. Me.Caption = "Collecting *.ocx files..."
  125.  
  126.     For v = 0 To filelist.ListCount
  127.         If filelist.List(v) <> "" Then
  128.             With files.ListItems.Add
  129.                 .Text = filelist.List(v)
  130.                 .SubItems(1) = "OCX"
  131.                 .SubItems(2) = App.Path & "\" & filelist.List(v)
  132.             End With
  133.             pb.Value = pb.Value + 1
  134.             Sleep 250
  135.         End If
  136.         txt = files.ListItems.Count & " Itms added."
  137.     Next v
  138.  
  139. filelist.Pattern = "*.dll"  '.............................Set File filters to *.OCX
  140. filelist.Path = App.Path    '.............................Set File List Path
  141. If filelist.ListCount <> 0 Then pb.Max = filelist.ListCount
  142. pb.Value = 0
  143. Me.Caption = "Collecting *.dll files..."
  144.  
  145.     For v = 0 To filelist.ListCount
  146.         If filelist.List(v) <> "" Then
  147.             With files.ListItems.Add
  148.                 .Text = filelist.List(v)
  149.                 .SubItems(1) = "DLL"
  150.                 .SubItems(2) = App.Path & "\" & filelist.List(v)
  151.             End With
  152.             pb.Value = pb.Value + 1
  153.             Sleep 250
  154.         End If
  155.         txt = files.ListItems.Count & " Items added."
  156.     Next v
  157.     
  158. Me.Caption = "Collected " & files.ListItems.Count & " Files"
  159. files.Refresh
  160. If files.ListItems.Count <> 0 Then
  161.     txt = "Processing Files..."
  162.     txt.Refresh
  163.     reg_them
  164.     pb.Value = 0
  165. Else
  166.     MsgBox "No item founded to process!", vbExclamation, "Error"
  167.     End
  168. End If
  169. End Sub
  170.  
  171. Private Sub reg_them()
  172. Dim cmd As String
  173. On Error Resume Next
  174. sys = GetSystemDirectory
  175.  
  176. Sleep 1000
  177. Me.Caption = "Registering Collected *.ocx & *.dll ..."
  178.  
  179. pb.Max = files.ListItems.Count
  180. pb.Value = 0
  181.  
  182.     For v = 0 To files.ListItems.Count
  183.     If files.ListItems.Item(v) <> 0 Then
  184.             Me.Caption = "Handeling file " & files.ListItems.Item(v) & " ..."
  185.             pb.Value = pb.Value + 1
  186.             files.ListItems.Item(v).Selected = True
  187.             Sleep 100
  188.             cmd = ""
  189.             files.Refresh
  190.             cmd = sys & "regsvr32.exe -s" & " " & Chr(34) & App.Path & "\" & files.ListItems.Item(v) & Chr(34)
  191.             If cmd <> "" Then
  192.                 Sleep 250
  193.                 DOShell cmd, vbHide '........................................calling regsvr32.exe
  194.             End If
  195.     End If
  196.     Next v
  197. txt = "Finished"
  198. txt.Refresh
  199. MsgBox "Processing completed!", vbInformation, "Done"
  200. End
  201. End Sub
  202.  
  203. Private Sub Form_DblClick()
  204. MsgBox "Coded by Ratul Ahmed. ⌐ aeon software", vbInformation, "About"
  205. End Sub
  206.  
  207. Private Sub Form_Initialize()
  208. InitCommonControls
  209. End Sub
  210.  
  211. Private Sub Form_Load()
  212. txt = "Collecting files..."
  213. pb.Value = 0
  214. tmr.Enabled = True
  215. End Sub
  216.  
  217. Private Sub tmr_Timer()
  218. get_OCX
  219. tmr.Enabled = False
  220. End Sub
  221.  
  222.