home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / classlib / desaware / dwtypes.bas < prev    next >
Encoding:
BASIC Source File  |  1996-02-23  |  6.3 KB  |  319 lines

  1. Attribute VB_Name = "dwTypes"
  2. ' Desaware API Class object library
  3. ' Copyright (c) 1996 by Desaware Inc.
  4. ' All rights reserved
  5. ' Type declarations and Global Utilities
  6.  
  7. Option Explicit
  8.  
  9. #If Win32 Then
  10. Public Type RECT
  11.     left As Long
  12.     Top As Long
  13.     right As Long
  14.     bottom As Long
  15. End Type
  16.  
  17. #Else
  18. Public Type RECT
  19.     left As Integer
  20.     Top As Integer
  21.     right As Integer
  22.     bottom As Integer
  23. End Type
  24.  
  25. #End If 'WIN32 Types
  26.  
  27. #If Win32 Then
  28. Type DEVMODE
  29.         dmDeviceName As String * 32
  30.         dmSpecVersion As Integer
  31.         dmDriverVersion As Integer
  32.         dmSize As Integer
  33.         dmDriverExtra As Integer
  34.         dmFields As Long
  35.         dmOrientation As Integer
  36.         dmPaperSize As Integer
  37.         dmPaperLength As Integer
  38.         dmPaperWidth As Integer
  39.         dmScale As Integer
  40.         dmCopies As Integer
  41.         dmDefaultSource As Integer
  42.         dmPrintQuality As Integer
  43.         dmColor As Integer
  44.         dmDuplex As Integer
  45.         dmYResolution As Integer
  46.         dmTTOption As Integer
  47.         dmCollate As Integer
  48.         dmFormName As String * 32
  49.         dmUnusedPadding As Integer
  50.         dmBitsPerPel As Long
  51.         dmPelsWidth As Long
  52.         dmPelsHeight As Long
  53.         dmDisplayFlags As Long
  54.         dmDisplayFrequency As Long
  55. End Type
  56.  
  57. #Else
  58. Type DEVMODE    ' 68 Bytes
  59.     dmDeviceName As String * 32
  60.     dmSpecVersion As Integer
  61.     dmDriverVersion As Integer
  62.     dmSize As Integer
  63.     dmDriverExtra As Integer
  64.     dmFields As Long
  65.     dmOrientation As Integer
  66.     dmPaperSize As Integer
  67.     dmPaperLength As Integer
  68.     dmPaperWidth As Integer
  69.     dmScale As Integer
  70.     dmCopies As Integer
  71.     dmDefaultSource As Integer
  72.     dmPrintQuality As Integer
  73.     dmColor As Integer
  74.     dmDuplex As Integer
  75.     dmYResolution As Integer
  76.     dmTTOption As Integer
  77. End Type
  78.  
  79. #End If
  80.  
  81.  
  82. #If Win32 Then
  83.  
  84. Type ACL
  85.         AclRevision As Byte
  86.         Sbz1 As Byte
  87.         AclSize As Integer
  88.         AceCount As Integer
  89.         Sbz2 As Integer
  90. End Type
  91.  
  92. Type SECURITY_DESCRIPTOR
  93.         Revision As Byte
  94.         Sbz1 As Byte
  95.         Control As Long
  96.         Owner As Long
  97.         Group As Long
  98.         Sacl As ACL
  99.         Dacl As ACL
  100. End Type
  101. #End If
  102.  
  103. #If Win32 Then
  104. Public Type SIZE
  105.     cx As Long
  106.     cy As Long
  107. End Type
  108.  
  109. #Else
  110.  
  111. Public Type SIZE
  112.     cx As Integer
  113.     cy As Integer
  114. End Type
  115.  
  116. #End If 'WIN32 Types
  117.  
  118. #If Win32 Then
  119. Public Type POINTAPI
  120.     x As Long
  121.     y As Long
  122. End Type
  123.  
  124. #Else
  125. Public Type POINTAPI
  126.     x As Integer
  127.     y As Integer
  128. End Type
  129.  
  130. #End If 'WIN32 Types
  131.  
  132. #If Win32 Then
  133. Public Type LOGPEN
  134.     lopnStyle As Long
  135.     lopnWidth As POINTAPI
  136.     lopnColor As Long
  137. End Type
  138.  
  139. #Else
  140. Public Type LOGPEN
  141.     lopnStyle As Integer
  142.     lopnWidth As POINTAPI
  143.     lopnColor As Long
  144. End Type
  145.  
  146. #End If 'WIN32 Types
  147.  
  148. #If Win32 Then
  149. Public Type CPINFO
  150.     MaxCharSize As Long
  151.     DefaultChar(MAX_DEFAULTCHAR) As Byte
  152.     LeadByte(MAX_LEADBYTES) As Byte
  153. End Type
  154.  
  155. #Else
  156. 'TYPE CPINFO is not available in the WIN16 API.
  157. #End If 'WIN32 Types
  158.  
  159. #If Win32 Then
  160. Public Type LOGBRUSH
  161.     lbStyle As Long
  162.     lbColor As Long
  163.     lbHatch As Long
  164. End Type
  165.  
  166. #Else
  167. Public Type LOGBRUSH
  168.     lbStyle As Integer
  169.     lbColor As Long
  170.     lbHatch As Integer
  171. End Type
  172.  
  173. #End If 'WIN32 Types
  174.  
  175. #If Win32 Then
  176. Public Type SYSTEMTIME
  177.     wYear As Integer
  178.     wMonth As Integer
  179.     wDayOfWeek As Integer
  180.     wDay As Integer
  181.     wHour As Integer
  182.     wMinute As Integer
  183.     wSecond As Integer
  184.     wMilliseconds As Integer
  185. End Type
  186.  
  187. #Else
  188. 'TYPE SYSTEMTIME is not available in the WIN16 API.
  189. #End If 'WIN32 Types
  190.  
  191. #If Win32 Then
  192. Public Type SYSTEM_POWER_STATUS
  193.     ACLineStatus As Byte
  194.     BatteryFlag As Byte
  195.     BatteryLifePercent As Byte
  196.     Reserved1 As Byte
  197.     BatteryLifeTime As Long
  198.     BatteryFullLifeTime As Long
  199. End Type
  200.  
  201. Public Type OSVERSIONINFO
  202.      dwOSVersionInfoSize As Long
  203.      dwMajorVersion As Long
  204.      dwMinorVersion As Long
  205.      dwBuildNumber As Long
  206.      dwPlatformId As Long
  207.      szCSDVersion As String * 128
  208. End Type
  209.  
  210. #Else
  211. 'TYPE SYSTEM_POWER_STATUS is not available in the WIN16 API.
  212. 'TYPE OSVERSIONINFO is not available in the WIN16 API.
  213. #End If 'WIN32 Types
  214.  
  215. #If Win32 Then
  216. Public Type LOGFONT
  217.     lfHeight As Long
  218.     lfWidth As Long
  219.     lfEscapement As Long
  220.     lfOrientation As Long
  221.     lfWeight As Long
  222.     lfItalic As Byte
  223.     lfUnderline As Byte
  224.     lfStrikeOut As Byte
  225.     lfCharSet As Byte
  226.     lfOutPrecision As Byte
  227.     lfClipPrecision As Byte
  228.     lfQuality As Byte
  229.     lfPitchAndFamily As Byte
  230.     lfFaceName(LF_FACESIZE) As Byte
  231. End Type
  232.  
  233. #Else
  234. Public Type LOGFONT
  235.     lfHeight As Integer
  236.     lfWidth As Integer
  237.     lfEscapement As Integer
  238.     lfOrientation As Integer
  239.     lfWeight As Integer
  240.     lfItalic As String * 1
  241.     lfUnderline As String * 1
  242.     lfStrikeOut As String * 1
  243.     lfCharSet As String * 1
  244.     lfOutPrecision As String * 1
  245.     lfClipPrecision As String * 1
  246.     lfQuality As String * 1
  247.     lfPitchAndFamily As String * 1
  248.     lfFaceName As String * 32
  249. End Type
  250.  
  251. #End If 'WIN32 Types
  252. #If Win32 Then
  253. Public Type BITMAP
  254.     bmType As Long
  255.     bmWidth As Long
  256.     bmHeight As Long
  257.     bmWidthBytes As Long
  258.     bmPlanes As Integer
  259.     bmBitsPixel As Integer
  260.     bmBits As Long
  261. End Type
  262.  
  263. #Else
  264. Public Type BITMAP
  265.     bmType As Integer
  266.     bmWidth As Integer
  267.     bmHeight As Integer
  268.     bmWidthBytes As Integer
  269.     bmPlanes As String * 1
  270.     bmBitsPixel As String * 1
  271.     bmBits As Long
  272. End Type
  273.  
  274. #End If 'WIN32 Types
  275.  
  276. #If Win32 Then
  277. Public Type HANDLETABLE
  278.     ObjectHandle(1) As Long
  279. End Type
  280.  
  281. Public Type ENHMETARECORD
  282.     iType As Long
  283.     nSize As Long
  284.     dParm(1) As Long
  285. End Type
  286.  
  287. #Else
  288. Public Type HANDLETABLE
  289.     ObjectHandle As String * 512
  290. End Type
  291.  
  292. #End If 'WIN32 Types
  293.  
  294. #If Win32 Then
  295. Public Type MEMORYSTATUS
  296.     dwLength As Long
  297.     dwMemoryLoad As Long
  298.     dwTotalPhys As Long
  299.     dwAvailPhys As Long
  300.     dwTotalPageFile As Long
  301.     dwAvailPageFile As Long
  302.     dwTotalVirtual As Long
  303.     dwAvailVirtual As Long
  304. End Type
  305.  
  306. #Else
  307. #End If 'WIN32 Types
  308.  
  309. ' Utility function for creating a point easily
  310. Public Function MakePoint(ByVal x As Long, ByVal y As Long) As dwPoint
  311.     Dim pt As New dwPoint
  312.     With pt
  313.         .x = x
  314.         .y = y
  315.     End With
  316.     Set MakePoint = pt
  317. End Function
  318.  
  319.