' ------------------------------------------------------------------------
'
'     APITYPES.TXT -- Windows 3.1 API Type Declarations for Visual Basic
'
'                       Copyright (C) 1992 Desaware
'
'  You have a royalty-free right to use, modify, reproduce and distribute
'  this file (and/or any modified version) in any way you find useful,
'  provided that you agree that Desaware and Ziff-Davis Press has no 
'  warranty, obligation or liability for its contents.  
'  Refer to the Ziff-Davis Visual Basic Programmer's Guide to the 
'  Windows API for further information.
'
'  This file is in part derived from winapi.txt from Microsoft
'
' ------------------------------------------------------------------------

' Type definitions

Type RECT   '8 Bytes
	left As Integer
	top As Integer
	right As Integer
	bottom As Integer
End Type

Type POINTAPI  '4 Bytes - Synonymous with LONG
	x As Integer
	y As Integer
End Type

Type SIZEAPI  '4 Bytes - Synonymous with LONG
	x As Integer
	y As Integer
End Type

' ParameterBlock description structure for use with LoadModule
Type PARAMETERBLOCK  '14 Bytes
	wEnvSeg As Integer
	lpCmdLine As Long
	lpCmdShow As Long
	dwReserved As Long
End Type


'  OpenFile() Structure
Type OFSTRUCT  '136 Bytes
	cBytes As String * 1
	fFixedDisk As String * 1
	nErrCode As Integer
	reserved As String * 4
	szPathName As String * 128
End Type

'  Bitmap Header Definition
Type BITMAP '14 bytes
	bmType As Integer
	bmWidth As Integer
	bmHeight As Integer
	bmWidthBytes As Integer
	bmPlanes As String * 1
	bmBitsPixel As String * 1
	bmBits As Long
End Type

Type RGBTRIPLE    '3 Bytes
	rgbtBlue As String * 1
	rgbtGreen As String * 1
	rgbtRed As String * 1
End Type

Type RGBQUAD      '4 Bytes
	rgbBlue as String * 1
	rgbGreen As String * 1
	rgbRed As String * 1
	rgbReserved As String * 1
End Type

'  structures for defining DIBs
Type BITMAPCOREHEADER '12 bytes
	bcSize as Long
	bcWidth As Integer
	bcHeight As Integer
	bcPlanes As Integer
	bcBitCount As Integer
End Type

Type BITMAPINFOHEADER '40 bytes
	biSize As Long
	biWidth As Long
	biHeight As Long
	biPlanes As Integer
	biBitCount As Integer
	biCompression As Long
	biSizeImage As Long
	biXPelsPerMeter As Long
	biYPelsPerMeter As Long
	biClrUsed As Long
	biClrImportant As Long
End Type

Type BITMAPINFO   'Varies
	bmiHeader as BITMAPINFOHEADER
	bmiColors As String * 128 ' Array length is arbitrary; may be changed
End Type

Type BITMAPCOREINFO  'Varies
	bmciHeader As BITMAPCOREHEADER
	bmciColors As String * 48 ' Array length is arbitrary; may be changed
End Type

Type BITMAPFILEHEADER   '14 Bytes
	bfType As Integer
	bfSize As Long
	bfReserved1 As Integer
	bfReserved2 As Integer
	bfOffBits As Long
End Type


'  Clipboard Metafile Picture Structure
Type HANDLETABLE
	objectHandle As String * 512 ' Array length is arbitrary; may be changed
End Type

Type METARECORD
	rdSize As Long
	rdFunction As Integer
	rdParm As String * 512 ' Array length is arbitrary; may be changed
End Type


Type METAFILEPICT    '8 Bytes
	mm As Integer
	xExt As Integer
	yExt As Integer
	hMF As Integer
End Type

Type METAHEADER      '18 Bytes
	mtType As Integer
	mtHeaderSize As Integer
	mtVersion As Integer
	mtSize As Long
	mtNoObjects As Integer
	mtMaxRecord As Long
	mtNoParameters As Integer
End Type

