PB打印实现增强功能.docx
《PB打印实现增强功能.docx》由会员分享,可在线阅读,更多相关《PB打印实现增强功能.docx(35页珍藏版)》请在冰豆网上搜索。
![PB打印实现增强功能.docx](https://file1.bdocx.com/fileroot1/2023-1/4/3a8fae70-fa0c-4368-a7bb-44386660ec70/3a8fae70-fa0c-4368-a7bb-44386660ec701.gif)
PB打印实现增强功能
PB打印实现增强功能
globaltypen_printerfromnonvisualobject
endtype
endforward
typestr_printer_info_1fromstructure
longflags
longDescription
longname
longcomment
endtype
typestr_printer_info_2fromstructure
longservername
longprintername
longsharename
longportname
longdrivername
longcomment
longlocation
longdevmode
longsepfile
longprintprocessor
longdatatype
longparameters
longsecuritydescriptor
longattributes
longpriority
longdefaultpriority
longstarttime
longuntiltime
longstatus
longcjobs
longaverageppm
characterreserve[500]
endtype
typestr_devmodefromstructure
characterdmdevicename[32]
unsignedintegerdmspecversion
unsignedintegerdmdriverversion
unsignedintegerdmsize
unsignedintegerdmdriverextra
unsignedlongdmfields
unsignedintegerdmorientation
unsignedintegerdmpapersize
unsignedintegerdmpaperlength
unsignedintegerdmpaperwidth
integerdmscale
integerdmcopies
integerdmdefaultsource
integerdmprintquality
integerdmcolor
integerdmduplex
integerdmyresolution
integerdmttoption
integerdmcollate
characterdmformname[32]
unsignedintegerdmlogpixels
unsignedlongdmbitsperpel
unsignedlongdmpelswidth
unsignedlongdmpelsheight
unsignedlongdmdisplayflags
unsignedlongdmdisplayfrequency
unsignedlongdmicmmethod
unsignedlongdmicmintent
unsignedlongdmmediatype
unsignedlongdmdithertype
unsignedlongdmreserved1
unsignedlongdmreserved2
unsignedlongdmreserved3
endtype
typestr_printer_defaultsfromstructure
longDatatype
longDevMode
longDesiredAccess
endtype
typestr_printdlgfromstructure
unsignedlonglstructsize
unsignedlonghwndowner
unsignedlonghdevmode
unsignedlonghdevnames
unsignedlonghdc
unsignedlongflags
unsignedintegernfrompage
unsignedintegerntopage
unsignedintegernminpage
unsignedintegernmaxpage
unsignedintegerncopies
unsignedlonghinstance
unsignedlonglcustdata
unsignedlonglpfnprinthook
unsignedlonglpfnsetuphook
unsignedlonglpprinttemplatename
unsignedlonglpsetuptemplatename
unsignedlonghprinttemplate
unsignedlonghsetuptemplate
uintreserve1
endtype
typestr_devnamesfromstructure
UINTwDriverOffset
UINTwDeviceOffset
UINTwOutputOffset
UINTwDefault
characterdrivername[32]
characterdevicename[32]
characterportname[32]
endtype
typestr_pointfromstructure
longx
longy
endtype
typestr_rectfromstructure
longleft
longtop
longright
longbottom
endtype
typestr_PAGESETUPDLGfromstructure
ulonglStructSize
ulonghwndOwner
ulonghDevMode
ulonghDevNames
ulongFlags
str_pointptPaperSize
str_rectrtMinMargin
str_rectrtMargin
ulonghInstance
ulonglCustData
ulonglpfnPageSetupHook
ulonglpfnPagePaintHook
ulonglpPageSetupTemplateName
ulonghPageSetupTemplate
endtype
globaltypen_printerfromnonvisualobjectautoinstantiate
endtype
typeprototypes
functionbooleanEnumPrinters(ulongflags,stringname,ulonglevel,refblobbuffer,ulongcbbuf,refulongcbneeded,refulongreturned)library"winspool.drv"aliasfor"EnumPrintersA"
functionulongCopyMem(refstr_printer_info_1dest,refblobsource,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionulongCopyMem(refstr_printer_info_2dest,refblobsource,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionulongCopyMem(refblobsource,refstr_printer_info_2dest,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionbooleanOpenPrinter(stringPrinterName,refulonghPrinter,ulongnull)library"winspool.drv"aliasfor"OpenPrinterA"
functionbooleanOpenPrinter(stringPrinterName,refulonghPrinter,refstr_printer_defaultsnull)library"winspool.drv"aliasfor"OpenPrinterA"
functionbooleanClosePrinter(ulonghPrinter)library"winspool.drv"
functionbooleanGetPrinter(ulonghPrinter,ulonglevel,refblobPrinter,ulongcbbuf,refulongcbNeeded)library"winspool.drv"aliasfor"GetPrinterA"
functionbooleanSetPrinter(ulonghPrinter,ulonglevel,refblobPrinter,ulongcommand)library"winspool.drv"aliasfor"SetPrinterA"
functionbooleanPrinterProperties(ulonghwnd,ulonghprinter)library"winspool.drv"
functionulongCopyMem(refstr_devmodedest,refblobsrc,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionulongCopyMem(refstr_devmodedest,ulongsrc,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionulongCopyMem(refblobsrc,refstr_devmodedest,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionulongCopyMem(ulongsrc,refstr_devmodedest,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionlongDocumentProperties(ulonghwnd,ulonghprinter,stringnull,refblobDevModeOutput,longnull_1,ulongfMode)library"winspool.drv"aliasfor"DocumentPropertiesA"
functionlongDocumentProperties(ulonghwnd,ulonghprinter,stringnull,ulongnull_1,refstr_devmodepDevModeInput,ulongfMode)library"winspool.drv"aliasfor"DocumentPropertiesA"
functionlongDocumentProperties(ulonghwnd,ulonghprinter,stringnull,ulongnull_1,refblobpDevModeInput,ulongfMode)library"winspool.drv"aliasfor"DocumentPropertiesA"
functionlongDeviceCapabilities(stringDevice,stringPort,uintfwCapability,refblobpOutput,longdevmode)library"winspool.drv"aliasfor"DeviceCapabilitiesA"
functionlongDeviceCapabilities(stringDevice,stringPort,uintfwCapability,longnull,longdevmode)library"winspool.drv"aliasfor"DeviceCapabilitiesA"
functionulongCreateDC(longdriver,stringdevice,longoutput,longdevmode)library"gdi32"aliasfor"CreateDCA"
functionbooleanDeleteDC(ulonghdc)library"gdi32"
functionintEscape(ulonghdc,intnEscape,intcbInput,longinData,refbloboutdata)library"gdi32"
functionulongGlobalAlloc(uintuFlags,ulongdwBytes)library"kernel32"
functionulongGlobalFree(ulonghmem)library"kernel32"
functionulongGlobalLock(ulonghmem)library"kernel32"
functionbooleanGlobalUnlock(ulonghmem)library"kernel32"
functionulongGlobalSize(ulonghem)library"kernel32"
functionlongPrintDlg(refstr_printdlgprintdlg)library"comdlg32"aliasfor"PrintDlgA"
functionulongCopyMem(refstr_devnamesdest,ulongsrc,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionulongCopyMem(refblobdest,ulongsrc,ulonglength)library"kernel32"aliasfor"RtlMoveMemory"
functionbooleanPageSetupDlg(refstr_pagesetupdlgll)library"comdlg32"aliasfor"PageSetupDlgA"
endprototypes
typevariables
constantulongPRINTER_ENUM_DEFAULT=1
constantulongPRINTER_ENUM_LOCAL=2
constantulongPRINTER_ENUM_CONNECTIONS=4
constantulongPRINTER_ENUM_FAVORITE=4
constantulongPRINTER_ENUM_NAME=8
constantulongPRINTER_ENUM_REMOTE=16
constantulongPRINTER_ENUM_SHARED=32
constantulongPRINTER_ENUM_NETWORK=64
constantulongPRINTER_ENUM_EXPAND=16384
constantulongPRINTER_ENUM_CONTAINER=32768
constantulongPRINTER_ENUM_ICONMASK=16711680
constantulongPRINTER_ENUM_ICON1=65536
constantulongPRINTER_ENUM_ICON2=131072
constantulongPRINTER_ENUM_ICON3=262144
constantulongPRINTER_ENUM_ICON4=545288
constantulongPRINTER_ENUM_ICON5=1048576
constantulongPRINTER_ENUM_ICON6=2097152
constantulongPRINTER_ENUM_ICON7=4194304
constantulongPRINTER_ENUM_ICON8=8388608
constantintegerPRINTER_INFO_1_LEN=16
constantintegerPRINTER_INFO_2_LEN=84
constantintegerDEVMODE_LEN=148
constantulongDM_ORIENTATION=00000001
constantulongDM_PAPERSIZE=00000002
constantulongDM_PAPERLENGTH=00000004
constantulongDM_PAPERWIDTH=00000008
constantulongDM_SCALE=00000016
constantulongDM_COPIES=00000256
constantulongDM_DEFAULTSOURCE=00000512
constantulongDM_PRINTQUALITY=000001024
constantulongDM_COLOR=000002048
constantulongDM_DUPLEX=00004096
constantulongDM_YRESOLUTION=00008192
constantulongDM_TTOPTION=000016384
constantulongDM_COLLATE=32768
constantulongDM_FORMNAME=65536
constantulongDM_LOGPIXELS=131072
constantulongDM_BITSPERPEL=262144
constantulongDM_PELSWIDTH=524288
constantulongDM_PELSHEIGHT=1048576
constantulongDM_DISPLAYFLAGS=2097152
constantulongDM_DISPLAYFREQUENCY=4194304
constantulongDM_ICMMETHOD=8388608
constantulongDM_ICMINTENT=16777216
constantulongDM_MEDIATYPE=33554432
constantulongDM_DITHERTYPE=67108864
constantulongDM_PANNINGWIDTH=134217728
constantulongDM_PANNINGHEIGHT=268435456
/*orientationselections*/
constantulongDMORIENT_PORTRAIT=1
constantulongDMORIENT_LANDSCAPE=2
constantulongPRINTER_ATTRIBUTE_QUEUED=0001
constantulongPRINTER_ATTRIBUTE_DIRECT=0002
constantulongPRINTER_ATTRIBUTE_DEFAULT=0004
constantulongPRINTER_ATTRIBUTE_SHARED=0008
constantulongPRINTER_ATTRIBUTE_NETWORK=0016
constantulongPRINTER_ATTRIBUTE_HIDDEN=0032
constantulongPRINTER_ATTRIBUTE_LOCAL=0064
constantulongPRINTER_ATTRIBUTE_ENABLE_DEVQ=128
constantulongPRINTER_ATTRIBUTE_KEEPPRINTEDJOBS=256
constantulongPRINTER_ATTRIBUTE_DO_COMPLETE_FIRST=512
constantulongPRINTER_ATTRIBUTE_WORK_OFFLINE=1024
constantulongPRINTER_ATTRIBUTE_ENABLE_BIDI=2048
constantulongPRINTER_ATTRIBUTE_RAW_ONLY=4096
constantulongDM_IN_BUFFER=8
constantulongDM_IN_PROMPT=4
constantulongDM_OUT_BUFFER=2
constantulongDM_OUT_DEFAULT=1
constantulongDC_FIELDS=1
constantulongDC_PAPERS=2
constantulongDC_PAPERSIZE=3
constantulongDC_MINEXTENT