home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Basic / Samples / SI_SDK / SI_SDK.ZIP / SYSINFO.BAS < prev    next >
Encoding:
BASIC Source File  |  1993-07-21  |  7.8 KB  |  329 lines

  1. Option Explicit
  2.  
  3. Dim dummy As Integer
  4.  
  5. Function SIGetBIOSDate (cBIOSDate As String) As Integer
  6.  
  7. ReDim cBIOSDateArray(0) As String * 1024
  8. Dim nBIOSDateStatus As Integer
  9.  
  10. nBIOSDateStatus = GetBIOSDate(cBIOSDateArray(0))
  11.  
  12. Select Case nBIOSDateStatus
  13.  
  14.     Case SISDK_FAIL
  15.  
  16.     SIGetBIOSDate = SISDK_FAIL
  17.     cBIOSDate = ""
  18.  
  19.     Case SISDK_SUCCESS
  20.     SIGetBIOSDate = SISDK_SUCCESS
  21.     cBIOSDate = Mid$(cBIOSDateArray(0), 1, InStr(cBIOSDateArray(0), Chr$(0)) - 1)
  22.  
  23. End Select
  24.  
  25. End Function
  26.  
  27. Function SIGetBIOSHighArea () As String
  28.  
  29. ReDim cGetBIOSHighArea(0) As String * 8192
  30. Dim cBIOSHighArea As String
  31.  
  32. dummy% = GetBIOSHighArea(cGetBIOSHighArea(0))
  33.  
  34. cBIOSHighArea = Mid$(cGetBIOSHighArea(0), 1, InStr(cGetBIOSHighArea(0), Chr$(0)) - 1)
  35.  
  36. SIGetBIOSHighArea = cBIOSHighArea
  37.  
  38. End Function
  39.  
  40. Function SIGetBIOSLowArea () As String
  41.  
  42. ReDim cGetBIOSLowArea(0) As String * 8192
  43. Dim cBIOSLowArea As String
  44.  
  45. dummy% = GetBIOSLowArea(cGetBIOSLowArea(0))
  46.  
  47. cBIOSLowArea = Mid$(cGetBIOSLowArea(0), 1, InStr(cGetBIOSLowArea(0), Chr$(0)) - 1)
  48.  
  49. SIGetBIOSLowArea = cBIOSLowArea
  50.  
  51. End Function
  52.  
  53. Function SIGetBIOSManufacturer (nBIOSManufacturer As Integer) As Integer
  54.  
  55. SIGetBIOSManufacturer = GetBIOSManufacturer(nBIOSManufacturer)
  56.  
  57. End Function
  58.  
  59. Function SIGetBusType () As Integer
  60.  
  61. SIGetBusType = GetBusType()
  62.  
  63. End Function
  64.  
  65. Function SIGetCoProcessorType () As Integer
  66.  
  67. SIGetCoProcessorType = GetCoProcessorType()
  68.  
  69. End Function
  70.  
  71. Function SIGetCPUMHz () As Integer
  72.  
  73. SIGetCPUMHz = GetCPUMHz()
  74.  
  75. End Function
  76.  
  77. Function SIGetCPUType () As Integer
  78.  
  79. SIGetCPUType = GetCPUType()
  80.  
  81. End Function
  82.  
  83. Function SIGetDiskDriveType (nDriveNumber As Integer, nDiskDriveType As Integer) As Integer
  84.  
  85. SIGetDiskDriveType = GetDiskDriveType(nDriveNumber, nDiskDriveType)
  86.  
  87. End Function
  88.  
  89. Function SIGetDOSMouseDriverType (nDOSMouseDriverType As Integer) As Integer
  90.  
  91. SIGetDOSMouseDriverType = GetDOSMouseDriverType(nDOSMouseDriverType)
  92.  
  93. End Function
  94.  
  95. Function SIGetDOSMouseDriverVersion (sDOSMouseDriverVersion As Single) As Integer
  96.  
  97. Dim nDOSMouseDriverMinorVersion As Integer
  98. Dim nDOSMouseDriverMajorVersion As Integer
  99. Dim nReturnCode As Integer
  100.  
  101. nReturnCode = GetDOSMouseDriverMinorVersion(nDOSMouseDriverMinorVersion)
  102. nReturnCode = GetDOSMouseDriverMajorVersion(nDOSMouseDriverMajorVersion)
  103.  
  104. Select Case nReturnCode
  105.     
  106.     Case MD_NODOSMOUSEDRIVER
  107.     SIGetDOSMouseDriverVersion = MD_NODOSMOUSEDRIVER
  108.  
  109.     Case SISDK_SUCCESS
  110.     SIGetDOSMouseDriverVersion = SISDK_SUCCESS
  111.     
  112.     If nDOSMouseDriverMinorVersion = 0 Then
  113.         sDOSMouseDriverVersion = CSng(nDOSMouseDriverMajorVersion)
  114.         Else
  115.         sDOSMouseDriverVersion = CSng(nDOSMouseDriverMajorVersion) + CSng(nDOSMouseDriverMinorVersion / 100)
  116.     End If
  117.  
  118. End Select
  119.  
  120. End Function
  121.  
  122. Function SIGetDOSVersion () As Single
  123.  
  124. Dim nDOSMinorVersion As Integer
  125.  
  126. nDOSMinorVersion = GetDOSMinorVersion()
  127.  
  128. If nDOSMinorVersion = 0 Then
  129.     'avoid a divide by zero error
  130.     SIGetDOSVersion = CSng(GetDOSMajorVersion())
  131.     Else
  132.     SIGetDOSVersion = CSng(GetDOSMajorVersion()) + CSng(nDOSMinorVersion / 10)
  133. End If
  134.  
  135. End Function
  136.  
  137. Function SIGetFloppyDriveType (nFloppyDriveNumber As Integer, nFloppyDriveType As Integer) As Integer
  138.  
  139. SIGetFloppyDriveType = GetFloppyDriveType(nFloppyDriveNumber, nFloppyDriveType)
  140.  
  141. End Function
  142.  
  143. Function SIGetFreeDiskSpaceKB (nDriveNumber As Integer, lFreeDiskSpace As Long) As Long
  144.  
  145. SIGetFreeDiskSpaceKB = GetFreeDiskSpaceKB(nDriveNumber, lFreeDiskSpace)
  146.  
  147. End Function
  148.  
  149. Function SIGetHDBytesPerSector (nDriveNumber As Integer, nHDBytesPerSector As Integer) As Integer
  150.  
  151. SIGetHDBytesPerSector = GetHDBytesPerSector(nDriveNumber, nHDBytesPerSector)
  152.  
  153. End Function
  154.  
  155. Function SIGetHDHeads (nDriveNumber As Integer, nHDHeads As Integer) As Integer
  156.  
  157. SIGetHDHeads = GetHDHeads(nDriveNumber, nHDHeads)
  158.  
  159. End Function
  160.  
  161. Function SIGetHDSectorsPerTrack (nDriveNumber As Integer, nHDSectorsPerTrack As Integer) As Integer
  162.  
  163. SIGetHDSectorsPerTrack = GetHDSectorsPerTrack(nDriveNumber, nHDSectorsPerTrack)
  164.  
  165. End Function
  166.  
  167. Function SIGetHDTracks (nDriveNumber As Integer, nHDTracks As Integer) As Integer
  168.  
  169. SIGetHDTracks = GetHDTracks(nDriveNumber, nHDTracks)
  170.  
  171. End Function
  172.  
  173. Function SIGetLASTDRIVE () As Integer
  174.  
  175. SIGetLASTDRIVE = GetLASTDRIVE()
  176.  
  177. End Function
  178.  
  179. Function SIGetMemorySizeKB () As Integer
  180.  
  181. SIGetMemorySizeKB = GetMemorySizeKB()
  182.  
  183. End Function
  184.  
  185. Function SIGetModelType () As Integer
  186.  
  187. SIGetModelType = GetModelType()
  188.  
  189. End Function
  190.  
  191. Function SIGetMouseInterface (nMouseInterface As Integer) As Integer
  192.  
  193. SIGetMouseInterface = GetMouseInterface(nMouseInterface)
  194.  
  195. End Function
  196.  
  197. Function SIGetMouseIRQ (nMouseIRQ As Integer) As Integer
  198.  
  199. SIGetMouseIRQ = GetMouseIRQ(nMouseIRQ)
  200.  
  201. End Function
  202.  
  203. Function SIGetNetBIOSComputerName (cNetBIOSComputerName As String) As Integer
  204.  
  205. ReDim cNetBIOSComputerNameArray(0) As String * 16
  206. Dim nReturnCode As Integer
  207.  
  208. nReturnCode = GetNetBIOSComputerName(cNetBIOSComputerNameArray(0))
  209.  
  210. Select Case nReturnCode
  211.  
  212.     Case NET_NONETWORK
  213.  
  214.     cNetBIOSComputerName = ""
  215.  
  216.     Case SISDK_SUCCESS
  217.  
  218.     cNetBIOSComputerName = Mid$(cNetBIOSComputerNameArray(0), 1, InStr(cNetBIOSComputerNameArray(0), Chr$(0)) - 1)
  219.  
  220.     cNetBIOSComputerName = Trim$(cNetBIOSComputerName)
  221.  
  222. End Select
  223.  
  224. SIGetNetBIOSComputerName = nReturnCode
  225.  
  226. End Function
  227.  
  228. Function SIGetNetworkType (nNetworkType As Integer) As Integer
  229.  
  230. SIGetNetworkType = GetNetworkType(nNetworkType)
  231.  
  232. End Function
  233.  
  234. Function SIGetNumFloppyDrives () As Integer
  235.  
  236. SIGetNumFloppyDrives = GetNumFloppyDrives()
  237.  
  238. End Function
  239.  
  240. Function SIGetNumVideoCardColors () As Long
  241.  
  242. SIGetNumVideoCardColors = GetNumVideoCardColors()
  243.  
  244. End Function
  245.  
  246. Function SIGetSysInfoDLLVersion () As String
  247.  
  248. SIGetSysInfoDLLVersion = Trim$(Str$(GetSysInfoDLLMajorVersion())) + "." + Trim$((Format$(GetSysInfoDLLMinorVersion(), "00")))
  249.  
  250. End Function
  251.  
  252. Function SIGetTotalDiskSpaceKB (nDriveNumber As Integer, lTotalDiskSpace As Long) As Long
  253.  
  254. SIGetTotalDiskSpaceKB = GetTotalDiskSpaceKB(nDriveNumber, lTotalDiskSpace)
  255.  
  256. End Function
  257.  
  258. Function SIGetVideoCardDriverType () As String
  259.  
  260. ReDim cVideoCardTypeArray(0) As String * 1024
  261. Dim cVideoCardType As String
  262.  
  263. dummy% = GetVideoCardDriverType(cVideoCardTypeArray(0))
  264.  
  265. cVideoCardType = Mid$(cVideoCardTypeArray(0), 1, InStr(cVideoCardTypeArray(0), Chr$(0)) - 1)
  266.  
  267. SIGetVideoCardDriverType = cVideoCardType
  268.  
  269. End Function
  270.  
  271. Function SIGetVideoCardDriverVersion () As Single
  272.  
  273. Dim nVideoCardDriverMinorVersion As Integer
  274.  
  275. nVideoCardDriverMinorVersion = GetVideoCardDriverMinorVersion()
  276.  
  277. If nVideoCardDriverMinorVersion = 0 Then
  278.     'avoid a divide by zero error if Windows 3.0 driver
  279.     SIGetVideoCardDriverVersion = CSng(GetVideoCardDriverMajorVersion())
  280.     Else
  281.     SIGetVideoCardDriverVersion = CSng(GetVideoCardDriverMajorVersion()) + CSng(nVideoCardDriverMinorVersion / 100)
  282. End If
  283.  
  284. End Function
  285.  
  286. Function SIGetVideoCardPixelResolution () As String
  287.  
  288. Dim cVideoCardPixelResolution As String
  289.  
  290. cVideoCardPixelResolution = Trim$(Str$(GetVideoCardPixelWidth())) + " x " + Trim$(Str$(GetVideoCardPixelHeight()))
  291.  
  292. SIGetVideoCardPixelResolution = cVideoCardPixelResolution
  293.  
  294. End Function
  295.  
  296. Function SIGetWindowsFreeMemoryKB () As Long
  297.  
  298. SIGetWindowsFreeMemoryKB = GetWindowsFreeMemoryKB()
  299.  
  300. End Function
  301.  
  302. Function SIGetWindowsMode () As Integer
  303.  
  304. SIGetWindowsMode = GetWindowsMode()
  305.  
  306. End Function
  307.  
  308. Function SIGetWindowsMouseDriverType () As Integer
  309.  
  310. SIGetWindowsMouseDriverType = GetWindowsMouseDriverType()
  311.  
  312. End Function
  313.  
  314. Function SIGetWindowsVersion () As Single
  315.  
  316. Dim nWindowsMinorVersion As Integer
  317.  
  318. nWindowsMinorVersion = GetWindowsMinorVersion()
  319.  
  320. If nWindowsMinorVersion = 0 Then
  321.     'avoid a divide by zero error if Windows 3.0
  322.     SIGetWindowsVersion = CSng(GetWindowsMajorVersion())
  323.     Else
  324.     SIGetWindowsVersion = CSng(GetWindowsMajorVersion()) + CSng(nWindowsMinorVersion / 100)
  325. End If
  326.  
  327. End Function
  328.  
  329.