Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Win/Windows Disc Info
Function:
Required plugins for this example: MBS Win Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Win/Windows Disc Info
This example is the version from Sun, 17th Mar 2012.
Project "Windows Disc Info.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Sub ExpandRow(row As Integer) dim w as WindowsDiscInfoMBS = me.RowTag(row) me.AddRow "BufferSize", str(w.BufferSize) me.AddRow "BytesPerSector", str(w.BytesPerSector) me.AddRow "Drive", str(w.Drive) me.AddRow "Mode", str(w.Mode) me.AddRow "ModelNumber", w.ModelNumber me.AddRow "ProductRevision", w.ProductRevision me.AddRow "Removable", str(w.Removable) me.AddRow "RevisionNumber", w.RevisionNumber me.AddRow "SectorsPerTrack", str(w.SectorsPerTrack) me.AddRow "SerialNumber", w.SerialNumber me.AddRow "Size", str(w.Size) me.AddRow "TracksPerCylinder", str(w.TracksPerCylinder) me.AddRow "VendorId", w.VendorId End EventHandler
End Control
EventHandler Sub Open() // enumerate all drives dim discs(-1) as WindowsDiscInfoMBS = WindowsDiscInfoMBS.Devices for each disc as WindowsDiscInfoMBS in discs List.Addfolder "Drive "+str(Disc.Drive) List.RowTag(List.LastIndex)=disc next // get drive by volume letter for i as integer = 65 to 90 dim letter as string = encodings.ASCII.Chr(i) dim disc as WindowsDiscInfoMBS = WindowsDiscInfoMBS.Device(letter) if disc<>Nil then List.Addfolder letter+":" List.RowTag(List.LastIndex)=disc end if next // get by folderitem letter dim disc as WindowsDiscInfoMBS = WindowsDiscInfoMBS.Device(volume(0)) // volume(0) is boot volume if disc<>Nil then List.Addfolder "Boot Volume" List.RowTag(List.LastIndex)=disc end if End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
Module Module1
Sub AddRow(extends l as listbox, cell1 as string, cell2 as string) System.DebugLog cell1 System.DebugLog cell2 l.AddRow cell1 l.Cell(l.LastIndex,1)=Cell2 End Sub
End Module
End Project

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS Win Plugin.




Links
MBS Xojo blog