source: DRBLLiveHelper/FormatPage.frm @ 34

Last change on this file since 34 was 13, checked in by sunny, 16 years ago
File size: 8.3 KB
Line 
1VERSION 5.00
2Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
3Begin VB.Form FormatPage
4   BackColor       =   &H00FFFFFF&
5   Caption         =   "DRBL Helper"
6   ClientHeight    =   1935
7   ClientLeft      =   4305
8   ClientTop       =   5565
9   ClientWidth     =   7560
10   Icon            =   "FormatPage.frx":0000
11   LinkTopic       =   "Form1"
12   MaxButton       =   0   'False
13   ScaleHeight     =   1935
14   ScaleWidth      =   7560
15   Begin MSForms.CommandButton cmdPrevious
16      Height          =   375
17      Left            =   3600
18      TabIndex        =   7
19      Top             =   1440
20      Width           =   1215
21      Caption         =   "Previous"
22      Size            =   "2143;661"
23      FontName        =   "·s²Ó©úÅé"
24      FontHeight      =   180
25      FontCharSet     =   136
26      FontPitchAndFamily=   34
27      ParagraphAlign  =   3
28   End
29   Begin MSForms.CommandButton cmdExit
30      Height          =   375
31      Left            =   6240
32      TabIndex        =   6
33      Top             =   1440
34      Width           =   1215
35      Caption         =   "Exit"
36      Size            =   "2143;661"
37      FontName        =   "·s²Ó©úÅé"
38      FontHeight      =   180
39      FontCharSet     =   136
40      FontPitchAndFamily=   34
41      ParagraphAlign  =   3
42   End
43   Begin MSForms.CommandButton cmdNext
44      Height          =   375
45      Left            =   4920
46      TabIndex        =   5
47      Top             =   1440
48      Width           =   1215
49      Caption         =   "Next"
50      Size            =   "2143;661"
51      FontName        =   "·s²Ó©úÅé"
52      FontHeight      =   180
53      FontCharSet     =   136
54      FontPitchAndFamily=   34
55      ParagraphAlign  =   3
56   End
57   Begin MSForms.CommandButton cmdRun
58      Height          =   375
59      Left            =   3600
60      TabIndex        =   4
61      Top             =   720
62      Width           =   3855
63      Caption         =   "Format USB flash drive"
64      Size            =   "6800;661"
65      FontName        =   "·s²Ó©úÅé"
66      FontHeight      =   180
67      FontCharSet     =   136
68      FontPitchAndFamily=   34
69      ParagraphAlign  =   3
70   End
71   Begin MSForms.ComboBox DeviceCombo
72      Height          =   375
73      Left            =   4440
74      TabIndex        =   3
75      Top             =   240
76      Width           =   3015
77      VariousPropertyBits=   746604571
78      DisplayStyle    =   3
79      Size            =   "5318;661"
80      MatchEntry      =   1
81      ShowDropButtonWhen=   2
82      FontName        =   "·s²Ó©úÅé"
83      FontHeight      =   180
84      FontCharSet     =   136
85      FontPitchAndFamily=   34
86   End
87   Begin MSForms.Label lbl1
88      Height          =   495
89      Left            =   2280
90      TabIndex        =   2
91      Top             =   240
92      Width           =   2055
93      ForeColor       =   12632064
94      BackColor       =   16777215
95      VariousPropertyBits=   8388627
96      Caption         =   "Select USB flash drive"
97      Size            =   "3625;873"
98      FontName        =   "·s²Ó©úÅé"
99      FontHeight      =   180
100      FontCharSet     =   136
101      FontPitchAndFamily=   34
102   End
103   Begin VB.Label lbl3
104      BackStyle       =   0  '³z©ú
105      Caption         =   "http://clonezilla.sf.net"
106      BeginProperty Font
107         Name            =   "Arial"
108         Size            =   9
109         Charset         =   0
110         Weight          =   400
111         Underline       =   -1  'True
112         Italic          =   0   'False
113         Strikethrough   =   0   'False
114      EndProperty
115      ForeColor       =   &H00FF8080&
116      Height          =   255
117      Left            =   1800
118      TabIndex        =   1
119      Top             =   840
120      Width           =   2535
121   End
122   Begin VB.Label lbl2
123      BackStyle       =   0  '³z©ú
124      Caption         =   "http://drbl.sf.net"
125      BeginProperty Font
126         Name            =   "Arial"
127         Size            =   9
128         Charset         =   0
129         Weight          =   400
130         Underline       =   -1  'True
131         Italic          =   0   'False
132         Strikethrough   =   0   'False
133      EndProperty
134      ForeColor       =   &H00FF8080&
135      Height          =   255
136      Left            =   1800
137      TabIndex        =   0
138      Top             =   1200
139      Width           =   1455
140   End
141   Begin VB.Image Image1
142      Height          =   1935
143      Left            =   0
144      Picture         =   "FormatPage.frx":0CCA
145      Stretch         =   -1  'True
146      Top             =   0
147      Width           =   1935
148   End
149End
150Attribute VB_Name = "FormatPage"
151Attribute VB_GlobalNameSpace = False
152Attribute VB_Creatable = False
153Attribute VB_PredeclaredId = True
154Attribute VB_Exposed = False
155Dim msg As String
156
157Sub SetDriveCombo()
158                   
159   Dim fso, d, dc, item
160   
161   Me.DeviceCombo.Clear
162   
163   Set fso = CreateObject("Scripting.FileSystemObject")
164   Set dc = fso.Drives
165
166   For Each d In dc
167     
168      If (d.DriveType = 1) And d.IsReady Then
169
170         item = d.DriveLetter & " - " & d.VolumeName & " : " & d.FileSystem
171         Me.DeviceCombo.AddItem (item)
172         'MsgBox "add drive: " & item
173      End If
174
175   Next
176   
177    If Me.DeviceCombo.ListCount = 0 Then
178       Me.DeviceCombo.AddItem ("No Devie Found")
179    End If
180   
181End Sub
182
183Function GetDrive()
184   Dim fso, drive, dc, s, ds
185   Dim strCmd, d As String
186   Dim idx, dsSize As Integer
187   
188   dsSize = 0
189   Set fso = CreateObject("Scripting.FileSystemObject")
190   Set dc = fso.Drives
191   s = ""
192   For Each drive In dc
193      If (drive.DriveType = 1) And drive.IsReady Then
194         If s = "" Then
195            s = drive.DriveLetter
196         Else
197            s = s & "," & drive.DriveLetter
198         End If
199         dsSize = dsSize + 1
200      End If
201   Next
202   
203   ds = Split(s, ",")
204
205   idx = Me.DeviceCombo.ListIndex
206
207   If idx > -1 And idx < dsSize Then
208       d = ds(idx)
209   Else
210       d = ""
211   End If
212   GetDrive = d
213End Function
214
215Private Sub cmdExit_Click()
216    If LanguagePage.Visible = False Then
217        Unload LanguagePage
218    End If
219 
220  If InstallPage.Visible = False Then
221    Unload InstallPage
222  End If
223 
224  If BootPage.Visible = False Then
225    Unload BootPage
226  End If
227 
228  Unload Me
229End Sub
230
231Private Sub cmdPrevious_Click()
232  Me.Hide
233  LanguagePage.Show
234End Sub
235
236Private Sub cmdRun_Click()
237   Dim HPPath, d, args
238   
239   d = GetDrive()
240   
241   If d = "" Then
242       'MsgBox msg
243       ReadyDialog.lblMsg.Caption = msg
244       AlwaysOnTop ReadyDialog, True
245       ReadyDialog.Show
246       
247       Exit Sub
248   End If
249   
250   'Format usb flash drive
251   HPPath = GetRegKeyValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Y:\ThinClient\HPUSBFW\Data Files\HPUSBFW.EXE", "Path")
252   If HPPath = "" Then
253      AlwaysOnTop InstallHPDialog, True
254      InstallHPDialog.Show
255      Exit Sub
256   End If
257   args = d & ": -FS:FAT32 -Q -Y"
258   HPPath = """" & HPPath & "\HPUSBF.EXE"" " & args
259   ExecCmd (HPPath)
260   
261   
262End Sub
263
264Private Sub cmdNext_Click()
265   d = GetDrive()
266   
267   If d = "" Then
268       'MsgBox msg
269       ReadyDialog.lblMsg.Caption = msg
270       AlwaysOnTop ReadyDialog, True
271       ReadyDialog.Show
272       
273       Exit Sub
274   End If
275   SetDriveID (d)
276   Me.Hide
277   InstallPage.Show
278End Sub
279
280
281Private Sub DeviceCombo_DropDown()
282   SetDriveCombo
283End Sub
284
285
286Private Sub Form_Load()
287    Me.Top = LanguagePage.Top
288    Me.Left = LanguagePage.Left
289   SetLocale
290End Sub
291
292Public Sub SetLocale()
293   '
294   msg = "Please select an USB flash drive."
295
296    If (LoadLocalizedResources) Then
297       ' Pull a string resource out of a local resource
298       ' object for demonstration purposes.
299       lbl1.Caption = GetString(0)
300       cmdRun.Caption = GetString(1)
301       cmdNext.Caption = GetString(3)
302       cmdExit.Caption = GetString(4)
303       cmdPrevious.Caption = GetString(16)
304       'Me.Caption = GetString()
305       msg = GetString(2)
306    End If
307   
308   '
309   SetDriveCombo
310
311End Sub
312
313Private Sub lbl2_Click()
314    ShellExecute hwnd, "Open", lbl2.Caption, "", App.path, 1
315End Sub
316
317Private Sub lbl3_Click()
318    ShellExecute hwnd, "Open", lbl3.Caption, "", App.path, 1
319End Sub
Note: See TracBrowser for help on using the repository browser.