home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / windows / sysinfo / declares.bas next >
Encoding:
BASIC Source File  |  1994-04-27  |  1.5 KB  |  39 lines

  1. Declare Function GetWinFlags Lib "kernel" () As Long
  2. Global Const WF_CPU086 = &H40&
  3. Global Const WF_CPU186 = &H80&
  4. Global Const WF_CPU286 = &H2&
  5. Global Const WF_CPU386 = &H4&
  6. Global Const WF_CPU486 = &H8&
  7. Global Const WF_STANDARD = &H10&
  8. Global Const WF_ENHANCED = &H20&
  9. Global Const WF_80x87 = &H400&
  10.  
  11. Declare Function GetVersion Lib "kernel" () As Long
  12. Declare Function GetFreeSpace Lib "kernel" (ByVal flag%) As Long
  13. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  14. Declare Function GetDeviceCaps Lib "GDI" (ByVal hDC%, ByVal nIndex%) As Integer
  15.  
  16. Function GetSysIni (section, key)
  17. Dim retVal As String, AppName As String, worked As Integer
  18.     retVal = String$(255, 0)
  19.     worked = GetPrivateProfileString(section, key, "", retVal, Len(retVal), "System.ini")
  20.     If worked = 0 Then
  21.     GetSysIni = "unknown"
  22.     Else
  23.     GetSysIni = Left(retVal, worked)
  24.     End If
  25. End Function
  26.  
  27. Function DeviceColors (hDC As Integer) As Long
  28. Const PLANES = 14
  29. Const BITSPIXEL = 12
  30.     DeviceColors = GetDeviceCaps(hDC, PLANES) * 2 ^ GetDeviceCaps(hDC, BITSPIXEL)
  31. End Function
  32.  
  33. Function WindowsVersion ()
  34. Dim Ver As Long, WinVer As Long
  35.     Ver = GetVersion()
  36.     WinVer = Ver And &HFFFF&
  37.     WindowsVersion = Format((WinVer Mod 256) + ((WinVer \ 256) / 100), "Fixed")
  38. End Function
  39.