VERSION 5.00 Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL" Begin VB.Form FormatPage BackColor = &H00FFFFFF& Caption = "DRBL Helper" ClientHeight = 1935 ClientLeft = 4305 ClientTop = 5565 ClientWidth = 7560 Icon = "FormatPage.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 1935 ScaleWidth = 7560 Begin MSForms.CommandButton cmdPrevious Height = 375 Left = 3600 TabIndex = 7 Top = 1440 Width = 1215 Caption = "Previous" Size = "2143;661" FontName = "新細明體" FontHeight = 180 FontCharSet = 136 FontPitchAndFamily= 34 ParagraphAlign = 3 End Begin MSForms.CommandButton cmdExit Height = 375 Left = 6240 TabIndex = 6 Top = 1440 Width = 1215 Caption = "Exit" Size = "2143;661" FontName = "新細明體" FontHeight = 180 FontCharSet = 136 FontPitchAndFamily= 34 ParagraphAlign = 3 End Begin MSForms.CommandButton cmdNext Height = 375 Left = 4920 TabIndex = 5 Top = 1440 Width = 1215 Caption = "Next" Size = "2143;661" FontName = "新細明體" FontHeight = 180 FontCharSet = 136 FontPitchAndFamily= 34 ParagraphAlign = 3 End Begin MSForms.CommandButton cmdRun Height = 375 Left = 3600 TabIndex = 4 Top = 720 Width = 3855 Caption = "Format USB flash drive" Size = "6800;661" FontName = "新細明體" FontHeight = 180 FontCharSet = 136 FontPitchAndFamily= 34 ParagraphAlign = 3 End Begin MSForms.ComboBox DeviceCombo Height = 375 Left = 4440 TabIndex = 3 Top = 240 Width = 3015 VariousPropertyBits= 746604571 DisplayStyle = 3 Size = "5318;661" MatchEntry = 1 ShowDropButtonWhen= 2 FontName = "新細明體" FontHeight = 180 FontCharSet = 136 FontPitchAndFamily= 34 End Begin MSForms.Label lbl1 Height = 495 Left = 2280 TabIndex = 2 Top = 240 Width = 2055 ForeColor = 12632064 BackColor = 16777215 VariousPropertyBits= 8388627 Caption = "Select USB flash drive" Size = "3625;873" FontName = "新細明體" FontHeight = 180 FontCharSet = 136 FontPitchAndFamily= 34 End Begin VB.Label lbl3 BackStyle = 0 '透明 Caption = "http://clonezilla.sf.net" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = -1 'True Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF8080& Height = 255 Left = 1800 TabIndex = 1 Top = 840 Width = 2535 End Begin VB.Label lbl2 BackStyle = 0 '透明 Caption = "http://drbl.sf.net" BeginProperty Font Name = "Arial" Size = 9 Charset = 0 Weight = 400 Underline = -1 'True Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H00FF8080& Height = 255 Left = 1800 TabIndex = 0 Top = 1200 Width = 1455 End Begin VB.Image Image1 Height = 1935 Left = 0 Picture = "FormatPage.frx":0CCA Stretch = -1 'True Top = 0 Width = 1935 End End Attribute VB_Name = "FormatPage" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim msg As String Sub SetDriveCombo() Dim fso, d, dc, item Me.DeviceCombo.Clear Set fso = CreateObject("Scripting.FileSystemObject") Set dc = fso.Drives For Each d In dc If (d.DriveType = 1) And d.IsReady Then item = d.DriveLetter & " - " & d.VolumeName & " : " & d.FileSystem Me.DeviceCombo.AddItem (item) 'MsgBox "add drive: " & item End If Next If Me.DeviceCombo.ListCount = 0 Then Me.DeviceCombo.AddItem ("No Devie Found") End If End Sub Function GetDrive() Dim fso, drive, dc, s, ds Dim strCmd, d As String Dim idx, dsSize As Integer dsSize = 0 Set fso = CreateObject("Scripting.FileSystemObject") Set dc = fso.Drives s = "" For Each drive In dc If (drive.DriveType = 1) And drive.IsReady Then If s = "" Then s = drive.DriveLetter Else s = s & "," & drive.DriveLetter End If dsSize = dsSize + 1 End If Next ds = Split(s, ",") idx = Me.DeviceCombo.ListIndex If idx > -1 And idx < dsSize Then d = ds(idx) Else d = "" End If GetDrive = d End Function Private Sub cmdExit_Click() If LanguagePage.Visible = False Then Unload LanguagePage End If If InstallPage.Visible = False Then Unload InstallPage End If If BootPage.Visible = False Then Unload BootPage End If Unload Me End Sub Private Sub cmdPrevious_Click() Me.Hide LanguagePage.Show End Sub Private Sub cmdRun_Click() Dim HPPath, d, args d = GetDrive() If d = "" Then 'MsgBox msg ReadyDialog.lblMsg.Caption = msg AlwaysOnTop ReadyDialog, True ReadyDialog.Show Exit Sub End If 'Format usb flash drive HPPath = GetRegKeyValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Y:\ThinClient\HPUSBFW\Data Files\HPUSBFW.EXE", "Path") If HPPath = "" Then AlwaysOnTop InstallHPDialog, True InstallHPDialog.Show Exit Sub End If args = d & ": -FS:FAT32 -Q -Y" HPPath = """" & HPPath & "\HPUSBF.EXE"" " & args ExecCmd (HPPath) End Sub Private Sub cmdNext_Click() d = GetDrive() If d = "" Then 'MsgBox msg ReadyDialog.lblMsg.Caption = msg AlwaysOnTop ReadyDialog, True ReadyDialog.Show Exit Sub End If SetDriveID (d) Me.Hide InstallPage.Show End Sub Private Sub DeviceCombo_DropDown() SetDriveCombo End Sub Private Sub Form_Load() Me.Top = LanguagePage.Top Me.Left = LanguagePage.Left SetLocale End Sub Public Sub SetLocale() ' msg = "Please select an USB flash drive." If (LoadLocalizedResources) Then ' Pull a string resource out of a local resource ' object for demonstration purposes. lbl1.Caption = GetString(0) cmdRun.Caption = GetString(1) cmdNext.Caption = GetString(3) cmdExit.Caption = GetString(4) cmdPrevious.Caption = GetString(16) 'Me.Caption = GetString() msg = GetString(2) End If ' SetDriveCombo End Sub Private Sub lbl2_Click() ShellExecute hwnd, "Open", lbl2.Caption, "", App.path, 1 End Sub Private Sub lbl3_Click() ShellExecute hwnd, "Open", lbl3.Caption, "", App.path, 1 End Sub