go-tg-screenshot-bot
1971 строка · 51.4 Кб
1// Copyright 2010 The win Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build windows
6
7package win8
9import (10"syscall"11"unsafe"12
13"golang.org/x/sys/windows"14)
15
16// GetDeviceCaps index constants
17const (18DRIVERVERSION = 019TECHNOLOGY = 220HORZSIZE = 421VERTSIZE = 622HORZRES = 823VERTRES = 1024LOGPIXELSX = 8825LOGPIXELSY = 9026BITSPIXEL = 1227PLANES = 1428NUMBRUSHES = 1629NUMPENS = 1830NUMFONTS = 2231NUMCOLORS = 2432NUMMARKERS = 2033ASPECTX = 4034ASPECTY = 4235ASPECTXY = 4436PDEVICESIZE = 2637CLIPCAPS = 3638SIZEPALETTE = 10439NUMRESERVED = 10640COLORRES = 10841PHYSICALWIDTH = 11042PHYSICALHEIGHT = 11143PHYSICALOFFSETX = 11244PHYSICALOFFSETY = 11345SCALINGFACTORX = 11446SCALINGFACTORY = 11547VREFRESH = 11648DESKTOPHORZRES = 11849DESKTOPVERTRES = 11750BLTALIGNMENT = 11951SHADEBLENDCAPS = 12052COLORMGMTCAPS = 12153RASTERCAPS = 3854CURVECAPS = 2855LINECAPS = 3056POLYGONALCAPS = 3257TEXTCAPS = 3458)
59
60// GetDeviceCaps TECHNOLOGY constants
61const (62DT_PLOTTER = 063DT_RASDISPLAY = 164DT_RASPRINTER = 265DT_RASCAMERA = 366DT_CHARSTREAM = 467DT_METAFILE = 568DT_DISPFILE = 669)
70
71// GetDeviceCaps SHADEBLENDCAPS constants
72const (73SB_NONE = 0x0074SB_CONST_ALPHA = 0x0175SB_PIXEL_ALPHA = 0x0276SB_PREMULT_ALPHA = 0x0477SB_GRAD_RECT = 0x1078SB_GRAD_TRI = 0x2079)
80
81// GetDeviceCaps COLORMGMTCAPS constants
82const (83CM_NONE = 0x0084CM_DEVICE_ICM = 0x0185CM_GAMMA_RAMP = 0x0286CM_CMYK_COLOR = 0x0487)
88
89// GetDeviceCaps RASTERCAPS constants
90const (91RC_BANDING = 292RC_BITBLT = 193RC_BITMAP64 = 894RC_DI_BITMAP = 12895RC_DIBTODEV = 51296RC_FLOODFILL = 409697RC_GDI20_OUTPUT = 1698RC_PALETTE = 25699RC_SCALING = 4100RC_STRETCHBLT = 2048101RC_STRETCHDIB = 8192102RC_DEVBITS = 0x8000103RC_OP_DX_OUTPUT = 0x4000104)
105
106// GetDeviceCaps CURVECAPS constants
107const (108CC_NONE = 0109CC_CIRCLES = 1110CC_PIE = 2111CC_CHORD = 4112CC_ELLIPSES = 8113CC_WIDE = 16114CC_STYLED = 32115CC_WIDESTYLED = 64116CC_INTERIORS = 128117CC_ROUNDRECT = 256118)
119
120// GetDeviceCaps LINECAPS constants
121const (122LC_NONE = 0123LC_POLYLINE = 2124LC_MARKER = 4125LC_POLYMARKER = 8126LC_WIDE = 16127LC_STYLED = 32128LC_WIDESTYLED = 64129LC_INTERIORS = 128130)
131
132// GetDeviceCaps POLYGONALCAPS constants
133const (134PC_NONE = 0135PC_POLYGON = 1136PC_POLYPOLYGON = 256137PC_PATHS = 512138PC_RECTANGLE = 2139PC_WINDPOLYGON = 4140PC_SCANLINE = 8141PC_TRAPEZOID = 4142PC_WIDE = 16143PC_STYLED = 32144PC_WIDESTYLED = 64145PC_INTERIORS = 128146)
147
148// GetDeviceCaps TEXTCAPS constants
149const (150TC_OP_CHARACTER = 1151TC_OP_STROKE = 2152TC_CP_STROKE = 4153TC_CR_90 = 8154TC_CR_ANY = 16155TC_SF_X_YINDEP = 32156TC_SA_DOUBLE = 64157TC_SA_INTEGER = 128158TC_SA_CONTIN = 256159TC_EA_DOUBLE = 512160TC_IA_ABLE = 1024161TC_UA_ABLE = 2048162TC_SO_ABLE = 4096163TC_RA_ABLE = 8192164TC_VA_ABLE = 16384165TC_RESERVED = 32768166TC_SCROLLBLT = 65536167)
168
169// Brush styles
170const (171BS_SOLID = 0172BS_NULL = 1173BS_HOLLOW = BS_NULL174BS_HATCHED = 2175BS_PATTERN = 3176BS_INDEXED = 4177BS_DIBPATTERN = 5178BS_DIBPATTERNPT = 6179BS_PATTERN8X8 = 7180BS_DIBPATTERN8X8 = 8181BS_MONOPATTERN = 9182)
183
184// Hatch styles
185const (186HS_HORIZONTAL = 0187HS_VERTICAL = 1188HS_FDIAGONAL = 2189HS_BDIAGONAL = 3190HS_CROSS = 4191HS_DIAGCROSS = 5192)
193
194// Pen types
195const (196PS_COSMETIC = 0x00000000197PS_GEOMETRIC = 0x00010000198PS_TYPE_MASK = 0x000F0000199)
200
201// Pen styles
202const (203PS_SOLID = 0204PS_DASH = 1205PS_DOT = 2206PS_DASHDOT = 3207PS_DASHDOTDOT = 4208PS_NULL = 5209PS_INSIDEFRAME = 6210PS_USERSTYLE = 7211PS_ALTERNATE = 8212PS_STYLE_MASK = 0x0000000F213)
214
215// Pen cap types
216const (217PS_ENDCAP_ROUND = 0x00000000218PS_ENDCAP_SQUARE = 0x00000100219PS_ENDCAP_FLAT = 0x00000200220PS_ENDCAP_MASK = 0x00000F00221)
222
223// Pen join types
224const (225PS_JOIN_ROUND = 0x00000000226PS_JOIN_BEVEL = 0x00001000227PS_JOIN_MITER = 0x00002000228PS_JOIN_MASK = 0x0000F000229)
230
231// Print constants
232const (233PRF_NONCLIENT = 0x00000002234PRF_CLIENT = 0x00000004235PRF_ERASEBKGND = 0x00000008236PRF_CHILDREN = 0x00000010237PRF_OWNED = 0x00000020238)
239
240// Stock logical objects
241const (242WHITE_BRUSH = 0243LTGRAY_BRUSH = 1244GRAY_BRUSH = 2245DKGRAY_BRUSH = 3246BLACK_BRUSH = 4247NULL_BRUSH = 5248HOLLOW_BRUSH = NULL_BRUSH249WHITE_PEN = 6250BLACK_PEN = 7251NULL_PEN = 8252OEM_FIXED_FONT = 10253ANSI_FIXED_FONT = 11254ANSI_VAR_FONT = 12255SYSTEM_FONT = 13256DEVICE_DEFAULT_FONT = 14257DEFAULT_PALETTE = 15258SYSTEM_FIXED_FONT = 16259DEFAULT_GUI_FONT = 17260DC_BRUSH = 18261DC_PEN = 19262)
263
264const LF_FACESIZE = 32265
266// Font weight constants
267const (268FW_DONTCARE = 0269FW_THIN = 100270FW_EXTRALIGHT = 200271FW_ULTRALIGHT = FW_EXTRALIGHT272FW_LIGHT = 300273FW_NORMAL = 400274FW_REGULAR = 400275FW_MEDIUM = 500276FW_SEMIBOLD = 600277FW_DEMIBOLD = FW_SEMIBOLD278FW_BOLD = 700279FW_EXTRABOLD = 800280FW_ULTRABOLD = FW_EXTRABOLD281FW_HEAVY = 900282FW_BLACK = FW_HEAVY283)
284
285// Charset constants
286const (287ANSI_CHARSET = 0288DEFAULT_CHARSET = 1289SYMBOL_CHARSET = 2290SHIFTJIS_CHARSET = 128291HANGEUL_CHARSET = 129292HANGUL_CHARSET = 129293GB2312_CHARSET = 134294CHINESEBIG5_CHARSET = 136295GREEK_CHARSET = 161296TURKISH_CHARSET = 162297HEBREW_CHARSET = 177298ARABIC_CHARSET = 178299BALTIC_CHARSET = 186300RUSSIAN_CHARSET = 204301THAI_CHARSET = 222302EASTEUROPE_CHARSET = 238303OEM_CHARSET = 255304JOHAB_CHARSET = 130305VIETNAMESE_CHARSET = 163306MAC_CHARSET = 77307)
308
309// Font output precision constants
310const (311OUT_DEFAULT_PRECIS = 0312OUT_STRING_PRECIS = 1313OUT_CHARACTER_PRECIS = 2314OUT_STROKE_PRECIS = 3315OUT_TT_PRECIS = 4316OUT_DEVICE_PRECIS = 5317OUT_RASTER_PRECIS = 6318OUT_TT_ONLY_PRECIS = 7319OUT_OUTLINE_PRECIS = 8320OUT_PS_ONLY_PRECIS = 10321)
322
323// Font clipping precision constants
324const (325CLIP_DEFAULT_PRECIS = 0326CLIP_CHARACTER_PRECIS = 1327CLIP_STROKE_PRECIS = 2328CLIP_MASK = 15329CLIP_LH_ANGLES = 16330CLIP_TT_ALWAYS = 32331CLIP_EMBEDDED = 128332)
333
334// Font output quality constants
335const (336DEFAULT_QUALITY = 0337DRAFT_QUALITY = 1338PROOF_QUALITY = 2339NONANTIALIASED_QUALITY = 3340ANTIALIASED_QUALITY = 4341CLEARTYPE_QUALITY = 5342)
343
344// Font pitch constants
345const (346DEFAULT_PITCH = 0347FIXED_PITCH = 1348VARIABLE_PITCH = 2349)
350
351// Font family constants
352const (353FF_DECORATIVE = 80354FF_DONTCARE = 0355FF_MODERN = 48356FF_ROMAN = 16357FF_SCRIPT = 64358FF_SWISS = 32359)
360
361// DeviceCapabilities capabilities
362const (363DC_FIELDS = 1364DC_PAPERS = 2365DC_PAPERSIZE = 3366DC_MINEXTENT = 4367DC_MAXEXTENT = 5368DC_BINS = 6369DC_DUPLEX = 7370DC_SIZE = 8371DC_EXTRA = 9372DC_VERSION = 10373DC_DRIVER = 11374DC_BINNAMES = 12375DC_ENUMRESOLUTIONS = 13376DC_FILEDEPENDENCIES = 14377DC_TRUETYPE = 15378DC_PAPERNAMES = 16379DC_ORIENTATION = 17380DC_COPIES = 18381DC_BINADJUST = 19382DC_EMF_COMPLIANT = 20383DC_DATATYPE_PRODUCED = 21384DC_COLLATE = 22385DC_MANUFACTURER = 23386DC_MODEL = 24387DC_PERSONALITY = 25388DC_PRINTRATE = 26389DC_PRINTRATEUNIT = 27390DC_PRINTERMEM = 28391DC_MEDIAREADY = 29392DC_STAPLE = 30393DC_PRINTRATEPPM = 31394DC_COLORDEVICE = 32395DC_NUP = 33396DC_MEDIATYPENAMES = 34397DC_MEDIATYPES = 35398)
399
400const (401CCHDEVICENAME = 32402CCHFORMNAME = 32403)
404
405const (406DM_UPDATE = 1407DM_COPY = 2408DM_PROMPT = 4409DM_MODIFY = 8410DM_IN_BUFFER = DM_MODIFY411DM_IN_PROMPT = DM_PROMPT412DM_OUT_BUFFER = DM_COPY413DM_OUT_DEFAULT = DM_UPDATE414)
415
416// DEVMODE field selection bits
417const (418DM_ORIENTATION = 0x00000001419DM_PAPERSIZE = 0x00000002420DM_PAPERLENGTH = 0x00000004421DM_PAPERWIDTH = 0x00000008422DM_SCALE = 0x00000010423DM_POSITION = 0x00000020424DM_NUP = 0x00000040425DM_DISPLAYORIENTATION = 0x00000080426DM_COPIES = 0x00000100427DM_DEFAULTSOURCE = 0x00000200428DM_PRINTQUALITY = 0x00000400429DM_COLOR = 0x00000800430DM_DUPLEX = 0x00001000431DM_YRESOLUTION = 0x00002000432DM_TTOPTION = 0x00004000433DM_COLLATE = 0x00008000434DM_FORMNAME = 0x00010000435DM_LOGPIXELS = 0x00020000436DM_BITSPERPEL = 0x00040000437DM_PELSWIDTH = 0x00080000438DM_PELSHEIGHT = 0x00100000439DM_DISPLAYFLAGS = 0x00200000440DM_DISPLAYFREQUENCY = 0x00400000441DM_ICMMETHOD = 0x00800000442DM_ICMINTENT = 0x01000000443DM_MEDIATYPE = 0x02000000444DM_DITHERTYPE = 0x04000000445DM_PANNINGWIDTH = 0x08000000446DM_PANNINGHEIGHT = 0x10000000447DM_DISPLAYFIXEDOUTPUT = 0x20000000448)
449
450// Orientation constants
451const (452DMORIENT_PORTRAIT = 1453DMORIENT_LANDSCAPE = 2454)
455
456// Paper sizes
457const (458DMPAPER_FIRST = DMPAPER_LETTER459DMPAPER_LETTER = 1 /* Letter 8 1/2 x 11 in */460DMPAPER_LETTERSMALL = 2 /* Letter Small 8 1/2 x 11 in */461DMPAPER_TABLOID = 3 /* Tabloid 11 x 17 in */462DMPAPER_LEDGER = 4 /* Ledger 17 x 11 in */463DMPAPER_LEGAL = 5 /* Legal 8 1/2 x 14 in */464DMPAPER_STATEMENT = 6 /* Statement 5 1/2 x 8 1/2 in */465DMPAPER_EXECUTIVE = 7 /* Executive 7 1/4 x 10 1/2 in */466DMPAPER_A3 = 8 /* A3 297 x 420 mm */467DMPAPER_A4 = 9 /* A4 210 x 297 mm */468DMPAPER_A4SMALL = 10 /* A4 Small 210 x 297 mm */469DMPAPER_A5 = 11 /* A5 148 x 210 mm */470DMPAPER_B4 = 12 /* B4 (JIS) 250 x 354 */471DMPAPER_B5 = 13 /* B5 (JIS) 182 x 257 mm */472DMPAPER_FOLIO = 14 /* Folio 8 1/2 x 13 in */473DMPAPER_QUARTO = 15 /* Quarto 215 x 275 mm */474DMPAPER_10X14 = 16 /* 10x14 in */475DMPAPER_11X17 = 17 /* 11x17 in */476DMPAPER_NOTE = 18 /* Note 8 1/2 x 11 in */477DMPAPER_ENV_9 = 19 /* Envelope #9 3 7/8 x 8 7/8 */478DMPAPER_ENV_10 = 20 /* Envelope #10 4 1/8 x 9 1/2 */479DMPAPER_ENV_11 = 21 /* Envelope #11 4 1/2 x 10 3/8 */480DMPAPER_ENV_12 = 22 /* Envelope #12 4 \276 x 11 */481DMPAPER_ENV_14 = 23 /* Envelope #14 5 x 11 1/2 */482DMPAPER_CSHEET = 24 /* C size sheet */483DMPAPER_DSHEET = 25 /* D size sheet */484DMPAPER_ESHEET = 26 /* E size sheet */485DMPAPER_ENV_DL = 27 /* Envelope DL 110 x 220mm */486DMPAPER_ENV_C5 = 28 /* Envelope C5 162 x 229 mm */487DMPAPER_ENV_C3 = 29 /* Envelope C3 324 x 458 mm */488DMPAPER_ENV_C4 = 30 /* Envelope C4 229 x 324 mm */489DMPAPER_ENV_C6 = 31 /* Envelope C6 114 x 162 mm */490DMPAPER_ENV_C65 = 32 /* Envelope C65 114 x 229 mm */491DMPAPER_ENV_B4 = 33 /* Envelope B4 250 x 353 mm */492DMPAPER_ENV_B5 = 34 /* Envelope B5 176 x 250 mm */493DMPAPER_ENV_B6 = 35 /* Envelope B6 176 x 125 mm */494DMPAPER_ENV_ITALY = 36 /* Envelope 110 x 230 mm */495DMPAPER_ENV_MONARCH = 37 /* Envelope Monarch 3.875 x 7.5 in */496DMPAPER_ENV_PERSONAL = 38 /* 6 3/4 Envelope 3 5/8 x 6 1/2 in */497DMPAPER_FANFOLD_US = 39 /* US Std Fanfold 14 7/8 x 11 in */498DMPAPER_FANFOLD_STD_GERMAN = 40 /* German Std Fanfold 8 1/2 x 12 in */499DMPAPER_FANFOLD_LGL_GERMAN = 41 /* German Legal Fanfold 8 1/2 x 13 in */500DMPAPER_ISO_B4 = 42 /* B4 (ISO) 250 x 353 mm */501DMPAPER_JAPANESE_POSTCARD = 43 /* Japanese Postcard 100 x 148 mm */502DMPAPER_9X11 = 44 /* 9 x 11 in */503DMPAPER_10X11 = 45 /* 10 x 11 in */504DMPAPER_15X11 = 46 /* 15 x 11 in */505DMPAPER_ENV_INVITE = 47 /* Envelope Invite 220 x 220 mm */506DMPAPER_RESERVED_48 = 48 /* RESERVED--DO NOT USE */507DMPAPER_RESERVED_49 = 49 /* RESERVED--DO NOT USE */508DMPAPER_LETTER_EXTRA = 50 /* Letter Extra 9 \275 x 12 in */509DMPAPER_LEGAL_EXTRA = 51 /* Legal Extra 9 \275 x 15 in */510DMPAPER_TABLOID_EXTRA = 52 /* Tabloid Extra 11.69 x 18 in */511DMPAPER_A4_EXTRA = 53 /* A4 Extra 9.27 x 12.69 in */512DMPAPER_LETTER_TRANSVERSE = 54 /* Letter Transverse 8 \275 x 11 in */513DMPAPER_A4_TRANSVERSE = 55 /* A4 Transverse 210 x 297 mm */514DMPAPER_LETTER_EXTRA_TRANSVERSE = 56 /* Letter Extra Transverse 9\275 x 12 in */515DMPAPER_A_PLUS = 57 /* SuperA/SuperA/A4 227 x 356 mm */516DMPAPER_B_PLUS = 58 /* SuperB/SuperB/A3 305 x 487 mm */517DMPAPER_LETTER_PLUS = 59 /* Letter Plus 8.5 x 12.69 in */518DMPAPER_A4_PLUS = 60 /* A4 Plus 210 x 330 mm */519DMPAPER_A5_TRANSVERSE = 61 /* A5 Transverse 148 x 210 mm */520DMPAPER_B5_TRANSVERSE = 62 /* B5 (JIS) Transverse 182 x 257 mm */521DMPAPER_A3_EXTRA = 63 /* A3 Extra 322 x 445 mm */522DMPAPER_A5_EXTRA = 64 /* A5 Extra 174 x 235 mm */523DMPAPER_B5_EXTRA = 65 /* B5 (ISO) Extra 201 x 276 mm */524DMPAPER_A2 = 66 /* A2 420 x 594 mm */525DMPAPER_A3_TRANSVERSE = 67 /* A3 Transverse 297 x 420 mm */526DMPAPER_A3_EXTRA_TRANSVERSE = 68 /* A3 Extra Transverse 322 x 445 mm */527DMPAPER_DBL_JAPANESE_POSTCARD = 69 /* Japanese Double Postcard 200 x 148 mm */528DMPAPER_A6 = 70 /* A6 105 x 148 mm */529DMPAPER_JENV_KAKU2 = 71 /* Japanese Envelope Kaku #2 */530DMPAPER_JENV_KAKU3 = 72 /* Japanese Envelope Kaku #3 */531DMPAPER_JENV_CHOU3 = 73 /* Japanese Envelope Chou #3 */532DMPAPER_JENV_CHOU4 = 74 /* Japanese Envelope Chou #4 */533DMPAPER_LETTER_ROTATED = 75 /* Letter Rotated 11 x 8 1/2 11 in */534DMPAPER_A3_ROTATED = 76 /* A3 Rotated 420 x 297 mm */535DMPAPER_A4_ROTATED = 77 /* A4 Rotated 297 x 210 mm */536DMPAPER_A5_ROTATED = 78 /* A5 Rotated 210 x 148 mm */537DMPAPER_B4_JIS_ROTATED = 79 /* B4 (JIS) Rotated 364 x 257 mm */538DMPAPER_B5_JIS_ROTATED = 80 /* B5 (JIS) Rotated 257 x 182 mm */539DMPAPER_JAPANESE_POSTCARD_ROTATED = 81 /* Japanese Postcard Rotated 148 x 100 mm */540DMPAPER_DBL_JAPANESE_POSTCARD_ROTATED = 82 /* Double Japanese Postcard Rotated 148 x 200 mm */541DMPAPER_A6_ROTATED = 83 /* A6 Rotated 148 x 105 mm */542DMPAPER_JENV_KAKU2_ROTATED = 84 /* Japanese Envelope Kaku #2 Rotated */543DMPAPER_JENV_KAKU3_ROTATED = 85 /* Japanese Envelope Kaku #3 Rotated */544DMPAPER_JENV_CHOU3_ROTATED = 86 /* Japanese Envelope Chou #3 Rotated */545DMPAPER_JENV_CHOU4_ROTATED = 87 /* Japanese Envelope Chou #4 Rotated */546DMPAPER_B6_JIS = 88 /* B6 (JIS) 128 x 182 mm */547DMPAPER_B6_JIS_ROTATED = 89 /* B6 (JIS) Rotated 182 x 128 mm */548DMPAPER_12X11 = 90 /* 12 x 11 in */549DMPAPER_JENV_YOU4 = 91 /* Japanese Envelope You #4 */550DMPAPER_JENV_YOU4_ROTATED = 92 /* Japanese Envelope You #4 Rotated*/551DMPAPER_P16K = 93 /* PRC 16K 146 x 215 mm */552DMPAPER_P32K = 94 /* PRC 32K 97 x 151 mm */553DMPAPER_P32KBIG = 95 /* PRC 32K(Big) 97 x 151 mm */554DMPAPER_PENV_1 = 96 /* PRC Envelope #1 102 x 165 mm */555DMPAPER_PENV_2 = 97 /* PRC Envelope #2 102 x 176 mm */556DMPAPER_PENV_3 = 98 /* PRC Envelope #3 125 x 176 mm */557DMPAPER_PENV_4 = 99 /* PRC Envelope #4 110 x 208 mm */558DMPAPER_PENV_5 = 100 /* PRC Envelope #5 110 x 220 mm */559DMPAPER_PENV_6 = 101 /* PRC Envelope #6 120 x 230 mm */560DMPAPER_PENV_7 = 102 /* PRC Envelope #7 160 x 230 mm */561DMPAPER_PENV_8 = 103 /* PRC Envelope #8 120 x 309 mm */562DMPAPER_PENV_9 = 104 /* PRC Envelope #9 229 x 324 mm */563DMPAPER_PENV_10 = 105 /* PRC Envelope #10 324 x 458 mm */564DMPAPER_P16K_ROTATED = 106 /* PRC 16K Rotated */565DMPAPER_P32K_ROTATED = 107 /* PRC 32K Rotated */566DMPAPER_P32KBIG_ROTATED = 108 /* PRC 32K(Big) Rotated */567DMPAPER_PENV_1_ROTATED = 109 /* PRC Envelope #1 Rotated 165 x 102 mm */568DMPAPER_PENV_2_ROTATED = 110 /* PRC Envelope #2 Rotated 176 x 102 mm */569DMPAPER_PENV_3_ROTATED = 111 /* PRC Envelope #3 Rotated 176 x 125 mm */570DMPAPER_PENV_4_ROTATED = 112 /* PRC Envelope #4 Rotated 208 x 110 mm */571DMPAPER_PENV_5_ROTATED = 113 /* PRC Envelope #5 Rotated 220 x 110 mm */572DMPAPER_PENV_6_ROTATED = 114 /* PRC Envelope #6 Rotated 230 x 120 mm */573DMPAPER_PENV_7_ROTATED = 115 /* PRC Envelope #7 Rotated 230 x 160 mm */574DMPAPER_PENV_8_ROTATED = 116 /* PRC Envelope #8 Rotated 309 x 120 mm */575DMPAPER_PENV_9_ROTATED = 117 /* PRC Envelope #9 Rotated 324 x 229 mm */576DMPAPER_PENV_10_ROTATED = 118 /* PRC Envelope #10 Rotated 458 x 324 mm */577DMPAPER_LAST = DMPAPER_PENV_10_ROTATED578DMPAPER_USER = 256579)
580
581// Bin constants
582const (583DMBIN_FIRST = DMBIN_UPPER584DMBIN_UPPER = 1585DMBIN_ONLYONE = 1586DMBIN_LOWER = 2587DMBIN_MIDDLE = 3588DMBIN_MANUAL = 4589DMBIN_ENVELOPE = 5590DMBIN_ENVMANUAL = 6591DMBIN_AUTO = 7592DMBIN_TRACTOR = 8593DMBIN_SMALLFMT = 9594DMBIN_LARGEFMT = 10595DMBIN_LARGECAPACITY = 11596DMBIN_CASSETTE = 14597DMBIN_FORMSOURCE = 15598DMBIN_LAST = DMBIN_FORMSOURCE599DMBIN_USER = 256600)
601
602// Quality constants
603const (604DMRES_DRAFT = -1605DMRES_LOW = -2606DMRES_MEDIUM = -3607DMRES_HIGH = -4608)
609
610// Color/monochrome constants
611const (612DMCOLOR_MONOCHROME = 1613DMCOLOR_COLOR = 2614)
615
616// Duplex constants
617const (618DMDUP_SIMPLEX = 1619DMDUP_VERTICAL = 2620DMDUP_HORIZONTAL = 3621)
622
623// TrueType constants
624const (625DMTT_BITMAP = 1626DMTT_DOWNLOAD = 2627DMTT_SUBDEV = 3628DMTT_DOWNLOAD_OUTLINE = 4629)
630
631// Collation constants
632const (633DMCOLLATE_FALSE = 0634DMCOLLATE_TRUE = 1635)
636
637// Background modes
638const (639TRANSPARENT = 1640OPAQUE = 2641)
642
643// Ternary raster operations
644const (645SRCCOPY = 0x00CC0020646SRCPAINT = 0x00EE0086647SRCAND = 0x008800C6648SRCINVERT = 0x00660046649SRCERASE = 0x00440328650NOTSRCCOPY = 0x00330008651NOTSRCERASE = 0x001100A6652MERGECOPY = 0x00C000CA653MERGEPAINT = 0x00BB0226654PATCOPY = 0x00F00021655PATPAINT = 0x00FB0A09656PATINVERT = 0x005A0049657DSTINVERT = 0x00550009658BLACKNESS = 0x00000042659WHITENESS = 0x00FF0062660NOMIRRORBITMAP = 0x80000000661CAPTUREBLT = 0x40000000662)
663
664// StretchBlt modes
665const (666BLACKONWHITE = 1667WHITEONBLACK = 2668COLORONCOLOR = 3669HALFTONE = 4670MAXSTRETCHBLTMODE = 4671STRETCH_ANDSCANS = BLACKONWHITE672STRETCH_ORSCANS = WHITEONBLACK673STRETCH_DELETESCANS = COLORONCOLOR674STRETCH_HALFTONE = HALFTONE675)
676
677// Bitmap compression constants
678const (679BI_RGB = 0680BI_RLE8 = 1681BI_RLE4 = 2682BI_BITFIELDS = 3683BI_JPEG = 4684BI_PNG = 5685)
686
687// Bitmap color table usage
688const (689DIB_RGB_COLORS = 0690DIB_PAL_COLORS = 1691)
692
693const CBM_INIT = 4694
695const (696CLR_INVALID = 0xFFFFFFFF697CLR_NONE = CLR_INVALID698CLR_DEFAULT = 0xFF000000699)
700
701const (702/* pixel types */703PFD_TYPE_RGBA = 0704PFD_TYPE_COLORINDEX = 1705
706/* layer types */707PFD_MAIN_PLANE = 0708PFD_OVERLAY_PLANE = 1709PFD_UNDERLAY_PLANE = (-1)710
711/* PIXELFORMATDESCRIPTOR flags */712PFD_DOUBLEBUFFER = 0x00000001713PFD_STEREO = 0x00000002714PFD_DRAW_TO_WINDOW = 0x00000004715PFD_DRAW_TO_BITMAP = 0x00000008716PFD_SUPPORT_GDI = 0x00000010717PFD_SUPPORT_OPENGL = 0x00000020718PFD_GENERIC_FORMAT = 0x00000040719PFD_NEED_PALETTE = 0x00000080720PFD_NEED_SYSTEM_PALETTE = 0x00000100721PFD_SWAP_EXCHANGE = 0x00000200722PFD_SWAP_COPY = 0x00000400723PFD_SWAP_LAYER_BUFFERS = 0x00000800724PFD_GENERIC_ACCELERATED = 0x00001000725PFD_SUPPORT_DIRECTDRAW = 0x00002000726
727/* PIXELFORMATDESCRIPTOR flags for use in ChoosePixelFormat only */728PFD_DEPTH_DONTCARE = 0x20000000729PFD_DOUBLEBUFFER_DONTCARE = 0x40000000730PFD_STEREO_DONTCARE = 0x80000000731)
732
733// GradientFill constants
734const (735GRADIENT_FILL_RECT_H = 0x00736GRADIENT_FILL_RECT_V = 0x01737GRADIENT_FILL_TRIANGLE = 0x02738)
739
740// Region Combine Modes
741const (742RGN_AND = 1743RGN_OR = 2744RGN_XOR = 3745RGN_DIFF = 4746RGN_COPY = 5747)
748
749// Region Types
750const (751REGIONERROR = 0752NULLREGION = 1753SIMPLEREGION = 2754COMPLEXREGION = 3755)
756
757// AlphaBlend operations
758const (759AC_SRC_ALPHA = 0x1760)
761
762// AddFontResourceEx flags
763const (764FR_PRIVATE = 0x10765FR_NOT_ENUM = 0x20766)
767
768func RGB(r, g, b byte) COLORREF {769return COLORREF(r) | (COLORREF(g) << 8) | (COLORREF(b) << 16)770}
771
772type (773COLORREF uint32774HBITMAP HGDIOBJ
775HBRUSH HGDIOBJ
776HDC HANDLE
777HFONT HGDIOBJ
778HGDIOBJ HANDLE
779HENHMETAFILE HANDLE
780HPALETTE HGDIOBJ
781HPEN HGDIOBJ
782HRGN HGDIOBJ
783CLIPFORMAT uint16784)
785
786type PIXELFORMATDESCRIPTOR struct {787NSize uint16788NVersion uint16789DwFlags uint32790IPixelType byte791CColorBits byte792CRedBits byte793CRedShift byte794CGreenBits byte795CGreenShift byte796CBlueBits byte797CBlueShift byte798CAlphaBits byte799CAlphaShift byte800CAccumBits byte801CAccumRedBits byte802CAccumGreenBits byte803CAccumBlueBits byte804CAccumAlphaBits byte805CDepthBits byte806CStencilBits byte807CAuxBuffers byte808ILayerType byte809BReserved byte810DwLayerMask uint32811DwVisibleMask uint32812DwDamageMask uint32813}
814
815type LOGFONT struct {816LfHeight int32817LfWidth int32818LfEscapement int32819LfOrientation int32820LfWeight int32821LfItalic byte822LfUnderline byte823LfStrikeOut byte824LfCharSet byte825LfOutPrecision byte826LfClipPrecision byte827LfQuality byte828LfPitchAndFamily byte829LfFaceName [LF_FACESIZE]uint16830}
831
832type TEXTMETRIC struct {833TmHeight int32834TmAscent int32835TmDescent int32836TmInternalLeading int32837TmExternalLeading int32838TmAveCharWidth int32839TmMaxCharWidth int32840TmWeight int32841TmOverhang int32842TmDigitizedAspectX int32843TmDigitizedAspectY int32844TmFirstChar uint16845TmLastChar uint16846TmDefaultChar uint16847TmBreakChar uint16848TmItalic byte849TmUnderlined byte850TmStruckOut byte851TmPitchAndFamily byte852TmCharSet byte853}
854
855type DEVMODE struct {856DmDeviceName [CCHDEVICENAME]uint16857DmSpecVersion uint16858DmDriverVersion uint16859DmSize uint16860DmDriverExtra uint16861DmFields uint32862DmOrientation int16863DmPaperSize int16864DmPaperLength int16865DmPaperWidth int16866DmScale int16867DmCopies int16868DmDefaultSource int16869DmPrintQuality int16870DmColor int16871DmDuplex int16872DmYResolution int16873DmTTOption int16874DmCollate int16875DmFormName [CCHFORMNAME]uint16876DmLogPixels uint16877DmBitsPerPel uint32878DmPelsWidth uint32879DmPelsHeight uint32880DmDisplayFlags uint32881DmDisplayFrequency uint32882DmICMMethod uint32883DmICMIntent uint32884DmMediaType uint32885DmDitherType uint32886DmReserved1 uint32887DmReserved2 uint32888DmPanningWidth uint32889DmPanningHeight uint32890}
891
892type POINT struct {893X, Y int32894}
895
896type RECT struct {897Left, Top, Right, Bottom int32898}
899
900type SIZE struct {901CX, CY int32902}
903
904type DOCINFO struct {905CbSize int32906LpszDocName *uint16907LpszOutput *uint16908LpszDatatype *uint16909FwType uint32910}
911
912type LOGBRUSH struct {913LbStyle uint32914LbColor COLORREF
915LbHatch uintptr916}
917
918type CIEXYZ struct {919CiexyzX, CiexyzY, CiexyzZ int32 // FXPT2DOT30920}
921
922type CIEXYZTRIPLE struct {923CiexyzRed, CiexyzGreen, CiexyzBlue CIEXYZ924}
925
926type BITMAPINFOHEADER struct {927BiSize uint32928BiWidth int32929BiHeight int32930BiPlanes uint16931BiBitCount uint16932BiCompression uint32933BiSizeImage uint32934BiXPelsPerMeter int32935BiYPelsPerMeter int32936BiClrUsed uint32937BiClrImportant uint32938}
939
940type BITMAPV4HEADER struct {941BITMAPINFOHEADER
942BV4RedMask uint32943BV4GreenMask uint32944BV4BlueMask uint32945BV4AlphaMask uint32946BV4CSType uint32947BV4Endpoints CIEXYZTRIPLE
948BV4GammaRed uint32949BV4GammaGreen uint32950BV4GammaBlue uint32951}
952
953type BITMAPV5HEADER struct {954BITMAPV4HEADER
955BV5Intent uint32956BV5ProfileData uint32957BV5ProfileSize uint32958BV5Reserved uint32959}
960
961type RGBQUAD struct {962RgbBlue byte963RgbGreen byte964RgbRed byte965RgbReserved byte966}
967
968type BITMAPINFO struct {969BmiHeader BITMAPINFOHEADER
970BmiColors *RGBQUAD971}
972
973type BITMAP struct {974BmType int32975BmWidth int32976BmHeight int32977BmWidthBytes int32978BmPlanes uint16979BmBitsPixel uint16980BmBits unsafe.Pointer981}
982
983type DIBSECTION struct {984DsBm BITMAP
985DsBmih BITMAPINFOHEADER
986DsBitfields [3]uint32987DshSection HANDLE
988DsOffset uint32989}
990
991type ENHMETAHEADER struct {992IType uint32993NSize uint32994RclBounds RECT
995RclFrame RECT
996DSignature uint32997NVersion uint32998NBytes uint32999NRecords uint321000NHandles uint161001SReserved uint161002NDescription uint321003OffDescription uint321004NPalEntries uint321005SzlDevice SIZE
1006SzlMillimeters SIZE
1007CbPixelFormat uint321008OffPixelFormat uint321009BOpenGL uint321010SzlMicrometers SIZE
1011}
1012
1013type TRIVERTEX struct {1014X int321015Y int321016Red uint161017Green uint161018Blue uint161019Alpha uint161020}
1021
1022type GRADIENT_RECT struct {1023UpperLeft uint321024LowerRight uint321025}
1026
1027type GRADIENT_TRIANGLE struct {1028Vertex1 uint321029Vertex2 uint321030Vertex3 uint321031}
1032
1033type BLENDFUNCTION struct {1034BlendOp byte1035BlendFlags byte1036SourceConstantAlpha byte1037AlphaFormat byte1038}
1039
1040var (1041// Library1042libgdi32 *windows.LazyDLL1043libmsimg32 *windows.LazyDLL1044
1045// Functions1046abortDoc *windows.LazyProc1047addFontResourceEx *windows.LazyProc1048addFontMemResourceEx *windows.LazyProc1049alphaBlend *windows.LazyProc1050bitBlt *windows.LazyProc1051choosePixelFormat *windows.LazyProc1052closeEnhMetaFile *windows.LazyProc1053combineRgn *windows.LazyProc1054copyEnhMetaFile *windows.LazyProc1055createBitmap *windows.LazyProc1056createCompatibleBitmap *windows.LazyProc1057createBrushIndirect *windows.LazyProc1058createCompatibleDC *windows.LazyProc1059createDC *windows.LazyProc1060createDIBSection *windows.LazyProc1061createFontIndirect *windows.LazyProc1062createEnhMetaFile *windows.LazyProc1063createIC *windows.LazyProc1064createPatternBrush *windows.LazyProc1065createRectRgn *windows.LazyProc1066deleteDC *windows.LazyProc1067deleteEnhMetaFile *windows.LazyProc1068deleteObject *windows.LazyProc1069ellipse *windows.LazyProc1070endDoc *windows.LazyProc1071endPage *windows.LazyProc1072excludeClipRect *windows.LazyProc1073extCreatePen *windows.LazyProc1074fillRgn *windows.LazyProc1075gdiFlush *windows.LazyProc1076getBkColor *windows.LazyProc1077getDeviceCaps *windows.LazyProc1078getDIBits *windows.LazyProc1079getEnhMetaFile *windows.LazyProc1080getEnhMetaFileHeader *windows.LazyProc1081getObject *windows.LazyProc1082getPixel *windows.LazyProc1083getRgnBox *windows.LazyProc1084getStockObject *windows.LazyProc1085getTextColor *windows.LazyProc1086getTextExtentExPoint *windows.LazyProc1087getTextExtentPoint32 *windows.LazyProc1088getTextMetrics *windows.LazyProc1089getViewportOrgEx *windows.LazyProc1090gradientFill *windows.LazyProc1091intersectClipRect *windows.LazyProc1092lineTo *windows.LazyProc1093moveToEx *windows.LazyProc1094playEnhMetaFile *windows.LazyProc1095polyline *windows.LazyProc1096rectangle *windows.LazyProc1097removeFontResourceEx *windows.LazyProc1098removeFontMemResourceEx *windows.LazyProc1099resetDC *windows.LazyProc1100restoreDC *windows.LazyProc1101roundRect *windows.LazyProc1102selectObject *windows.LazyProc1103setBkColor *windows.LazyProc1104setBkMode *windows.LazyProc1105setBrushOrgEx *windows.LazyProc1106setDIBits *windows.LazyProc1107setPixel *windows.LazyProc1108setPixelFormat *windows.LazyProc1109setStretchBltMode *windows.LazyProc1110setTextColor *windows.LazyProc1111setViewportOrgEx *windows.LazyProc1112saveDC *windows.LazyProc1113startDoc *windows.LazyProc1114startPage *windows.LazyProc1115stretchBlt *windows.LazyProc1116swapBuffers *windows.LazyProc1117textOut *windows.LazyProc1118transparentBlt *windows.LazyProc1119)
1120
1121func init() {1122// Library1123libgdi32 = windows.NewLazySystemDLL("gdi32.dll")1124libmsimg32 = windows.NewLazySystemDLL("msimg32.dll")1125
1126// Functions1127abortDoc = libgdi32.NewProc("AbortDoc")1128addFontResourceEx = libgdi32.NewProc("AddFontResourceExW")1129addFontMemResourceEx = libgdi32.NewProc("AddFontMemResourceEx")1130bitBlt = libgdi32.NewProc("BitBlt")1131choosePixelFormat = libgdi32.NewProc("ChoosePixelFormat")1132closeEnhMetaFile = libgdi32.NewProc("CloseEnhMetaFile")1133combineRgn = libgdi32.NewProc("CombineRgn")1134copyEnhMetaFile = libgdi32.NewProc("CopyEnhMetaFileW")1135createBitmap = libgdi32.NewProc("CreateBitmap")1136createCompatibleBitmap = libgdi32.NewProc("CreateCompatibleBitmap")1137createBrushIndirect = libgdi32.NewProc("CreateBrushIndirect")1138createCompatibleDC = libgdi32.NewProc("CreateCompatibleDC")1139createDC = libgdi32.NewProc("CreateDCW")1140createDIBSection = libgdi32.NewProc("CreateDIBSection")1141createEnhMetaFile = libgdi32.NewProc("CreateEnhMetaFileW")1142createFontIndirect = libgdi32.NewProc("CreateFontIndirectW")1143createIC = libgdi32.NewProc("CreateICW")1144createPatternBrush = libgdi32.NewProc("CreatePatternBrush")1145createRectRgn = libgdi32.NewProc("CreateRectRgn")1146deleteDC = libgdi32.NewProc("DeleteDC")1147deleteEnhMetaFile = libgdi32.NewProc("DeleteEnhMetaFile")1148deleteObject = libgdi32.NewProc("DeleteObject")1149ellipse = libgdi32.NewProc("Ellipse")1150endDoc = libgdi32.NewProc("EndDoc")1151endPage = libgdi32.NewProc("EndPage")1152excludeClipRect = libgdi32.NewProc("ExcludeClipRect")1153extCreatePen = libgdi32.NewProc("ExtCreatePen")1154fillRgn = libgdi32.NewProc("FillRgn")1155gdiFlush = libgdi32.NewProc("GdiFlush")1156getBkColor = libgdi32.NewProc("GetBkColor")1157getDeviceCaps = libgdi32.NewProc("GetDeviceCaps")1158getDIBits = libgdi32.NewProc("GetDIBits")1159getEnhMetaFile = libgdi32.NewProc("GetEnhMetaFileW")1160getEnhMetaFileHeader = libgdi32.NewProc("GetEnhMetaFileHeader")1161getObject = libgdi32.NewProc("GetObjectW")1162getPixel = libgdi32.NewProc("GetPixel")1163getRgnBox = libgdi32.NewProc("GetRgnBox")1164getStockObject = libgdi32.NewProc("GetStockObject")1165getTextColor = libgdi32.NewProc("GetTextColor")1166getTextExtentExPoint = libgdi32.NewProc("GetTextExtentExPointW")1167getTextExtentPoint32 = libgdi32.NewProc("GetTextExtentPoint32W")1168getTextMetrics = libgdi32.NewProc("GetTextMetricsW")1169getViewportOrgEx = libgdi32.NewProc("GetViewportOrgEx")1170intersectClipRect = libgdi32.NewProc("IntersectClipRect")1171lineTo = libgdi32.NewProc("LineTo")1172moveToEx = libgdi32.NewProc("MoveToEx")1173playEnhMetaFile = libgdi32.NewProc("PlayEnhMetaFile")1174polyline = libgdi32.NewProc("Polyline")1175rectangle = libgdi32.NewProc("Rectangle")1176removeFontResourceEx = libgdi32.NewProc("RemoveFontResourceExW")1177removeFontMemResourceEx = libgdi32.NewProc("RemoveFontMemResourceEx")1178resetDC = libgdi32.NewProc("ResetDCW")1179restoreDC = libgdi32.NewProc("RestoreDC")1180roundRect = libgdi32.NewProc("RoundRect")1181saveDC = libgdi32.NewProc("SaveDC")1182selectObject = libgdi32.NewProc("SelectObject")1183setBkColor = libgdi32.NewProc("SetBkColor")1184setBkMode = libgdi32.NewProc("SetBkMode")1185setBrushOrgEx = libgdi32.NewProc("SetBrushOrgEx")1186setDIBits = libgdi32.NewProc("SetDIBits")1187setPixel = libgdi32.NewProc("SetPixel")1188setPixelFormat = libgdi32.NewProc("SetPixelFormat")1189setStretchBltMode = libgdi32.NewProc("SetStretchBltMode")1190setTextColor = libgdi32.NewProc("SetTextColor")1191setViewportOrgEx = libgdi32.NewProc("SetViewportOrgEx")1192startDoc = libgdi32.NewProc("StartDocW")1193startPage = libgdi32.NewProc("StartPage")1194stretchBlt = libgdi32.NewProc("StretchBlt")1195swapBuffers = libgdi32.NewProc("SwapBuffers")1196textOut = libgdi32.NewProc("TextOutW")1197
1198alphaBlend = libmsimg32.NewProc("AlphaBlend")1199gradientFill = libmsimg32.NewProc("GradientFill")1200transparentBlt = libmsimg32.NewProc("TransparentBlt")1201}
1202
1203func AbortDoc(hdc HDC) int32 {1204ret, _, _ := syscall.Syscall(abortDoc.Addr(), 1,1205uintptr(hdc),12060,12070)1208
1209return int32(ret)1210}
1211
1212func AddFontResourceEx(lpszFilename *uint16, fl uint32, pdv unsafe.Pointer) int32 {1213ret, _, _ := syscall.Syscall(addFontResourceEx.Addr(), 3,1214uintptr(unsafe.Pointer(lpszFilename)),1215uintptr(fl),1216uintptr(pdv))1217
1218return int32(ret)1219}
1220
1221func AddFontMemResourceEx(pFileView uintptr, cjSize uint32, pvReserved unsafe.Pointer, pNumFonts *uint32) HANDLE {1222ret, _, _ := syscall.Syscall6(addFontMemResourceEx.Addr(), 4,1223pFileView,1224uintptr(cjSize),1225uintptr(pvReserved),1226uintptr(unsafe.Pointer(pNumFonts)),12270,12280)1229
1230return HANDLE(ret)1231}
1232
1233func AlphaBlend(hdcDest HDC, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest int32, hdcSrc HDC, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc int32, ftn BLENDFUNCTION) bool {1234ret, _, _ := syscall.Syscall12(alphaBlend.Addr(), 11,1235uintptr(hdcDest),1236uintptr(nXOriginDest),1237uintptr(nYOriginDest),1238uintptr(nWidthDest),1239uintptr(nHeightDest),1240uintptr(hdcSrc),1241uintptr(nXOriginSrc),1242uintptr(nYOriginSrc),1243uintptr(nWidthSrc),1244uintptr(nHeightSrc),1245uintptr(*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&ftn))))),12460)1247
1248return ret != 01249}
1250
1251func BitBlt(hdcDest HDC, nXDest, nYDest, nWidth, nHeight int32, hdcSrc HDC, nXSrc, nYSrc int32, dwRop uint32) bool {1252ret, _, _ := syscall.Syscall9(bitBlt.Addr(), 9,1253uintptr(hdcDest),1254uintptr(nXDest),1255uintptr(nYDest),1256uintptr(nWidth),1257uintptr(nHeight),1258uintptr(hdcSrc),1259uintptr(nXSrc),1260uintptr(nYSrc),1261uintptr(dwRop))1262
1263return ret != 01264}
1265
1266func ChoosePixelFormat(hdc HDC, ppfd *PIXELFORMATDESCRIPTOR) int32 {1267ret, _, _ := syscall.Syscall(choosePixelFormat.Addr(), 2,1268uintptr(hdc),1269uintptr(unsafe.Pointer(ppfd)),12700)1271
1272return int32(ret)1273}
1274
1275func CloseEnhMetaFile(hdc HDC) HENHMETAFILE {1276ret, _, _ := syscall.Syscall(closeEnhMetaFile.Addr(), 1,1277uintptr(hdc),12780,12790)1280
1281return HENHMETAFILE(ret)1282}
1283
1284func CombineRgn(hrgnDest, hrgnSrc1, hrgnSrc2 HRGN, fnCombineMode int32) int32 {1285ret, _, _ := syscall.Syscall6(combineRgn.Addr(), 4,1286uintptr(hrgnDest),1287uintptr(hrgnSrc1),1288uintptr(hrgnSrc2),1289uintptr(fnCombineMode),12900,12910)1292
1293return int32(ret)1294}
1295
1296func CopyEnhMetaFile(hemfSrc HENHMETAFILE, lpszFile *uint16) HENHMETAFILE {1297ret, _, _ := syscall.Syscall(copyEnhMetaFile.Addr(), 2,1298uintptr(hemfSrc),1299uintptr(unsafe.Pointer(lpszFile)),13000)1301
1302return HENHMETAFILE(ret)1303}
1304
1305func CreateBitmap(nWidth, nHeight int32, cPlanes, cBitsPerPel uint32, lpvBits unsafe.Pointer) HBITMAP {1306ret, _, _ := syscall.Syscall6(createBitmap.Addr(), 5,1307uintptr(nWidth),1308uintptr(nHeight),1309uintptr(cPlanes),1310uintptr(cBitsPerPel),1311uintptr(lpvBits),13120)1313
1314return HBITMAP(ret)1315}
1316
1317func CreateCompatibleBitmap(hdc HDC, nWidth, nHeight int32) HBITMAP {1318ret, _, _ := syscall.Syscall(createCompatibleBitmap.Addr(), 3,1319uintptr(hdc),1320uintptr(nWidth),1321uintptr(nHeight))1322
1323return HBITMAP(ret)1324}
1325
1326func CreateBrushIndirect(lplb *LOGBRUSH) HBRUSH {1327ret, _, _ := syscall.Syscall(createBrushIndirect.Addr(), 1,1328uintptr(unsafe.Pointer(lplb)),13290,13300)1331
1332return HBRUSH(ret)1333}
1334
1335func CreateCompatibleDC(hdc HDC) HDC {1336ret, _, _ := syscall.Syscall(createCompatibleDC.Addr(), 1,1337uintptr(hdc),13380,13390)1340
1341return HDC(ret)1342}
1343
1344func CreateDC(lpszDriver, lpszDevice, lpszOutput *uint16, lpInitData *DEVMODE) HDC {1345ret, _, _ := syscall.Syscall6(createDC.Addr(), 4,1346uintptr(unsafe.Pointer(lpszDriver)),1347uintptr(unsafe.Pointer(lpszDevice)),1348uintptr(unsafe.Pointer(lpszOutput)),1349uintptr(unsafe.Pointer(lpInitData)),13500,13510)1352
1353return HDC(ret)1354}
1355
1356func CreateDIBSection(hdc HDC, pbmih *BITMAPINFOHEADER, iUsage uint32, ppvBits *unsafe.Pointer, hSection HANDLE, dwOffset uint32) HBITMAP {1357ret, _, _ := syscall.Syscall6(createDIBSection.Addr(), 6,1358uintptr(hdc),1359uintptr(unsafe.Pointer(pbmih)),1360uintptr(iUsage),1361uintptr(unsafe.Pointer(ppvBits)),1362uintptr(hSection),1363uintptr(dwOffset))1364
1365return HBITMAP(ret)1366}
1367
1368func CreateEnhMetaFile(hdcRef HDC, lpFilename *uint16, lpRect *RECT, lpDescription *uint16) HDC {1369ret, _, _ := syscall.Syscall6(createEnhMetaFile.Addr(), 4,1370uintptr(hdcRef),1371uintptr(unsafe.Pointer(lpFilename)),1372uintptr(unsafe.Pointer(lpRect)),1373uintptr(unsafe.Pointer(lpDescription)),13740,13750)1376
1377return HDC(ret)1378}
1379
1380func CreateFontIndirect(lplf *LOGFONT) HFONT {1381ret, _, _ := syscall.Syscall(createFontIndirect.Addr(), 1,1382uintptr(unsafe.Pointer(lplf)),13830,13840)1385
1386return HFONT(ret)1387}
1388
1389func CreateIC(lpszDriver, lpszDevice, lpszOutput *uint16, lpdvmInit *DEVMODE) HDC {1390ret, _, _ := syscall.Syscall6(createIC.Addr(), 4,1391uintptr(unsafe.Pointer(lpszDriver)),1392uintptr(unsafe.Pointer(lpszDevice)),1393uintptr(unsafe.Pointer(lpszOutput)),1394uintptr(unsafe.Pointer(lpdvmInit)),13950,13960)1397
1398return HDC(ret)1399}
1400
1401func CreatePatternBrush(hbmp HBITMAP) HBRUSH {1402ret, _, _ := syscall.Syscall(createPatternBrush.Addr(), 1,1403uintptr(hbmp),14040,14050)1406
1407return HBRUSH(ret)1408}
1409
1410func CreateRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect int32) HRGN {1411ret, _, _ := syscall.Syscall6(createRectRgn.Addr(), 4,1412uintptr(nLeftRect),1413uintptr(nTopRect),1414uintptr(nRightRect),1415uintptr(nBottomRect),14160,14170)1418
1419return HRGN(ret)1420}
1421
1422func DeleteDC(hdc HDC) bool {1423ret, _, _ := syscall.Syscall(deleteDC.Addr(), 1,1424uintptr(hdc),14250,14260)1427
1428return ret != 01429}
1430
1431func DeleteEnhMetaFile(hemf HENHMETAFILE) bool {1432ret, _, _ := syscall.Syscall(deleteEnhMetaFile.Addr(), 1,1433uintptr(hemf),14340,14350)1436
1437return ret != 01438}
1439
1440func DeleteObject(hObject HGDIOBJ) bool {1441ret, _, _ := syscall.Syscall(deleteObject.Addr(), 1,1442uintptr(hObject),14430,14440)1445
1446return ret != 01447}
1448
1449func Ellipse(hdc HDC, nLeftRect, nTopRect, nRightRect, nBottomRect int32) bool {1450ret, _, _ := syscall.Syscall6(ellipse.Addr(), 5,1451uintptr(hdc),1452uintptr(nLeftRect),1453uintptr(nTopRect),1454uintptr(nRightRect),1455uintptr(nBottomRect),14560)1457
1458return ret != 01459}
1460
1461func EndDoc(hdc HDC) int32 {1462ret, _, _ := syscall.Syscall(endDoc.Addr(), 1,1463uintptr(hdc),14640,14650)1466
1467return int32(ret)1468}
1469
1470func EndPage(hdc HDC) int32 {1471ret, _, _ := syscall.Syscall(endPage.Addr(), 1,1472uintptr(hdc),14730,14740)1475
1476return int32(ret)1477}
1478
1479func ExcludeClipRect(hdc HDC, nLeftRect, nTopRect, nRightRect, nBottomRect int32) int32 {1480ret, _, _ := syscall.Syscall6(excludeClipRect.Addr(), 5,1481uintptr(hdc),1482uintptr(nLeftRect),1483uintptr(nTopRect),1484uintptr(nRightRect),1485uintptr(nBottomRect),14860)1487
1488return int32(ret)1489}
1490
1491func ExtCreatePen(dwPenStyle, dwWidth uint32, lplb *LOGBRUSH, dwStyleCount uint32, lpStyle *uint32) HPEN {1492ret, _, _ := syscall.Syscall6(extCreatePen.Addr(), 5,1493uintptr(dwPenStyle),1494uintptr(dwWidth),1495uintptr(unsafe.Pointer(lplb)),1496uintptr(dwStyleCount),1497uintptr(unsafe.Pointer(lpStyle)),14980)1499
1500return HPEN(ret)1501}
1502
1503func FillRgn(hdc HDC, hrgn HRGN, hbr HBRUSH) bool {1504ret, _, _ := syscall.Syscall(fillRgn.Addr(), 3,1505uintptr(hdc),1506uintptr(hrgn),1507uintptr(hbr))1508
1509return ret != 01510}
1511
1512func GdiFlush() bool {1513ret, _, _ := syscall.Syscall(gdiFlush.Addr(), 0,15140,15150,15160)1517
1518return ret != 01519}
1520
1521func GetBkColor(hdc HDC) COLORREF {1522ret, _, _ := syscall.Syscall(getBkColor.Addr(), 1,1523uintptr(hdc),15240,15250)1526
1527return COLORREF(ret)1528}
1529
1530func GetDeviceCaps(hdc HDC, nIndex int32) int32 {1531ret, _, _ := syscall.Syscall(getDeviceCaps.Addr(), 2,1532uintptr(hdc),1533uintptr(nIndex),15340)1535
1536return int32(ret)1537}
1538
1539func GetDIBits(hdc HDC, hbmp HBITMAP, uStartScan uint32, cScanLines uint32, lpvBits *byte, lpbi *BITMAPINFO, uUsage uint32) int32 {1540ret, _, _ := syscall.Syscall9(getDIBits.Addr(), 7,1541uintptr(hdc),1542uintptr(hbmp),1543uintptr(uStartScan),1544uintptr(cScanLines),1545uintptr(unsafe.Pointer(lpvBits)),1546uintptr(unsafe.Pointer(lpbi)),1547uintptr(uUsage),15480,15490)1550return int32(ret)1551}
1552
1553func GetEnhMetaFile(lpszMetaFile *uint16) HENHMETAFILE {1554ret, _, _ := syscall.Syscall(getEnhMetaFile.Addr(), 1,1555uintptr(unsafe.Pointer(lpszMetaFile)),15560,15570)1558
1559return HENHMETAFILE(ret)1560}
1561
1562func GetEnhMetaFileHeader(hemf HENHMETAFILE, cbBuffer uint32, lpemh *ENHMETAHEADER) uint32 {1563ret, _, _ := syscall.Syscall(getEnhMetaFileHeader.Addr(), 3,1564uintptr(hemf),1565uintptr(cbBuffer),1566uintptr(unsafe.Pointer(lpemh)))1567
1568return uint32(ret)1569}
1570
1571func GetObject(hgdiobj HGDIOBJ, cbBuffer uintptr, lpvObject unsafe.Pointer) int32 {1572ret, _, _ := syscall.Syscall(getObject.Addr(), 3,1573uintptr(hgdiobj),1574uintptr(cbBuffer),1575uintptr(lpvObject))1576
1577return int32(ret)1578}
1579
1580func GetPixel(hdc HDC, nXPos, nYPos int32) COLORREF {1581ret, _, _ := syscall.Syscall(getPixel.Addr(), 3,1582uintptr(hdc),1583uintptr(nXPos),1584uintptr(nYPos))1585
1586return COLORREF(ret)1587}
1588
1589func GetRgnBox(hrgn HRGN, lprc *RECT) int32 {1590ret, _, _ := syscall.Syscall(getRgnBox.Addr(), 2,1591uintptr(hrgn),1592uintptr(unsafe.Pointer(lprc)),15930)1594
1595return int32(ret)1596}
1597
1598func GetStockObject(fnObject int32) HGDIOBJ {1599ret, _, _ := syscall.Syscall(getStockObject.Addr(), 1,1600uintptr(fnObject),16010,16020)1603
1604return HGDIOBJ(ret)1605}
1606
1607func GetTextColor(hdc HDC) COLORREF {1608ret, _, _ := syscall.Syscall(getTextColor.Addr(), 1,1609uintptr(hdc),16100,16110)1612
1613return COLORREF(ret)1614}
1615
1616func GetTextExtentExPoint(hdc HDC, lpszStr *uint16, cchString, nMaxExtent int32, lpnFit, alpDx *int32, lpSize *SIZE) bool {1617ret, _, _ := syscall.Syscall9(getTextExtentExPoint.Addr(), 7,1618uintptr(hdc),1619uintptr(unsafe.Pointer(lpszStr)),1620uintptr(cchString),1621uintptr(nMaxExtent),1622uintptr(unsafe.Pointer(lpnFit)),1623uintptr(unsafe.Pointer(alpDx)),1624uintptr(unsafe.Pointer(lpSize)),16250,16260)1627
1628return ret != 01629}
1630
1631func GetTextExtentPoint32(hdc HDC, lpString *uint16, c int32, lpSize *SIZE) bool {1632ret, _, _ := syscall.Syscall6(getTextExtentPoint32.Addr(), 4,1633uintptr(hdc),1634uintptr(unsafe.Pointer(lpString)),1635uintptr(c),1636uintptr(unsafe.Pointer(lpSize)),16370,16380)1639
1640return ret != 01641}
1642
1643func GetTextMetrics(hdc HDC, lptm *TEXTMETRIC) bool {1644ret, _, _ := syscall.Syscall(getTextMetrics.Addr(), 2,1645uintptr(hdc),1646uintptr(unsafe.Pointer(lptm)),16470)1648
1649return ret != 01650}
1651
1652func GetViewportOrgEx(hdc HDC, lpPoint *POINT) bool {1653ret, _, _ := syscall.Syscall(getViewportOrgEx.Addr(), 2,1654uintptr(hdc),1655uintptr(unsafe.Pointer(lpPoint)),16560)1657
1658return ret != 01659}
1660
1661func GradientFill(hdc HDC, pVertex *TRIVERTEX, nVertex uint32, pMesh unsafe.Pointer, nMesh, ulMode uint32) bool {1662ret, _, _ := syscall.Syscall6(gradientFill.Addr(), 6,1663uintptr(hdc),1664uintptr(unsafe.Pointer(pVertex)),1665uintptr(nVertex),1666uintptr(pMesh),1667uintptr(nMesh),1668uintptr(ulMode))1669
1670return ret != 01671}
1672
1673func IntersectClipRect(hdc HDC, nLeftRect, nTopRect, nRightRect, nBottomRect int32) int32 {1674ret, _, _ := syscall.Syscall6(intersectClipRect.Addr(), 5,1675uintptr(hdc),1676uintptr(nLeftRect),1677uintptr(nTopRect),1678uintptr(nRightRect),1679uintptr(nBottomRect),16800)1681
1682return int32(ret)1683}
1684
1685func LineTo(hdc HDC, nXEnd, nYEnd int32) bool {1686ret, _, _ := syscall.Syscall(lineTo.Addr(), 3,1687uintptr(hdc),1688uintptr(nXEnd),1689uintptr(nYEnd))1690
1691return ret != 01692}
1693
1694func MoveToEx(hdc HDC, x, y int, lpPoint *POINT) bool {1695ret, _, _ := syscall.Syscall6(moveToEx.Addr(), 4,1696uintptr(hdc),1697uintptr(x),1698uintptr(y),1699uintptr(unsafe.Pointer(lpPoint)),17000,17010)1702
1703return ret != 01704}
1705
1706func PlayEnhMetaFile(hdc HDC, hemf HENHMETAFILE, lpRect *RECT) bool {1707ret, _, _ := syscall.Syscall(playEnhMetaFile.Addr(), 3,1708uintptr(hdc),1709uintptr(hemf),1710uintptr(unsafe.Pointer(lpRect)))1711
1712return ret != 01713}
1714
1715func Polyline(hdc HDC, lppt unsafe.Pointer, cPoints int32) bool {1716ret, _, _ := syscall.Syscall(polyline.Addr(), 3,1717uintptr(hdc),1718uintptr(lppt),1719uintptr(cPoints))1720
1721return ret != 01722}
1723
1724func Rectangle_(hdc HDC, nLeftRect, nTopRect, nRightRect, nBottomRect int32) bool {1725ret, _, _ := syscall.Syscall6(rectangle.Addr(), 5,1726uintptr(hdc),1727uintptr(nLeftRect),1728uintptr(nTopRect),1729uintptr(nRightRect),1730uintptr(nBottomRect),17310)1732
1733return ret != 01734}
1735
1736func RemoveFontResourceEx(lpszFilename *uint16, fl uint32, pdv unsafe.Pointer) bool {1737ret, _, _ := syscall.Syscall(removeFontResourceEx.Addr(), 3,1738uintptr(unsafe.Pointer(lpszFilename)),1739uintptr(fl),1740uintptr(pdv))1741
1742return ret != 01743}
1744
1745func RemoveFontMemResourceEx(h HANDLE) bool {1746ret, _, _ := syscall.Syscall(removeFontMemResourceEx.Addr(), 1,1747uintptr(h),17480,17490)1750
1751return ret != 01752}
1753
1754func ResetDC(hdc HDC, lpInitData *DEVMODE) HDC {1755ret, _, _ := syscall.Syscall(resetDC.Addr(), 2,1756uintptr(hdc),1757uintptr(unsafe.Pointer(lpInitData)),17580)1759
1760return HDC(ret)1761}
1762
1763func RestoreDC(hdc HDC, nSaveDC int32) bool {1764ret, _, _ := syscall.Syscall(restoreDC.Addr(), 2,1765uintptr(hdc),1766uintptr(nSaveDC),17670)1768return ret != 01769}
1770
1771func RoundRect(hdc HDC, nLeftRect, nTopRect, nRightRect, nBottomRect, nWidth, nHeight int32) bool {1772ret, _, _ := syscall.Syscall9(roundRect.Addr(), 7,1773uintptr(hdc),1774uintptr(nLeftRect),1775uintptr(nTopRect),1776uintptr(nRightRect),1777uintptr(nBottomRect),1778uintptr(nWidth),1779uintptr(nHeight),17800,17810)1782
1783return ret != 01784}
1785
1786func SaveDC(hdc HDC) int32 {1787ret, _, _ := syscall.Syscall(saveDC.Addr(), 1,1788uintptr(hdc),17890,17900)1791return int32(ret)1792}
1793
1794func SelectObject(hdc HDC, hgdiobj HGDIOBJ) HGDIOBJ {1795ret, _, _ := syscall.Syscall(selectObject.Addr(), 2,1796uintptr(hdc),1797uintptr(hgdiobj),17980)1799
1800return HGDIOBJ(ret)1801}
1802
1803func SetBkColor(hdc HDC, crColor COLORREF) COLORREF {1804ret, _, _ := syscall.Syscall(setBkColor.Addr(), 2,1805uintptr(hdc),1806uintptr(crColor),18070)1808
1809return COLORREF(ret)1810}
1811
1812func SetBkMode(hdc HDC, iBkMode int32) int32 {1813ret, _, _ := syscall.Syscall(setBkMode.Addr(), 2,1814uintptr(hdc),1815uintptr(iBkMode),18160)1817
1818return int32(ret)1819}
1820
1821func SetBrushOrgEx(hdc HDC, nXOrg, nYOrg int32, lppt *POINT) bool {1822ret, _, _ := syscall.Syscall6(setBrushOrgEx.Addr(), 4,1823uintptr(hdc),1824uintptr(nXOrg),1825uintptr(nYOrg),1826uintptr(unsafe.Pointer(lppt)),18270,18280)1829
1830return ret != 01831}
1832
1833func SetDIBits(hdc HDC, hbmp HBITMAP, uStartScan, cScanLines uint32, lpvBits *byte, lpbmi *BITMAPINFO, fuColorUse uint32) int32 {1834ret, _, _ := syscall.Syscall9(setDIBits.Addr(), 7,1835uintptr(hdc),1836uintptr(hbmp),1837uintptr(uStartScan),1838uintptr(cScanLines),1839uintptr(unsafe.Pointer(lpvBits)),1840uintptr(unsafe.Pointer(lpbmi)),1841uintptr(fuColorUse),18420,18430)1844
1845return int32(ret)1846}
1847
1848func SetPixel(hdc HDC, X, Y int32, crColor COLORREF) COLORREF {1849ret, _, _ := syscall.Syscall6(setPixel.Addr(), 4,1850uintptr(hdc),1851uintptr(X),1852uintptr(Y),1853uintptr(crColor),18540,18550)1856
1857return COLORREF(ret)1858}
1859
1860func SetPixelFormat(hdc HDC, iPixelFormat int32, ppfd *PIXELFORMATDESCRIPTOR) bool {1861ret, _, _ := syscall.Syscall(setPixelFormat.Addr(), 3,1862uintptr(hdc),1863uintptr(iPixelFormat),1864uintptr(unsafe.Pointer(ppfd)))1865
1866return ret != 01867}
1868
1869func SetStretchBltMode(hdc HDC, iStretchMode int32) int32 {1870ret, _, _ := syscall.Syscall(setStretchBltMode.Addr(), 2,1871uintptr(hdc),1872uintptr(iStretchMode),18730)1874
1875return int32(ret)1876}
1877
1878func SetTextColor(hdc HDC, crColor COLORREF) COLORREF {1879ret, _, _ := syscall.Syscall(setTextColor.Addr(), 2,1880uintptr(hdc),1881uintptr(crColor),18820)1883
1884return COLORREF(ret)1885}
1886
1887func SetViewportOrgEx(hdc HDC, x, y int32, lpPoint *POINT) COLORREF {1888ret, _, _ := syscall.Syscall6(setViewportOrgEx.Addr(), 4,1889uintptr(hdc),1890uintptr(x),1891uintptr(y),1892uintptr(unsafe.Pointer(lpPoint)),18930,18940)1895
1896return COLORREF(ret)1897}
1898
1899func StartDoc(hdc HDC, lpdi *DOCINFO) int32 {1900ret, _, _ := syscall.Syscall(startDoc.Addr(), 2,1901uintptr(hdc),1902uintptr(unsafe.Pointer(lpdi)),19030)1904
1905return int32(ret)1906}
1907
1908func StartPage(hdc HDC) int32 {1909ret, _, _ := syscall.Syscall(startPage.Addr(), 1,1910uintptr(hdc),19110,19120)1913
1914return int32(ret)1915}
1916
1917func StretchBlt(hdcDest HDC, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest int32, hdcSrc HDC, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc int32, dwRop uint32) bool {1918ret, _, _ := syscall.Syscall12(stretchBlt.Addr(), 11,1919uintptr(hdcDest),1920uintptr(nXOriginDest),1921uintptr(nYOriginDest),1922uintptr(nWidthDest),1923uintptr(nHeightDest),1924uintptr(hdcSrc),1925uintptr(nXOriginSrc),1926uintptr(nYOriginSrc),1927uintptr(nWidthSrc),1928uintptr(nHeightSrc),1929uintptr(dwRop),19300)1931
1932return ret != 01933}
1934
1935func SwapBuffers(hdc HDC) bool {1936ret, _, _ := syscall.Syscall(swapBuffers.Addr(), 1,1937uintptr(hdc),19380,19390)1940
1941return ret != 01942}
1943
1944func TextOut(hdc HDC, nXStart, nYStart int32, lpString *uint16, cchString int32) bool {1945ret, _, _ := syscall.Syscall6(textOut.Addr(), 5,1946uintptr(hdc),1947uintptr(nXStart),1948uintptr(nYStart),1949uintptr(unsafe.Pointer(lpString)),1950uintptr(cchString),19510)1952return ret != 01953}
1954
1955func TransparentBlt(hdcDest HDC, xoriginDest, yoriginDest, wDest, hDest int32, hdcSrc HDC, xoriginSrc, yoriginSrc, wSrc, hSrc int32, crTransparent uint32) bool {1956ret, _, _ := syscall.Syscall12(transparentBlt.Addr(), 11,1957uintptr(hdcDest),1958uintptr(xoriginDest),1959uintptr(yoriginDest),1960uintptr(wDest),1961uintptr(hDest),1962uintptr(hdcSrc),1963uintptr(xoriginSrc),1964uintptr(yoriginSrc),1965uintptr(wSrc),1966uintptr(hSrc),1967uintptr(crTransparent),19680)1969
1970return ret != 01971}
1972