Type TEXTMETRIC   '31 Bytes
	tmHeight As Integer
	tmAscent As Integer
	tmDescent As Integer
	tmInternalLeading As Integer
	tmExternalLeading As Integer
	tmAveCharWidth As Integer
	tmMaxCharWidth As Integer
	tmWeight As Integer
	tmItalic As String * 1
	tmUnderlined As String * 1
	tmStruckOut As String * 1
	tmFirstChar As String * 1
	tmLastChar As String * 1
	tmDefaultChar As String * 1
	tmBreakChar As String * 1
	tmPitchAndFamily As String * 1
	tmCharSet As String * 1
	tmOverhang As Integer
	tmDigitizedAspectX As Integer
	tmDigitizedAspectY As Integer
End Type

Type NEWTEXTMETRIC   '41 Bytes
	tmHeight As Integer
	tmAscent As Integer
	tmDescent As Integer
	tmInternalLeading As Integer
	tmExternalLeading As Integer
	tmAveCharWidth As Integer
	tmMaxCharWidth As Integer
	tmWeight As Integer
	tmItalic As String * 1
	tmUnderlined As String * 1
	tmStruckOut As String * 1
	tmFirstChar As String * 1
	tmLastChar As String * 1
	tmDefaultChar As String * 1
	tmBreakChar As String * 1
	tmPitchAndFamily As String * 1
	tmCharSet As String * 1
	tmOverhang As Integer
	tmDigitizedAspectX As Integer
	tmDigitizedAspectY As Integer
   ntmFlags As Long
   ntmSizeEM As Integer
   ntmCellHeight As Integer
   ntmAvgWidth As Integer
End Type

'  GDI Logical Objects:

'  Pel Array
Type PELARRAY  ' 10 Bytes
	paXCount As Integer
	paYCount As Integer
	paXExt As Integer
	paYExt As Integer
	paRGBs As Integer
End Type

'  Logical Brush (or Pattern)
Type LOGBRUSH     '8 Bytes
	lbStyle As Integer
	lbColor As Long
	lbHatch As Integer
End Type

'  Logical Pen
Type LOGPEN    '10 Bytes
	lopnStyle As Integer
	lopnWidth As POINTAPI
	lopnColor As Long
End Type

Type PALETTEENTRY    '4 Bytes
	peRed As String * 1
	peGreen As String * 1
	peBlue As String * 1
	peFlags As String * 1
End Type

'  Logical Palette
Type LOGPALETTE
	palVersion As Integer
	palNumEntries As Integer
	palPalEntry As String * 252 ' Array length is arbitrary; may be changed
End Type

'  Logical Font

Type LOGFONT   ' 50 Bytes
	lfHeight As Integer
	lfWidth As Integer
	lfEscapement As Integer
	lfOrientation As Integer
	lfWeight As Integer
	lfItalic As String * 1
	lfUnderline As String * 1
	lfStrikeOut As String * 1
	lfCharSet As String * 1
	lfOutPrecision As String * 1
	lfClipPrecision As String * 1
	lfQuality As String * 1
	lfPitchAndFamily As String * 1
	lfFaceName As String * 32
End Type

Type NEWLOGFONT   ' 146 Bytes
	lfHeight As Integer
	lfWidth As Integer
	lfEscapement As Integer
	lfOrientation As Integer
	lfWeight As Integer
	lfItalic As String * 1
	lfUnderline As String * 1
	lfStrikeOut As String * 1
	lfCharSet As String * 1
	lfOutPrecision As String * 1
	lfClipPrecision As String * 1
	lfQuality As String * 1
	lfPitchAndFamily As String * 1
	lfFaceName As String * 32
   lfFullName As String * 64
   lfStyle As String * 32
End Type


Type EVENTMSG  '10 Bytes
	message As Integer
	paramL As Integer
	paramH As Integer
	time As Long
End Type

'  Message structure
Type MSG    '18 Bytes
	hwnd As Integer
	message As Integer
	wParam As Integer
	lParam As Long
	time As Long
	pt As POINTAPI
End Type

Type PAINTSTRUCT     '32 Bytes
	hdc As Integer
	fErase As Integer
	rcPaint As RECT
	fRestore As Integer
	fIncUpdate As Integer
	rgbReserved As String * 16
End Type

