home *** CD-ROM | disk | FTP | other *** search
Wrap
'******************************** WINGDI.INC ********************************* 'Demonstrates: Sample Declare, Const, and Type structures for calling the ' Windows 'GDI' API routines. ' 'Required Files: None ' 'Uses: ' 'Complexity Level: ADVANCED (Windows programming experience required) ' 'Notes: This include file correspond to the 'GDI' section of the Windows SDK ' 'windows.h' C header file. This include files is provided for those ' who wish to call Windows API routines from MSTest. Since this is a ' large Include file, you may wish to extract only the statements ' necessary for your particular API call(s). ' ' NOTE: Some Windows.h struct field names have been changed to avoid ' conflicts with MSTest reserved words. These changes are: ' ' RECT - left and right are defined as wleft and wright ' MSG and EVENTMSG - time is defined as dwtime ' '****************************************************************************** '$IFNDEF WinAPI_GENDefs '$DEFINE WinAPI_GENDefs ' General Purpose Defines ' Conditional statement to avoid conflict with FASTTEST's WNAPIDEC.INC '$IFNDEF WNAPIDEC Type RECT wleft As Integer top As Integer wright As Integer bottom As Integer End Type '$ENDIF Type POINT x As Integer y As Integer End Type '$ENDIF ' -------------------------------------------------------------------------- ' GDI Section ' -------------------------------------------------------------------------- '$IFNDEF WinGDI '$DEFINE WinGDI ' Binary raster ops Const R2_BLACK = 1 ' 0 Const R2_NOTMERGEPEN = 2 ' DPon Const R2_MASKNOTPEN = 3 ' DPna Const R2_NOTCOPYPEN = 4 ' PN Const R2_MASKPENNOT = 5 ' PDna Const R2_NOT = 6 ' Dn Const R2_XORPEN = 7 ' DPx Const R2_NOTMASKPEN = 8 ' DPan Const R2_MASKPEN = 9 ' DPa Const R2_NOTXORPEN = 10 ' DPxn Const R2_NOP = 11 ' D Const R2_MERGENOTPEN = 12 ' DPno Const R2_COPYPEN = 13 ' P Const R2_MERGEPENNOT = 14 ' PDno Const R2_MERGEPEN = 15 ' DPo Const R2_WHITE = 16 ' 1 ' Ternary raster operations Const SRCCOPY = &HCC0020 ' (DWORD) dest = source Const SRCPAINT = &HEE0086 ' (DWORD) dest = source OR dest Const SRCAND = &H8800C6 ' (DWORD) dest = source AND dest Const SRCINVERT = &H660046 ' (DWORD) dest = source XOR dest Const SRCERASE = &H440328 ' (DWORD) dest = source AND (NOT dest ) Const NOTSRCCOPY = &H330008 ' (DWORD) dest = (NOT source) Const NOTSRCERASE = &H1100A6 ' (DWORD) dest = (NOT src) AND (NOT dest) Const MERGECOPY = &HC000CA ' (DWORD) dest = (source AND pattern) Const MERGEPAINT = &HBB0226 ' (DWORD) dest = (NOT source) OR dest Const PATCOPY = &HF00021 ' (DWORD) dest = pattern Const PATPAINT = &HFB0A09 ' (DWORD) dest = DPSnoo Const PATINVERT = &H5A0049 ' (DWORD) dest = pattern XOR dest Const DSTINVERT = &H550009 ' (DWORD) dest = (NOT dest) Const BLACKNESS = &H42 ' (DWORD) dest = BLACK Const WHITENESS = &HFF0062 ' (DWORD) dest = WHITE ' StretchBlt() Modes Const BLACKONWHITE = 1 Const WHITEONBLACK = 2 Const COLORONCOLOR = 3 ' PolyFill() Modes Const ALTERNATE = 1 Const WINDING = 2 ' Text Alignment Options Const TA_NOUPDATECP = 0 Const TA_UPDATECP = 1 Const TA_LEFT = 0 Const TA_RIGHT = 2 Const TA_CENTER = 6 Const TA_TOP = 0 Const TA_BOTTOM = 8 Const TA_BASELINE = 24 Const ETO_GRAYED = 1 Const ETO_OPAQUE = 2 Const ETO_CLIPPED = 4 Const ASPECT_FILTERING = &H1 ' Metafile Functions Const META_SETBKCOLOR = &H201 Const META_SETBKMODE = &H102 Const META_SETMAPMODE = &H103 Const META_SETROP2 = &H104 Const META_SETRELABS = &H105 Const META_SETPOLYFILLMODE = &H106 Const META_SETSTRETCHBLTMODE = &H107 Const META_SETTEXTCHAREXTRA = &H108 Const META_SETTEXTCOLOR = &H209 Const META_SETTEXTJUSTIFICATION = &H20A Const META_SETWINDOWORG = &H20B Const META_SETWINDOWEXT = &H20C Const META_SETVIEWPORTORG = &H20D Const META_SETVIEWPORTEXT = &H20E Const META_OFFSETWINDOWORG = &H20F Const META_SCALEWINDOWEXT = &H400 Const META_OFFSETVIEWPORTORG = &H211 Const META_SCALEVIEWPORTEXT = &H412 Const META_LINETO = &H213 Const META_MOVETO = &H214 Const META_EXCLUDECLIPRECT = &H415 Const META_INTERSECTCLIPRECT = &H416 Const META_ARC = &H817 Const META_ELLIPSE = &H418 Const META_FLOODFILL = &H419 Const META_PIE = &H81A Const META_RECTANGLE = &H41B Const META_ROUNDRECT = &H61C Const META_PATBLT = &H61D Const META_SAVEDC = &H1E Const META_SETPIXEL = &H41F Const META_OFFSETCLIPRGN = &H220 Const META_TEXTOUT = &H521 Const META_BITBLT = &H922 Const META_STRETCHBLT = &HB23 Const META_POLYGON = &H324 Const META_POLYLINE = &H325 Const META_ESCAPE = &H626 Const META_RESTOREDC = &H127 Const META_FILLREGION = &H228 Const META_FRAMEREGION = &H429 Const META_INVERTREGION = &H12A Const META_PAINTREGION = &H12B Const META_SELECTCLIPREGION = &H12C Const META_SELECTOBJECT = &H12D Const META_SETTEXTALIGN = &H12E Const META_DRAWTEXT = &H62F Const META_CHORD = &H830 Const META_SETMAPPERFLAGS = &H231 Const META_EXTTEXTOUT = &Ha32 Const META_SETDIBTODEV = &Hd33 Const META_SELECTPALETTE = &H234 Const META_REALIZEPALETTE = &H35 Const META_ANIMATEPALETTE = &H436 Const META_SETPALENTRIES = &H37 Const META_POLYPOLYGON = &H538 Const META_RESIZEPALETTE = &H139 Const META_DIBBITBLT = &H940 Const META_DIBSTRETCHBLT = &Hb41 Const META_DIBCREATEPATTERNBRUSH = &H142 Const META_STRETCHDIB = &Hf43 Const META_DELETEOBJECT = &H1f0 Const META_CREATEPALETTE = &Hf7 Const META_CREATEBRUSH = &HF8 Const META_CREATEPATTERNBRUSH = &H1F9 Const META_CREATEPENINDIRECT = &H2FA Const META_CREATEFONTINDIRECT = &H2FB Const META_CREATEBRUSHINDIRECT = &H2FC Const META_CREATEBITMAPINDIRECT = &H2FD Const META_CREATEBITMAP = &H6FE Const META_CREATEREGION = &H6FF ' GDI Escapes Const NEWFRAME = 1 Const ABORTDOC = 2 Const NEXTBAND = 3 Const SETCOLORTABLE = 4 Const GETCOLORTABLE = 5 Const FLUSHOUTPUT = 6 Const DRAFTMODE = 7 Const QUERYESCSUPPORT = 8 Const SETABORTPROC = 9 Const STARTDOC = 10 Const ENDDOCAPI = 11 Const GETPHYSPAGESIZE = 12 Const GETPRINTINGOFFSET = 13 Const GETSCALINGFACTOR = 14 Const MFCOMMENT = 15 Const GETPENWIDTH = 16 Const SETCOPYCOUNT = 17 Const SELECTPAPERSOURCE = 18 Const DEVICEDATA = 19 Const PASSTHROUGH = 19 Const GETTECHNOLGY = 20 Const GETTECHNOLOGY = 20 Const SETENDCAP = 21 Const SETLINEJOIN = 22 Const SETMITERLIMIT = 23 Const BANDINFO = 24 Const DRAWPATTERNRECT = 25 Const GETVECTORPENSIZE = 26 Const GETVECTORBRUSHSIZE = 27 Const ENABLEDUPLEX = 28 Const GETSETPAPERBINS = 29 Const GETSETPRINTORIENT = 30 Const ENUMPAPERBINS = 31 Const SETDIBSCALING = 32 Const EPSPRINTING = 33 Const ENUMPAPERMETRICS = 34 Const GETSETPAPERMETRICS = 35 Const POSTSCRIPT_DATA = 37 Const POSTSCRIPT_IGNORE = 38 Const GETEXTENDEDTEXTMETRICS = 256 Const GETEXTENTTABLE = 257 Const GETPAIRKERNTABLE = 258 Const GETTRACKKERNTABLE = 259 Const CEXTTEXTOUT = 512 Const ENABLERELATIVEWIDTHS = 768 Const ENABLEPAIRKERNING = 769 Const SETKERNTRACK = 770 Const SETALLJUSTVALUES = 771 Const SETCHARSET = 772 Const CSTRETCHBLT = 2048 Const BEGIN_PATH = 4096 Const CLIP_TO_PATH = 4097 Const END_PATH = 4098 Const EXT_DEVICE_CAPS = 4099 Const RESTORE_CTM = 4100 Const SAVE_CTM = 4101 Const SET_ARC_DIRECTION = 4102 Const SET_BACKGROUND_COLOR = 4103 Const SET_POLY_MODE = 4104 Const SET_SCREEN_ANGLE = 4105 Const SET_SPREAD = 4106 Const TRANSFORM_CTM = 4107 Const SET_CLIP_BOX = 4108 Const SET_BOUNDS = 4109 Const SET_MIRROR_MODE = 4110 ' Spooler Error Codes Const SP_NOTREPORTED = &H4000 Const SP_ERROR = (-1) Const SP_APPABORT = (-2) Const SP_USERABORT = (-3) Const SP_OUTOFDISK = (-4) Const SP_OUTOFMEMORY = (-5) Const PR_JOBSTATUS = &H0 ' 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 rgbtBlue As String * 1 rgbtGreen As String * 1 rgbtRed As String * 1 End Type Type RGBQUAD 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 ' constants for the biCompression field Const BI_RGB = 0 Const BI_RLE8 = 1 Const BI_RLE4 = 2 Type BITMAPINFO bmiHeader as BITMAPINFOHEADER bmiColors As String * 128 ' Array length is arbitrary; may be changed End Type Type BITMAPCOREINFO bmciHeader As BITMAPCOREHEADER bmciColors As String * 96 ' Array length is arbitrary; may be changed End Type Type BITMAPFILEHEADER 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 mm As Integer xExt As Integer yExt As Integer hMF As Integer End Type Type METAHEADER 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 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 ' GDI Logical Objects: ' Pel Array Type PELARRAY paXCount As Integer paYCount As Integer paXExt As Integer paYExt As Integer paRGBs As String * 1 End Type ' Logical Brush (or Pattern) Type LOGBRUSH lbStyle As Integer lbColor As Long lbHatch As Integer End Type ' Logical Pen Type LOGPEN lopnStyle As Integer lopnWidth As POINT lopnColor As Long End Type Type PALETTEENTRY 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 FONTS... '------------------------------------------------------- '$IFNDEF WinGDI-WinCmDlg_DECL '$DEFINE WinGDI-WinCmDlg_DECL ' Logical Font Const LF_FACESIZE = 32 Type LOGFONT 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 * LF_FACESIZE End Type '$ENDIF '---------------------------------------------------------- Const OUT_DEFAULT_PRECIS = 0 Const OUT_STRING_PRECIS = 1 Const OUT_CHARACTER_PRECIS = 2 Const OUT_STROKE_PRECIS = 3 Const CLIP_DEFAULT_PRECIS = 0 Const CLIP_CHARACTER_PRECIS = 1 Const CLIP_STROKE_PRECIS = 2 Const DEFAULT_QUALITY = 0 Const DRAFT_QUALITY = 1 Const PROOF_QUALITY = 2 Const DEFAULT_PITCH = 0 Const FIXED_PITCH = 1 Const VARIABLE_PITCH = 2 Const ANSI_CHARSET = 0 Const SYMBOL_CHARSET = 2 Const SHIFTJIS_CHARSET = 128 Const OEM_CHARSET = 255 ' Font Families ' Const FF_DONTCARE = 0 ' Don't care or don't know. Const FF_ROMAN = 16 ' Variable stroke width, serifed. ' Times Roman, Century Schoolbook, etc. Const FF_SWISS = 32 ' Variable stroke width, sans-serifed. ' Helvetica, Swiss, etc. Const FF_MODERN = 48 ' Constant stroke width, serifed or sans-serifed. ' Pica, Elite, Courier, etc. Const FF_SCRIPT = 64 ' Cursive, etc. Const FF_DECORATIVE = 80 ' Old English, etc. ' Font Weights Const FW_DONTCARE = 0 Const FW_THIN = 100 Const FW_EXTRALIGHT = 200 Const FW_LIGHT = 300 Const FW_NORMAL = 400 Const FW_MEDIUM = 500 Const FW_SEMIBOLD = 600 Const FW_BOLD = 700 Const FW_EXTRABOLD = 800 Const FW_HEAVY = 900 Const FW_ULTRALIGHT = FW_EXTRALIGHT Const FW_REGULAR = FW_NORMAL Const FW_DEMIBOLD = FW_SEMIBOLD Const FW_ULTRABOLD = FW_EXTRABOLD Const FW_BLACK = FW_HEAVY ' Background Modes Const TRANSPARENT = 1 Const OPAQUE = 2 ' Mapping Modes Const MM_TEXT = 1 Const MM_LOMETRIC = 2 Const MM_HIMETRIC = 3 Const MM_LOENGLISH = 4 Const MM_HIENGLISH = 5 Const MM_TWIPS = 6 Const MM_ISOTROPIC = 7 Const MM_ANISOTROPIC = 8 ' Coordinate Modes Const ABSOLUTE = 1 Const RELATIVE = 2 ' Stock Logical Objects Const WHITE_BRUSH = 0 Const LTGRAY_BRUSH = 1 Const GRAY_BRUSH = 2 Const DKGRAY_BRUSH = 3 Const BLACK_BRUSH = 4 Const NULL_BRUSH = 5 Const HOLLOW_BRUSH = NULL_BRUSH Const WHITE_PEN = 6 Const BLACK_PEN = 7 Const NULL_PEN = 8 Const OEM_FIXED_FONT = 10 Const ANSI_FIXED_FONT = 11 Const ANSI_VAR_FONT = 12 Const SYSTEM_FONT = 13 Const DEVICE_DEFAULT_FONT = 14 Const DEFAULT_PALETTE = 15 Const SYSTEM_FIXED_FONT = 16 ' Brush Styles Const BS_SOLID = 0 Const BS_NULL = 1 Const BS_HOLLOW = BS_NULL Const BS_HATCHED = 2 Const BS_PATTERN = 3 Const BS_INDEXED = 4 Const BS_DIBPATTERN = 5 ' Hatch Styles Const HS_HORIZONTAL = 0 ' ----- Const HS_VERTICAL = 1 ' ||||| Const HS_FDIAGONAL = 2 ' \\\\\ Const HS_BDIAGONAL = 3 ' ///// Const HS_CROSS = 4 ' +++++ Const HS_DIAGCROSS = 5 ' xxxxx ' Pen Styles Const PS_SOLID = 0 Const PS_DASH = 1 ' ------- Const PS_DOT = 2 ' ....... Const PS_DASHDOT = 3 ' _._._._ Const PS_DASHDOTDOT = 4 ' _.._.._ Const PS_NULL = 5 Const PS_INSIDEFRAME = 6 ' Device Parameters for GetDeviceCaps() Const DRIVERVERSION = 0 ' Device driver version Const TECHNOLOGY = 2 ' Device classification Const HORZSIZE = 4 ' Horizontal size in millimeters Const VERTSIZE = 6 ' Vertical size in millimeters Const HORZRES = 8 ' Horizontal width in pixels Const VERTRES = 10 ' Vertical width in pixels Const BITSPIXEL = 12 ' Number of bits per pixel Const PLANES = 14 ' Number of planes Const NUMBRUSHES = 16 ' Number of brushes the device has Const NUMPENS = 18 ' Number of pens the device has Const NUMMARKERS = 20 ' Number of markers the device has Const NUMFONTS = 22 ' Number of fonts the device has Const NUMCOLORS = 24 ' Number of colors the device supports Const PDEVICESIZE = 26 ' Size required for device descriptor Const CURVECAPS = 28 ' Curve capabilities Const LINECAPS = 30 ' Line capabilities Const POLYGONALCAPS = 32 ' Polygonal capabilities Const TEXTCAPS = 34 ' Text capabilities Const CLIPCAPS = 36 ' Clipping capabilities Const RASTERCAPS = 38 ' Bitblt capabilities Const ASPECTX = 40 ' Length of the X leg Const ASPECTY = 42 ' Length of the Y leg Const ASPECTXY = 44 ' Length of the hypotenuse Const LOGPIXELSX = 88 ' Logical pixels/inch in X Const LOGPIXELSY = 90 ' Logical pixels/inch in Y Const SIZEPALETTE = 104 ' Number of entries in physical palette Const NUMRESERVED = 106 ' Number of reserved entries in palette Const COLORRES = 108 ' Actual color resolution ' Device Capability Masks: ' Device Technologies Const DT_PLOTTER = 0 ' Vector plotter Const DT_RASDISPLAY = 1 ' Raster display Const DT_RASPRINTER = 2 ' Raster printer Const DT_RASCAMERA = 3 ' Raster camera Const DT_CHARSTREAM = 4 ' Character-stream, PLP Const DT_METAFILE = 5 ' Metafile, VDM Const DT_DISPFILE = 6 ' Display-file ' Curve Capabilities Const CC_NONE = 0 ' Curves not supported Const CC_CIRCLES = 1 ' Can do circles Const CC_PIE = 2 ' Can do pie wedges Const CC_CHORD = 4 ' Can do chord arcs Const CC_ELLIPSES = 8 ' Can do ellipese Const CC_WIDE = 16 ' Can do wide lines Const CC_STYLED = 32 ' Can do styled lines Const CC_WIDESTYLED = 64 ' Can do wide styled lines Const CC_INTERIORS = 128 ' Can do interiors ' Line Capabilities Const LC_NONE = 0 ' Lines not supported Const LC_POLYLINE = 2 ' Can do polylines Const LC_MARKER = 4 ' Can do markers Const LC_POLYMARKER = 8 ' Can do polymarkers Const LC_WIDE = 16 ' Can do wide lines Const LC_STYLED = 32 ' Can do styled lines Const LC_WIDESTYLED = 64 ' Can do wide styled lines Const LC_INTERIORS = 128 ' Can do interiors ' Polygonal Capabilities Const PC_NONE = 0 ' Polygonals not supported Const PC_POLYGON = 1 ' Can do polygons Const PC_RECTANGLE = 2 ' Can do rectangles Const PC_WINDPOLYGON = 4 ' Can do winding polygons Const PC_TRAPEZOID = 4 ' Can do trapezoids Const PC_SCANLINE = 8 ' Can do scanlines Const PC_WIDE = 16 ' Can do wide borders Const PC_STYLED = 32 ' Can do styled borders Const PC_WIDESTYLED = 64 ' Can do wide styled borders Const PC_INTERIORS = 128 ' Can do interiors ' Polygonal Capabilities Const CP_NONE = 0 ' No clipping of output Const CP_RECTANGLE = 1 ' Output clipped to rects ' Text Capabilities Const TC_OP_CHARACTER = &H1 ' Can do OutputPrecision CHARACTER Const TC_OP_STROKE = &H2 ' Can do OutputPrecision STROKE Const TC_CP_STROKE = &H4 ' Can do ClipPrecision STROKE Const TC_CR_90 = &H8 ' Can do CharRotAbility 90 Const TC_CR_ANY = &H10 ' Can do CharRotAbility ANY Const TC_SF_X_YINDEP = &H20 ' Can do ScaleFreedom X_YINDEPENDENT Const TC_SA_DOUBLE = &H40 ' Can do ScaleAbility DOUBLE Const TC_SA_INTEGER = &H80 ' Can do ScaleAbility INTEGER Const TC_SA_CONTIN = &H100 ' Can do ScaleAbility CONTINUOUS Const TC_EA_DOUBLE = &H200 ' Can do EmboldenAbility DOUBLE Const TC_IA_ABLE = &H400 ' Can do ItalisizeAbility ABLE Const TC_UA_ABLE = &H800 ' Can do UnderlineAbility ABLE Const TC_SO_ABLE = &H1000 ' Can do StrikeOutAbility ABLE Const TC_RA_ABLE = &H2000 ' Can do RasterFontAble ABLE Const TC_VA_ABLE = &H4000 ' Can do VectorFontAble ABLE Const TC_RESERVED = &H8000 ' Raster Capabilities Const RC_BITBLT = 1 ' Can do standard BLT. Const RC_BANDING = 2 ' Device requires banding support Const RC_SCALING = 4 ' Device requires scaling support Const RC_BITMAP64 = 8 ' Device can support >64K bitmap Const RC_GDI20_OUTPUT = &H10 ' has 2.0 output calls Const RC_DI_BITMAP = &H80 ' supports DIB to memory Const RC_PALETTE = &H100 ' supports a palette Const RC_DIBTODEV = &H200 ' supports DIBitsToDevice Const RC_BIGFONT = &H400 ' supports >64K fonts Const RC_STRETCHBLT = &H800 ' supports StretchBlt Const RC_FLOODFILL = &H1000 ' supports FloodFill Const RC_STRETCHDIB = &H2000 ' supports StretchDIBits ' palette entry flags Const PC_RESERVED = &H1 ' palette index used for animation Const PC_EXPLICIT = &H2 ' palette index is explicit to device Const PC_NOCOLLAPSE = &H4 ' do not match color to system palette ' DIB color table identifiers Const DIB_RGB_COLORS = 0 ' color table in RGBTriples Const DIB_PAL_COLORS = 1 ' color table in palette indices ' constants for Get/SetSystemPaletteUse() Const SYSPAL_STATIC = 1 Const SYSPAL_NOSTATIC = 2 ' constants for CreateDIBitmap Const CBM_INIT = &H4 ' initialize bitmap ' DrawText() Format Flags Const DT_TOP = &H0 Const DT_LEFT = &H0 Const DT_CENTER = &H1 Const DT_RIGHT = &H2 Const DT_VCENTER = &H4 Const DT_BOTTOM = &H8 Const DT_WORDBREAK = &H10 Const DT_SINGLELINE = &H20 Const DT_EXPANDTABS = &H40 Const DT_TABSTOP = &H80 Const DT_NOCLIP = &H100 Const DT_EXTERNALLEADING = &H200 Const DT_CALCRECT = &H400 Const DT_NOPREFIX = &H800 Const DT_INTERNAL = &H1000 Declare Function DrawText Lib "User" (hDC%, lpStr$, nCount%, lpRect As RECT, wFormat%) As Integer Declare Function DrawIcon Lib "User" (hDC%, X%, Y%, hIcon%) As Integer ' ExtFloodFill style flags Const FLOODFILLBORDER = 0 Const FLOODFILLSURFACE = 1 Declare Function GetWindowDC Lib "User" (hWnd%) As Integer Declare Function GetDC Lib "User" (hWnd%) As Integer Declare Function ReleaseDC Lib "User" (hWnd%, hDC%) As Integer Declare Function CreateDC Lib "GDI" (lpDriverName$, lpDeviceName$, lpOutput$, lpInitData$) As Integer Declare Function CreateIC Lib "GDI" (lpDriverName$, lpDeviceName$, lpOutput$, lpInitData$) As Integer Declare Function CreateCompatibleDC Lib "GDI" (hDC%) As Integer Declare Function DeleteDC Lib "GDI" (hDC%) As Integer Declare Function SaveDC Lib "GDI" (hDC%) As Integer Declare Function RestoreDC Lib "GDI" (hDC%, nSavedDC%) As Integer Declare Function MoveTo Lib "GDI" (hDC%, X%, Y%) As Long Declare Function GetCurrentPosition Lib "GDI" (hDC%) As Long Declare Function LineTo Lib "GDI" (hDC%, X%, Y%) As Integer Declare Function GetDCOrg Lib "GDI" (hDC%) As Long Declare Function MulDiv Lib "GDI" (nNumber%, nNumerator%, nDenominator%) As Integer Declare Function ExtTextOut Lib "GDI" (hDC%, X%, Y%, wOptions%, lpRect As Any, lpString$, nCount%, lpDx As Any) As Integer Declare Function Polyline Lib "GDI" (hDC%, lpPoints As POINT, nCount%) As Integer Declare Function Polygon Lib "GDI" (hDC%, lpPoints As POINT, nCount%) As Integer Declare Function PolyPolygon Lib "GDI" (hDC%, lpPoints As POINT, lpPolyCounts%, nCount%) As Integer Declare Function Rectangle Lib "GDI" (hDC%, X1%, Y1%, X2%, Y2%) As Integer Declare Function RoundRect Lib "GDI" (hDC%, X1%, Y1%, X2%, Y2%, X3%, Y3%) As Integer Declare Function Ellipse Lib "GDI" (hDC%, X1%, Y1%, X2%, Y2%) As Integer Declare Function Arc Lib "GDI" (hDC%, X1%, Y1%, X2%, Y2%, X3%, Y3%, X4%, Y4%) As Integer Declare Function Chord Lib "GDI" (hDC%, X1%, Y1%, X2%, Y2%, X3%, Y3%, X4%, Y4%) As Integer Declare Function Pie Lib "GDI" (hDC%, X1%, Y1%, X2%, Y2%, X3%, Y3%, X4%, Y4%) As Integer Declare Function PatBlt Lib "GDI" (hDC%, X%, Y%, nWidth%, nHeight%, dwRop&) As Integer Declare Function BitBlt Lib "GDI" (hDestDC%, X%, Y%, nWidth%, nHeight%, hSrcDC%, XSrc%, YSrc%, dwRop&) As Integer Declare Function StretchBlt% Lib "GDI" (hDC%, X%, Y%, nWidth%, nHeight%, hSrcDC%, XSrc%, YSrc%, nSrcWidth%, nSrcHeight%, dwRop&) Declare Function TextOut Lib "GDI" (hDC%, X%, Y%, lpString$, nCount%) As Integer Declare Function TabbedTextOut Lib "GDI" (hDC%, X%, Y%, lpString$, nCount%, nTabPositions%, lpnTabStopPositions%, nTabOrigin%) As Long Declare Function GetCharWidth Lib "GDI" (hDC%, wFirstChar%, wLastChar%, lpBuffer%) As Integer Declare Function SetPixel Lib "GDI" (hDC%, X%, Y%, crColor&) As Long Declare Function GetPixel Lib "GDI" (hDC%, X%, Y%) As Long Declare Function FloodFill Lib "GDI" (hDC%, X%, Y%, crColor&) As Integer Declare Function ExtFloodFill Lib "GDI" (hDC%, X%, Y%, crColor&, wFillType%) As Integer Declare Function GetStockObject Lib "GDI" (nIndex%) As Integer Declare Function CreatePen Lib "GDI" (nPenStyle%, nWidth%, crColor&) As Integer Declare Function CreatePenIndirect Lib "GDI" (lpLogPen As LOGPEN) As Integer Declare Function CreateSolidBrush Lib "GDI" (crColor&) As Integer Declare Function CreateHatchBrush Lib "GDI" (nIndex%, crColor&) As Integer Declare Function SetBrushOrg Lib "GDI" (hDC%, X%, Y%) As Long Declare Function GetBrushOrg Lib "GDI" (hDC%) As Long Declare Function CreatePatternBrush Lib "GDI" (hBitmap%) As Integer Declare Function CreateBrushIndirect Lib "GDI" (lpLogBrush As LOGBRUSH) As Integer Declare Function CreateBitmap Lib "GDI" (nWidth%, nHeight%, nPlanes%, nBitCount%, lpBits As Any) As Integer Declare Function CreateBitmapIndirect Lib "GDI" (lpBitmap As BITMAP) As Integer Declare Function CreateCompatibleBitmap Lib "GDI" (hDC%, nWidth%, nHeight%) As Integer Declare Function CreateDiscardableBitmap Lib "GDI" (hDC%, nWidth%, nHeight%) As Integer Declare Function SetBitmapBits Lib "GDI" (hBitmap%, dwCount&, lpBits As Any) As Long Declare Function GetBitmapBits Lib "GDI" (hBitmap%, dwCount&, lpBits As Any) As Long Declare Function SetBitmapDimension Lib "GDI" (hBitmap%, X%, Y%) As Long Declare Function GetBitmapDimension Lib "GDI" (hBitmap%) As Long Declare Function CreateFont% Lib "GDI" (H%, W%, E%, O%, W%, I%, U%, S%, C%, OP%, CP%, Q%, PAF%, F$) Declare Function CreateFontIndirect Lib "GDI" (lpLogFont As LOGFONT) As Integer Declare Function SelectClipRgn Lib "GDI" (hDC%, hRgn%) As Integer Declare Function CreateRectRgn Lib "GDI" (X1%, Y1%, X2%, Y2%) As Integer Declare Sub SetRectRgn Lib "GDI" (hRgn%, X1%, Y1%, X2%, Y2%) Declare Function CreateRectRgnIndirect Lib "GDI" (lpRect As RECT) As Integer Declare Function CreateEllipticRgnIndirect Lib "GDI" (lpRect As RECT) As Integer Declare Function CreateEllipticRgn Lib "GDI" (X1%, Y1%, X2%, Y2%) As Integer Declare Function CreatePolygonRgn Lib "GDI" (lpPoints As POINT, nCount%, nPolyFillMode%) As Integer Declare Function CreatePolyPolygonRgn Lib "GDI" (lpPoints As POINT, lpPolyCounts%, nCount%, nPolyFillMode%) As Integer Declare Function CreateRoundRectRgn Lib "GDI" (X1%, Y1%, X2%, Y2%, X3%, Y3%) As Integer Declare Function GetObject Lib "GDI" (hObject%, nCount%, lpObject&) As Integer Declare Function DeleteObject Lib "GDI" (hObject%) As Integer Declare Function SelectObject Lib "GDI" (hDC%, hObject%) As Integer Declare Function UnrealizeObject Lib "GDI" (hObject%) As Integer Declare Function SetBkColor Lib "GDI" (hDC%, crColor&) As Long Declare Function GetBkColor Lib "GDI" (hDC%) As Long Declare Function SetBkMode Lib "GDI" (hDC%, nBkMode%) As Integer Declare Function GetBkMode Lib "GDI" (hDC%) As Integer Declare Function SetTextColor Lib "GDI" (hDC%, crColor&) As Long Declare Function GetTextColor Lib "GDI" (hDC%) As Long Declare Function SetTextAlign Lib "GDI" (hDC%, wFlags%) As Integer Declare Function GetTextAlign Lib "GDI" (hDC%) As Integer Declare Function SetMapperFlags Lib "GDI" (hDC%, dwFlag&) As Long Declare Function GetAspectRatioFilter Lib "GDI" (hDC%) As Long Declare Function GetNearestColor Lib "GDI" (hDC%, crColor&) As Long Declare Function SetROP2 Lib "GDI" (hDC%, nDrawMode%) As Integer Declare Function GetROP2 Lib "GDI" (hDC%) As Integer Declare Function SetStretchBltMode Lib "GDI" (hDC%, nStretchMode%) As Integer Declare Function GetStretchBltMode Lib "GDI" (hDC%) As Integer Declare Function SetPolyFillMode Lib "GDI" (hDC%, nPolyFillMode%) As Integer Declare Function GetPolyFillMode Lib "GDI" (hDC%) As Integer Declare Function SetMapMode Lib "GDI" (hDC%, nMapMode%) As Integer Declare Function GetMapMode Lib "GDI" (hDC%) As Integer Declare Function SetWindowOrg Lib "GDI" (hDC%, X%, Y%) As Long Declare Function GetWindowOrg Lib "GDI" (hDC%) As Long Declare Function SetWindowExt Lib "GDI" (hDC%, X%, Y%) As Long Declare Function GetWindowExt Lib "GDI" (hDC%) As Long Declare Function SetViewportOrg Lib "GDI" (hDC%, X%, Y%) As Long Declare Function GetViewportOrg Lib "GDI" (hDC%) As Long Declare Function SetViewportExt Lib "GDI" (hDC%, X%, Y%) As Long Declare Function GetViewportExt Lib "GDI" (hDC%) As Long Declare Function OffsetViewportOrg Lib "GDI" (hDC%, X%, Y%) As Long Declare Function ScaleViewportExt Lib "GDI" (hDC%, Xnum%, Xdenom%, Ynum%, Ydenom%) As Long Declare Function OffsetWindowOrg Lib "GDI" (hDC%, X%, Y%) As Long Declare Function ScaleWindowExt Lib "GDI" (hDC%, Xnum%, Xdenom%, Ynum%, Ydenom%) As Long Declare Function GetClipBox Lib "GDI" (hDC%, lpRect As RECT) As Integer Declare Function IntersectClipRect Lib "GDI" (hDC%, X1%, Y1%, X2%, Y2%) As Integer Declare Function OffsetClipRgn Lib "GDI" (hDC%, X%, Y%) As Integer Declare Function ExcludeClipRect Lib "GDI" (hDC%, X1%, Y1%, X2%, Y2%) As Integer Declare Function PtVisible Lib "GDI" (hDC%, X%, Y%) As Integer Declare Function CombineRgn Lib "GDI" (hDestRgn%, hSrcRgn1%, hSrcRgn2%, nCombineMode%) As Integer Declare Function EqualRgn Lib "GDI" (hSrcRgn1%, hSrcRgn2%) As Integer Declare Function OffsetRgn Lib "GDI" (hRgn%, X%, Y%) As Integer Declare Function GetRgnBox Lib "GDI" (hRgn%, lpRect As RECT) As Integer Declare Function SetTextJustification Lib "GDI" (hDC%, nBreakExtra%, nBreakCount%) As Integer Declare Function GetTextExtent Lib "GDI" (hDC%, lpString$, nCount%) As Long Declare Function GetTabbedTextExtent Lib "GDI" (hDC%, lpString$, nCount%, nTabPositions%, lpnTabStopPositions%) As Long Declare Function SetTextCharacterExtra Lib "GDI" (hDC%, nCharExtra%) As Integer Declare Function GetTextCharacterExtra Lib "GDI" (hDC%) As Integer Declare Function GetMetaFile Lib "GDI" (lpFilename$) As Integer Declare Function DeleteMetaFile Lib "GDI" (hMF%) As Integer Declare Function CopyMetaFile Lib "GDI" (hMF%, lpFilename$) As Integer Declare Function PlayMetaFile Lib "GDI" (hDC%, hMF%) As Integer Declare Sub PlayMetaFileRecord Lib "GDI" (hDC%, lpHandletable%, lpMetaRecord As METARECORD, nHandles%) Declare Function Escape Lib "GDI" (hDC%, nEscape%, nCount%, lplnData As Any, lpOutData As Any) As Integer Declare Function GetTextFace Lib "GDI" (hDC%, nCount%, lpFacename$) As Integer Declare Function GetTextMetrics Lib "GDI" (hDC%, lpMetrics As TEXTMETRIC) As Integer Declare Function GetDeviceCaps Lib "GDI" (hDC%, nIndex%) As Integer Declare Function SetEnvironment Lib "GDI" (lpPortName$, lpEnviron$, nCount%) As Integer Declare Function GetEnvironment Lib "GDI" (lpPortName$, lpEnviron As Any, nMaxCount%) As Integer Declare Function DPtoLP Lib "GDI" (hDC%, lpPoints As POINT, nCount%) As Integer Declare Function LPtoDP Lib "GDI" (hDC%, lpPoints As POINT, nCount%) As Integer Declare Function CreateMetaFile Lib "GDI" (lpString As Any) As Integer Declare Function CloseMetaFile Lib "GDI" (hMF%) As Integer Declare Function GetMetaFileBits Lib "GDI" (hMF%) As Integer Declare Function SetMetaFileBits Lib "GDI" (hMem%) As Integer Declare Function SetDIBits Lib "GDI" (aHDC%, hBitmap%, nStartScan%, nNumScans%, lpBits$, lpBI As BITMAPINFO, wUsage%) As Integer Declare Function GetDIBits Lib "GDI" (aHDC%, hBitmap%, nStartScan%, nNumScans%, lpBits$, lpBI As BITMAPINFO, wUsage%) As Integer Declare Function SetDIBitsToDevice% Lib "GDI" (hDC%, X%, Y%, dX%, dY%, SrcX%, SrcY%, Scan%, NumScans%, Bits$, BitsInfo As BITMAPINFO, wUsage%) Declare Function CreateDIBitmap Lib "GDI" (hDC%, lpInfoHeader As BITMAPINFOHEADER, dwUsage&, lpInitBits$, lpInitInfo As BITMAPINFO, wUsage%) As Integer Declare Function CreateDIBPatternBrush Lib "GDI" (hPackedDIB%, wUsage%) As Integer Declare Function StretchDIBits& Lib "GDI" (hDC%, X%, Y%, dX&, dY%, SrcX%, SrcY%, wSrcWidth%, wSrcHeight%, lpBits$, lpBitsInfo As BITMAPINFO, wUsage%, dwRop&) Declare Function CreatePalette Lib "GDI" (lpLogPalette As LOGPALETTE) As Integer Declare Function SelectPalette Lib "GDI" (hDC%, hPalette%, bForceBackground%) As Integer Declare Function RealizePalette Lib "GDI" (hDC%) As Integer Declare Function UpdateColors Lib "GDI" (hDC%) As Integer Declare Sub AnimatePalette Lib "GDI" (hPalette%, wStartIndex%, wNumEntries%, lpPaletteColors As PALETTEENTRY) Declare Function SetPaletteEntries Lib "GDI" (hPalette%, wStartIndex%, wNumEntries%, lpPaletteEntries As PALETTEENTRY) As Integer Declare Function GetPaletteEntries Lib "GDI" (hPalette%, wStartIndex%, wNumEntries%, lpPaletteEntries As PALETTEENTRY) As Integer Declare Function GetNearestPaletteIndex Lib "GDI" (hPalette%, crColor&) As Integer Declare Function ResizePalette Lib "GDI" (hPalette%, nNumEntries%) As Integer Declare Function GetSystemPaletteEntries Lib "GDI" (hDC%, wStartIndex%, wNumEntries%, lpPaletteEntries As PALETTEENTRY) As Integer Declare Function GetSystemPaletteUse Lib "GDI" (hDC%) As Integer Declare Function SetSystemPaletteUse Lib "GDI" (hDC%, wUsage%) As Integer '$ENDIF