Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

/Util/CPU/CPU ID
Function:
Required plugins for this example: MBS Util Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Util/CPU/CPU ID
This example is the version from Sun, 17th Mar 2012.
Project "CPU ID.rbp"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
Control StaticText1 Inherits Label
ControlInstance StaticText1 Inherits Label
End Control
Control StaticText2 Inherits Label
ControlInstance StaticText2 Inherits Label
End Control
Control StaticText3 Inherits Label
ControlInstance StaticText3 Inherits Label
End Control
Control StaticText4 Inherits Label
ControlInstance StaticText4 Inherits Label
End Control
Control Vendor Inherits Label
ControlInstance Vendor Inherits Label
End Control
Control Family Inherits Label
ControlInstance Family Inherits Label
End Control
Control Model Inherits Label
ControlInstance Model Inherits Label
End Control
Control Stepping Inherits Label
ControlInstance Stepping Inherits Label
End Control
Control StaticText5 Inherits Label
ControlInstance StaticText5 Inherits Label
End Control
Control cpuname Inherits Label
ControlInstance cpuname Inherits Label
End Control
Control brand Inherits Label
ControlInstance brand Inherits Label
End Control
EventHandler Sub Open() dim c as CPUIDMBS dim s as string c=new CPUIDMBS if c.Family=0 then MsgBox "This demo requires a x86 CPU, but you have a "+SystemInformationMBS.CPUBrandString quit end if Vendor.text=c.ProcessorVendor Family.text=hex(c.Family) Model.text=hex(c.Model) Stepping.text=hex(c.Stepping) // The following list is not complete! s="unknown" Select case c.Family case 4 s="486" case 5 s="Pentium" case 6 Select case c.model case 1 s="Pentium Pro" case 3 s="Pentium II" case 5 s="Pentium II" case 6 s="Celeron" case 7 s="Pentium III" case 8 s="Pentium III" case 9 s="Pentium M" case 10 s="Pentium III XEON" case 11 s="Pentium III" case 13 s="Pentium M" case 14 s="Core Duo" else s = "Unknown Model: "+str(c.model) end Select case 15 s="Pentium 4" else s = "Unknown Family: "+str(c.Family) end Select cpuname.text=s brand.text=c.BrandString End EventHandler
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
End Project

See also:

Feedback, Comments & Corrections

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




Links
MBS Xojo Plugins