Type CREATESTRUCT
	lpCreateParams As Long     '34 Bytes
	hInstance As Integer
	hMenu As Integer
	hwndParent As Integer
	cy As Integer
	cx As Integer
	y As Integer
	x As Integer
	style As Long
	lpszName As Long
	lpszClass As Long
	ExStyle As Long
End Type

Type MEASUREITEMSTRUCT  '14 Bytes
	CtlType As Integer
	CtlID As Integer
	itemID As Integer
	itemWidth As Integer
	itemHeight As Integer
	itemData As Long
End Type

'  DRAWITEMSTRUCT for ownerdraw
Type DRAWITEMSTRUCT     '26 Bytes
	CtlType As Integer
	CtlID As Integer
	itemID As Integer
	itemAction As Integer
	itemState As Integer
	hwndItem As Integer
	hDC As Integer
	rcItem As RECT
	itemData As Long
End Type

'  DELETEITEMSTRUCT for ownerdraw
Type DELETEITEMSTRUCT   '12 Bytes
	CtlType As Integer
	CtlID As Integer
	itemID As Integer
	hwndItem As Integer
	itemData As Long
End Type

'  COMPAREITEMSTRUCT for ownerdraw sorting
Type COMPAREITEMSTRUCT  '18 Bytes
	CtlType As Integer
	CtlID As Integer
	hwndItem As Integer
	itemID1 As Integer
	itemData1 As Long
	itemID2 As Integer
	itemData2 As Long
End Type

Type MENUITEMTEMPLATEHEADER   '4 Bytes
	versionNumber As Integer
	offset As Integer
End Type

Type MENUITEMTEMPLATE   'Varies depending on the size of the mtString array
	mtOption As Integer
	mtID As Integer
	mtString As String *1
End Type

Type DCB    '25 Bytes
	Id As String * 1
	BaudRate As Integer
	ByteSize As String * 1
	Parity As String * 1
	StopBits As String * 1
	RlsTimeout As Integer
	CtsTimeout As Integer
	DsrTimeout As Integer

	Bits1 As String * 1 ' The fifteen actual DCB bit-sized data fields
	Bits2 As String * 1 ' within these two bytes can be manipulated by
                          ' bitwise logical And/Or operations.  Refer to
                          ' Chapter 14 for further information

	XonChar As String * 1
	XoffChar As String * 1
	XonLim As Integer
	XoffLim As Integer
	PeChar As String * 1
	EofChar As String * 1
	EvtChar As String * 1
	TxDelay As Integer
End Type

Type COMSTAT   '5 Bytes
	Bits As String * 1 ' For specific bit flags and their
                         ' meanings, refer to chapter 14
	cbInQue As Integer
	cbOutQue As Integer
End Type

Type MDICREATESTRUCT    '26 Bytes
	szClass As Long
	szTitle As Long
	hOwner As Integer
	x As Integer
	y As Integer
	cx As Integer
	cy As Integer
	style As Long
	lParam As Long
End Type

Type CLIENTCREATESTRUCT    '4 Bytes
	hWindowMenu As Integer
	idFirstChild As Integer
End Type

Type MULTIKEYHELP
	mkSize As Integer
	mkKeylist As String * 1
	szKeyphrase As String * 253 ' Array length is arbitrary; may be changed
End Type

Type WINDOWPLACEMENT    '20 Bytes
   length As Integer
   showCmd As Integer
   ptMinPosition AS POINTAPI
   ptMaxPosition AS POINTAPI
   rcNormalPosition As RECT
End Type

Type WNDCLASS  '26 Bytes
   style As Integer
   lpfnWndProc As Long  ' Note: address of function here
   cbClsExtra As Integer
   cbWndExtra As Integer
   hInstance As Integer
   hIcon As Integer
   hCursor As Integer
   hbrBackground As Integer
   lpszMenuName As Long    ' Resource ID or far pointer to name
   lpszClassName As Long   ' Far pointer to name
End Type   

Type ABC    '6 Bytes
   abcA As Integer
   abcB As Integer
   abcC As Integer
End Type

