home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / declares.ba_ / declares.bin
Text File  |  1993-04-28  |  5KB  |  125 lines

  1. Option Explicit
  2. Dim WinVersion As Integer, SoundAvailable As Integer
  3. Global VisibleFrame As Frame
  4.  
  5. Global Const TWIPS = 1
  6. Global Const PIXELS = 3
  7. Global Const RES_INFO = 2
  8. Global Const MINIMIZED = 1
  9.  
  10. Type Rect
  11.     Left As Integer
  12.     Top As Integer
  13.     Right As Integer
  14.     Bottom As Integer
  15. End Type
  16.  
  17. Declare Function GetWindowsDirectory Lib "Kernel" (ByVal P$, ByVal S%) As Integer
  18. Declare Function GetSystemDirectory Lib "kernel" (ByVal P$, ByVal S%) As Integer
  19. Declare Function GetWinFlags Lib "kernel" () As Long
  20. Global Const WF_CPU286 = &H2&
  21. Global Const WF_CPU386 = &H4&
  22. Global Const WF_CPU486 = &H8&
  23. Global Const WF_STANDARD = &H10&
  24. Global Const WF_ENHANCED = &H20&
  25. Global Const WF_80x87 = &H400&
  26.  
  27. Declare Function GetVersion Lib "Kernel" () As Long
  28. Declare Function GetSystemMetrics Lib "User" (ByVal n As Integer) As Integer
  29. Global Const SM_MOUSEPRESENT = 19
  30.  
  31. Declare Function GetDeviceCaps Lib "GDI" (ByVal hDC%, ByVal nIndex%) As Integer
  32.  
  33. Declare Function GlobalCompact Lib "kernel" (ByVal flag&) As Long
  34. Declare Function GetFreeSpace Lib "kernel" (ByVal flag%) As Long
  35. Declare Function GetFreeSystemResources Lib "User" (ByVal fuSysResource As Integer) As Integer
  36. Global Const GFSR_SYSTEMRESOURCES = &H0
  37. Global Const GFSR_GDIRESOURCES = &H1
  38. Global Const GFSR_USERRESOURCES = &H2
  39.  
  40. Declare Function sndPlaySound Lib "MMSystem" (lpsound As Any, ByVal flag As Integer) As Integer
  41. Declare Function waveOutGetNumDevs Lib "MMSystem" () As Integer
  42.  
  43. Declare Function TrackPopupMenu Lib "user" (ByVal hMenu%, ByVal wFlags%, ByVal x%, ByVal y%, ByVal r2%, ByVal hWd%, r As Rect) As Integer
  44. Declare Function GetMenu Lib "user" (ByVal hWd%) As Integer
  45. Declare Function GetSubMenu Lib "user" (ByVal hMenu%, ByVal nPos%) As Integer
  46. Declare Function InsertMenu Lib "User" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer, ByVal wIDNewItem As Integer, ByVal lpNewItem As Any) As Integer
  47. Declare Function GetSystemMenu Lib "User" (ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer
  48. Global Const MF_POPUP = &H10
  49. Global Const MF_BYPOSITION = &H400
  50. Global Const MF_SEPARATOR = &H800
  51.  
  52. Declare Function GetDeskTopWindow Lib "User" () As Integer
  53. Declare Function GetDC Lib "User" (ByVal hWnd%) As Integer
  54. Declare Sub ReleaseDC Lib "User" (ByVal hWnd%, ByVal hDC%)
  55. Declare Function BitBlt Lib "GDI" (ByVal destDC%, ByVal x%, ByVal y%, ByVal w%, ByVal h%, ByVal srchDC%, ByVal srcX%, ByVal srcY%, ByVal rop&) As Integer
  56. Global Const SRCCOPY = &HCC0020
  57. Global Const SRCERASE = &H440328
  58. Global Const SRCINVERT = &H660046
  59. Global Const SRCAND = &H8800C6
  60.  
  61. Declare Sub SetWindowPos Lib "User" (ByVal h1%, ByVal h2%, ByVal x%, ByVal y%, ByVal cx%, ByVal cy%, ByVal f%)
  62. Global Const HWND_TOPMOST = -1
  63. Global Const HWND_NOTOPMOST = -2
  64. Global Const SWP_NOACTIVATE = &H10
  65. Global Const SWP_SHOWWINDOW = &H40
  66.  
  67. 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
  68. Declare Function GetProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer) As Integer
  69.  
  70. Function DeviceColors (hDC As Integer) As Long
  71. Const PLANES = 14
  72. Const BITSPIXEL = 12
  73.     DeviceColors = GetDeviceCaps(hDC, PLANES) * 2 ^ GetDeviceCaps(hDC, BITSPIXEL)
  74. End Function
  75.  
  76. Function DosVersion ()
  77. Dim Ver As Long, DosVer As Long
  78.     Ver = GetVersion()
  79.     DosVer = Ver \ &H10000
  80.     DosVersion = Format((DosVer \ 256) + ((DosVer Mod 256) / 100), "Fixed")
  81. End Function
  82.  
  83. Function GetSysIni (section, key)
  84. Dim retVal As String, AppName As String, worked As Integer
  85.     retVal = String$(255, 0)
  86.     worked = GetPrivateProfileString(section, key, "", retVal, Len(retVal), "System.ini")
  87.     If worked = 0 Then
  88.     GetSysIni = "unknown"
  89.     Else
  90.     GetSysIni = Left(retVal, worked)
  91.     End If
  92. End Function
  93.  
  94. Function GetWinIni (section, key)
  95. Dim retVal As String, AppName As String, worked As Integer
  96.     retVal = String$(255, 0)
  97.     worked = GetProfileString(section, key, "", retVal, Len(retVal))
  98.     If worked = 0 Then
  99.     GetWinIni = "unknown"
  100.     Else
  101.     GetWinIni = Left(retVal, worked)
  102.     End If
  103. End Function
  104.  
  105. Function SystemDirectory () As String
  106. Dim WinPath As String
  107.     WinPath = String(145, Chr(0))
  108.     SystemDirectory = Left(WinPath, GetSystemDirectory(WinPath, Len(WinPath)))
  109.  
  110. End Function
  111.  
  112. Function WindowsDirectory () As String
  113. Dim WinPath As String
  114.     WinPath = String(145, Chr(0))
  115.     WindowsDirectory = Left(WinPath, GetWindowsDirectory(WinPath, Len(WinPath)))
  116. End Function
  117.  
  118. Function WindowsVersion ()
  119. Dim Ver As Long, WinVer As Long
  120.     Ver = GetVersion()
  121.     WinVer = Ver And &HFFFF&
  122.     WindowsVersion = Format((WinVer Mod 256) + ((WinVer \ 256) / 100), "Fixed")
  123. End Function
  124.  
  125.