Attribute VB_Name = "Module1" Option Explicit Public Const PINVALID = 2 Public Const PINACTIVE = 3 Public Const PACTIVE = 4 Public glbDrives As Byte Public glbNodeSelected As Integer Public glbtmpString As String Public glbNotUpdated As Boolean Public glbMouseButton As Integer Public Type PartData System As String BootID As String Active As Byte End Type Public PartitionList(25, 3) As PartData Public Type PartInfo Name As String * 30 Active As Byte BootID As String * 10 Type As Byte DefBoot As Byte CanBoot As Byte End Type Public Declare Function ReadBootSector Lib "c:\gramming\bootman\bootman.dll" (ByRef MyString As Byte, ByVal Drive As Byte) As Integer Public Declare Function WriteBootInfo Lib "c:\gramming\bootman\bootman.dll" (ByRef MinPartInfo As Byte, ByVal Drive As Byte) As Integer Public Declare Sub GetPartitionInfo Lib "c:\gramming\bootman\bootman.dll" (ByRef MyString As Byte, ByRef Data As PartInfo, ByVal Partition As Byte) Public Function GetPartitionName(strKey As String) As String Dim Drive As Integer Dim Partition As Integer 'Decode the key passed from the TreeView node Drive = Val(Mid(strKey, 2, 1)) Partition = Val(Right(strKey, 1)) GetPartitionName = PartitionList(Drive, Partition).BootID End Function Public Sub SetPartition(NodX As Node, strName As String, Active As Byte, Optional strSystem As String) Dim Drive As Integer Dim Partition As Integer Dim count 'Decode the key passed from the TreeView node Drive = Val(Mid(NodX.Key, 2, 1)) Partition = Val(Right(NodX.Key, 1)) 'strSystem should only ever contain something during initialisation! If (strSystem <> "") Then PartitionList(Drive, Partition).System = Left(strSystem, InStr(strSystem, Chr$(0)) - 1) End If 'Update the partition information NodX.Image = Active NodX.SelectedImage = Active 'Save the default boot name If Active = PACTIVE Then PartitionList(Drive, Partition).Active = 4 PartitionList(Drive, Partition).BootID = Trim(strName) Else PartitionList(Drive, Partition).Active = 0 End If If PartitionList(Drive, Partition).BootID <> "" Then NodX.Text = PartitionList(Drive, Partition).System & " ( " & PartitionList(Drive, Partition).BootID & " )" Else NodX.Text = PartitionList(Drive, Partition).System End If End Sub