Type PANOSE ' 10 Bytes
   bFamilyType As String * 1
   bSerifStyle As String * 1
   bWeight As String * 1
   bProportion As String * 1   
   bContrast As String * 1
   bStrokeVariation As String * 1
   bArmStyle As String * 1
   bLetterform As String * 1
   bMidline As String * 1
   bXHeight As String * 1
End Type
      
Type OUTLINETEXTMETRIC  '112 Bytes
   otmSize As Integer
   otmTextMetrics As TEXTMETRIC
   otmFIller As String * 1
   otmPanoseNumber As PANOSE
   otmfsSelection As Integer
   otmfsType As Integer
   otmsCharSlopeRise As Integer
   otmsCharSlopeRun As Integer
   otmEMSquare As Integer
   otmAscent As Integer
   otmDescent As Integer
   otmLineGap As Integer
   otmCapEmHeight As Integer
   otmXHeight As Integer
   otmrcFontBox As RECT
   otmMacAscent As Integer
   otmMacDescent As Integer
   otmMacLineGap As Integer
   otmusMinimumPPEM As Integer
   otmptSubscriptSize As POINTAPI
   otmptSubscriptOffset As POINTAPI
   otmptSuperscriptSize As POINTAPI
   otmptSuperscriptOffset As POINTAPI
   otmsStrikeoutSize As Integer
   otmsStrikeoutPosition As Integer
   otmsUnderscoreSize As Integer
   otmsUnderscorePosition As Integer
   otmpFamilyName As Integer
   otmpFaceName As Integer
   otmpStyleName As Integer
   otmpFullName As Integer
End Type


Type RASTERIZERSTATUS   '6 Bytes
   nSize As Integer
   wFlags As Integer
   nLanguageID As Integer
End Type


Type GLYPHMETRICS ' 12 Bytes
   gmBlackBoxX As Integer
   gmBlackBoxY As Integer
   gmptGlyphOrigin As POINTAPI
   gmCellIncX As Integer
   gmCellIncY As Integer
End Type

Type FIXED  '4 Bytes
   fract As Integer
   value As Integer
End Type

Type MAT2   '16 Bytes
   eM11 As FIXED
   eM12 As FIXED
   eM21 As FIXED
   eM22 As FIXED
End Type

Type POINTFX   ' 8 Bytes
   x As FIXED
   y As Fixed
End Type

Type TTPOLYGONHEADER    ' 16 Bytes
   cb As Long
   dw As Long
   pfxStart As POINTFX
end Type

Type TTPOLYCURVE     ' 12 Bytes
   wType As Integer
   cpfx As Integer
   apfx As POINTFX
end Type

Type DOCINFO    ' 10 Bytes
   cbSize As Integer
   lpszDocName As Long
   lpszOutput As Long
End Type

Type WINDEBUGINFO   ' 26 Bytes
   flags As Integer
   dwOptions As Long
   dwFilter As Long
   achAllocModule As String * 8
   dwAllocBreak As Long
   dwAllocCount As Long
End Type

Type DEVMODE    ' 68 Bytes
    dmDeviceName As String *32
    dmSpecVersion As Integer
    dmDriverVersion As Integer
    dmSize As Integer
    dmDriverExtra As Integer
    dmFields As Long
    dmOrientation As Integer
    dmPaperSize As Integer
    dmPaperLength As Integer
    dmPaperWidth As Integer
    dmScale As Integer
    dmCopies As Integer
    dmDefaultSource As Integer
    dmPrintQuality As Integer
    dmColor As Integer
    dmDuplex As Integer
    dmYResolution As Integer
    dmTTOption As Integer
End Type

Type FIXEDFILEINFO ' 52 Bytes
    dwSignature As Long
    dwStrucVersion As Long
    dwFileVersionMS As Long
    dwFileVersionLS As Long
    dwProductVersionMS As Long
    dwProductVersionLS As Long
    dwFileFlagsMask As Long
    dwFileFlags As Long
    dwFileOS As Long
    dwFileType As Long
    dwFileSubtype As Long
    dwFileDateMS As Long
    dwFileDateLS As Long
End Type

Type HELPWININFO  ' 14 Bytes
    wStructSize As Integer
    x As Integer
    y As Integer
    dx As Integer
    dy As Integer
    wMax As Integer
    rgchMember As String *2
End Type

