ebook img

Win32 API Reference - Plantation Productions, Inc PDF

126 Pages·2001·0.81 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Win32 API Reference - Plantation Productions, Inc

Win32APIReference Win32 API Reference for HLA 2 GDI32.lib 2.1 AbortDoc The AbortDoc functionstops thecurrentprintjobanderaseseverythingdrawnsincethelastcall tothe StartDoc function. AbortDoc: procedure ( hdc:dword ); stdcall; returns( "eax" ); external( "__imp__AbortDoc@4" ); Parameters hdc [in]Handleto the device context forthe printjob. ReturnValues If the functionsucceeds,thereturnvalue is greaterthanzero. If the functionfails,the return valueis SP_ERROR. Windows NT/Windows 2000:To getextendederrorinformation,call GetLastError. Remarks Applications shouldcallthe AbortDoc functionto stopa printjobifanerror occurs,ortostopa print jobafterthe usercancels thatjob.To enda successfulprintjob,anapplicationshould call the EndDoc function. If PrintManagerwas used tostart the printjob,calling AbortDoc erases the entirespooljob,so thattheprinterreceivesnothing.IfPrintManagerwas notusedtostarttheprintjob,thedatamay alreadyhave beensenttothe printer.In this case,the printer driverresets theprinter(whenpossi- ble)and ends theprintjob. Requirements Windows NT/2000:Requires Windows NT3.1 orlater. Windows 95/98:RequiresWindows95 orlater. Header:Declared ingdi32.hhf. Library:UseGdi32.lib. SeeAlso PrintingandPrint SpoolerOverview,Printingand PrintSpoolerFunctions,EndDoc,SetAbort- Page1 Volume1 Proc,StartDoc 2.2 AbortPath The AbortPathfunctioncloses anddiscards anypaths in thespecifieddevice context. AbortPath: procedure ( hdc:dword ); stdcall; returns( "eax" ); external( "__imp__AbortPath@4" ); Parameters hdc [in]Handleto the device context fromwhicha pathwillbe discarded. ReturnValues If the functionsucceeds,thereturnvalue is nonzero. If the functionfails,the return valueis zero. Windows NT/2000:Toget extended errorinformation,callGetLastError. Remarks Ifthereisanopenpathbracketinthegivendevicecontext,thepathbracketisclosedandthepath is discarded.Ifthereis a closed pathin thedevicecontext,the path is discarded. Requirements Windows NT/2000:Requires Windows NT3.1 orlater. Windows 95/98:Requires Windows95 orlater. Header:Declared ingdi32.hhf Library:UseGdi32.lib. SeeAlso PathsOverview,PathFunctions,BeginPath,EndPath 2.3 AddFontMemResourceEx The AddFontMemResourceExfunction addsthefontresource fromamemoryimagetothesys- tem. AddFontMemResourceEx: procedure ( var pbFont: var; Page2 Win32APIReference cbFont: dword; var pdv: var; var pcFonts:dword ); stdcall; returns( "eax" ); external( "__imp__AddFontMemResourceEx@16" ); Parameters pbFont [in]Pointerto afontresource. cbFont [in]Numberofbytes inthe font resourcethatis pointedto bypbFont. pdv [in]Reserved.Must be0. pcFonts [in]Pointerto avariable thatspecifies thenumberoffonts installed. ReturnValues If the functionsucceeds,thereturnvalue specifies the handle to thefontadded.This handle uniquelyidentifies thefonts thatwere installed onthe system.Ifthe function fails,thereturn value is zero. Remarks ThisfunctionallowsanapplicationtogetafontthatisembeddedinadocumentoraWebpage.A font thatis added by AddFontMemResourceEx is always privateto theprocess thatmade the callandis notenumerable. Amemoryimage can contain more thanone font.Whenthis functionsucceeds,pcFonts is a pointertoa DWORDwhose valueis the numberoffonts addedto thesystem as aresultofthis call.Forexample,this numbercould be2 forthe verticalandhorizontalfaces ofanAsianfont. Whenthefunctionsucceeds,the callerofthisfunctioncanfree the memorypointedtobypbFont becausethesystemhasmadeitsowncopyofthememory.Toremovethefontsthatwereinstalled, callRemoveFontMemResourceEx.However,whentheprocessgoesaway,the systemwillunloadthe fonts evenifthe process didnot call RemoveFontMemResource. Requirements Windows NT/2000:Requires Windows 2000orlater. Windows 95/98:Unsupported. Header:Declared ingdi32.hhf. Library:UseGdi32.lib. SeeAlso FontsandTextOverview,FontandTextFunctions,RemoveFontMemResourceEx,SendMessage,DESIGNVECTOR Page3 Volume1 2.4 AddFontResource The AddFontResourcefunctionadds the fontresource fromthe specified file tothe systemfont table.The fontcan subsequentlybe usedfortextoutput byany Win32-based application. Tomarka fontas private ornoenumerable,usethe AddFontResourceEx function. AddFontResource: procedure ( lpszFilename: string ); stdcall; returns( "eax" ); external( "__imp__AddFontResourceA@4" ); Parameters lpszFilename [in]Pointerto anull-terminatedcharacter string thatcontains a valid font file name.This parametercan specify anyof the following files. Fileextension Description .fon Fontresource file. .fnt Raw bitmapfontfile. .ttf Raw TrueType file. .ttc Windows 95/98 East AsianandWindows NT:TrueType fontcol- lection. .fot TrueType resource file. .otf PostScript OpenType font. .mmm multiple master Type1fontresource file.It mustbe usedwith.pfm and.pfbfiles. .pfb Type1 fontbits file.Itis usedwith a.pfm file. .pfm Type1 fontmetrics file.Itis usedwitha .pfb file. Windows 2000: To add afontwhoseinformation comes from several resourcefiles,havelpsz- FileNamepoint to a stringwiththe file names separatedby a |--forexample,abcxxxxx.pfm| abcxxxxx.pfb. ReturnValues If the functionsucceeds,thereturnvalue specifies the numberoffonts added. If the functionfails,the return valueis zero. Page4 Win32APIReference Remarks Anyapplication thataddsor removes fonts fromthe systemfonttable should notify otherwin- dowsofthechangebysendinga WM_FONTCHANGEmessagetoalltop-levelwindowsinthe operatingsystem.TheapplicationshouldsendthismessagebycallingtheSendMessagefunction andsettingthe hwnd parametertoHWND_BROADCAST. When anapplication nolongerneeds afontresourcethat itloaded bycalling theAddFontRe- source function,itmust remove thatresourceby callingthe RemoveFontResourcefunction. This functioninstalls thefontonlyforthecurrentsession.Whenthesystemrestarts,the fontwill notbepresent.Tohavethefontinstalledevenafterrestartingthesystem,thefontmustbelistedin theregistry. Requirements Windows NT/2000:Requires Windows NT3.1 orlater. Windows 95/98:RequiresWindows95 orlater. Header:Declared ingdi32.hhf Library:UseGdi32.lib. Unicode:Implementedas Unicode and ANSIversions onWindows NT/2000. SeeAlso FontsandTextOverview,FontandTextFunctions,AddFontResourceEx,RemoveFontResource,SendMessage 2.5 AddFontResourceEx The AddFontResourceEx function adds thefontresource from thespecifiedfileto the system. Fonts addedwith the AddFontResourceEx function can bemarked as private and notenumera- ble. AddFontResourceEx: procedure ( lpszFilename: string; fl: dword; var pdv: var ); stdcall; returns( "eax" ); external( "__imp__AddFontResourceExA@12" ); Parameters lpszFilename [in]Pointerto anull-terminatedcharacter string thatcontainsa valid font file file name.This parametercan specify anyof the following files. Fileextension Description .fon Fontresource file. Page5 Volume1 .fnt Raw bitmapfontfile. .ttf Raw TrueType file. .ttc Windows95/98EastAsianandWindowsNT:TrueTypefontcol- lection. .fot TrueType resource file. .otf PostScript OpenType font. .mmm multiple master Type1fontresource file.It mustbe usedwith.pfm and.pfbfiles. .pfb Type1 fontbits file.Itis usedwith a.pfm file. .pfm Type1 fontmetrics file.Itis usedwitha .pfb file. Toaddafontwhoseinformationcomesfromseveralresourcefiles,pointlpszFileNametoastring withthe file names separatedby a| --forexample,abcxxxxx.pfm|abcxxxxx.pfb. fl [in]Specifies characteristicsof the fontto beaddedtothe system.This parametercanbe one ofthefollowingvalues. Value Meaning FR_PRIVATE Specifiesthatonlythe process that called the AddFontResourceEx functioncanusethisfont.Whenthefontnamematches apublicfont, theprivate font will be chosen.Whenthe process terminates,the sys- temwillremove allfonts installed bythe process withthe AddFon- tResourceExfunction. FR_NOT_ENUM Specifiesthatnoprocess,including the processthatcalled the AddFontResourceExfunction,can enumeratethis font. pdv [in]Reserved.Itmustbe 0. ReturnValues If the functionsucceeds,thereturnvalue specifies the numberoffonts added. If the functionfails,the return valueis zero. Remarks This functionallows a process to use fonts withoutallowing otherprocesses access tothe fonts. When anapplication nolongerneeds afontresourceitloadedby callingthe AddFontRe- sourceExfunction,itmustremovethe resource bycalling theRemoveFontResourceEx function. This functioninstalls thefontonlyforthecurrentsession.Whenthesystemrestarts,the fontwill Page6 Win32APIReference notbepresent.Tohavethefontinstalledevenafterrestartingthesystem,thefontmustbelistedin theregistry. Requirements Windows NT/2000:Requires Windows 2000orlater. Windows 95/98:Unsupported. Header:Declared ingdi32.hhf Library:UseGdi32.lib. Unicode:Implementedas Unicode and ANSIversions onWindows 2000. SeeAlso FontsandTextOverview,FontandTextFunctions,RemoveFontResourceEx,SendMessage 2.6 AngleArc The AngleArc functiondraws a line segmentandan arc.The line segmentisdrawn fromthecur- rentposition to thebeginning ofthe arc.The arcis drawnalongthe perimeter ofacircle withthe givenradius and center.The length ofthearc is defined bythe given startand sweepangles. AngleArc: procedure ( hdc: dword; x: dword; y: dword; dwRadius: dword; eStartAngle:dword; eSweepAngle:dword ); stdcall; returns( "eax" ); external( "__imp__AngleArc@24" ); Parameters hdc [in]Handleto adevicecontext. X [in]Specifies the logicalx-coordinateofthe center ofthecircle. Y [in]Specifies the logicaly-coordinateofthe center ofthecircle. dwRadius [in]Specifies the radius,inlogical units,ofthe circle.This value mustbe positive. eStartAngle [in]Specifies the startangle,in degrees,relative tothe x-axis. eSweepAngle Page7 Volume1 [in]Specifies the sweepangle,in degrees,relative tothe startingangle. ReturnValues If the functionsucceeds,thereturnvalue is nonzero. If the functionfails,the return valueis zero. Windows NT/2000:Toget extended errorinformation,callGetLastError. Remarks The AngleArc functionmoves the current positionto the ending point ofthe arc. The arcdrawn bythis functionmay appearto beelliptical,depending onthe currenttransforma- tionand mappingmode.Before drawing thearc, AngleArcdraws the linesegmentfromthe cur- rentposition to thebeginning ofthe arc. The arcis drawn byconstructing animaginary circle aroundthe specified centerpoint with the specified radius.The startingpoint ofthearc is determinedbymeasuringcounterclockwisefrom thex-axis ofthe circle by the numberofdegrees in thestartangle.Theendingpointis similarly located bymeasuring counterclockwise from the starting point bythe numberofdegrees in the sweepangle. If the sweepangleis greaterthan 360degrees,thearc is swept multiple times. This functiondraws lines byusingthe current pen.The figure is notfilled. Requirements Windows NT/2000:Requires Windows NT3.1 orlater. Windows 95/98:Unsupported. Header:Declared ingdi32.hhf Library:UseGdi32.lib. SeeAlso LinesandCurvesOverview,LineandCurveFunctions,Arc,ArcTo,MoveToEx 2.7 AnimatePalette The AnimatePalette function replaces entries inthe specified logicalpalette. AnimatePalette: procedure ( hpal: dword; iStartIndex:dword; cEntries: dword; var ppe: PALETTEENTRY ); stdcall; returns( "eax" ); external( "__imp__AnimatePalette@16" ); Page8 Win32APIReference Parameters hpal [in]Handleto the logical palette. iStartIndex [in]Specifies the first logicalpalette entryto be replaced. cEntries [in]Specifies the numberofentries tobe replaced. ppe [in]Pointerto thefirstmemberin an array ofPALETTEENTRY structures used toreplace the current entries. ReturnValues If the functionsucceeds,thereturnvalue is nonzero. Ifthefunctionfails,thereturnvalueiszero.Togetextendederrorinformation,callGetLastError. Remarks Anapplication can determine whether adevice supports palette operationsby callingthe GetDe- viceCaps function and specifyingthe RASTERCAPSconstant. TheAnimatePalettefunctiononlychangesentrieswiththePC_RESERVEDflagsetinthecorre- sponding palPalEntrymemberofthe LOGPALETTE structure. If the given paletteis associatedwiththe active window,the colors inthe paletteare replaced immediately. Requirements Windows NT/2000:Requires Windows NT3.1 orlater. Windows 95/98:RequiresWindows95 orlater. Header:Declared ingdi32.hhf Library:UseGdi32.lib. SeeAlso ColorsOverview,ColorFunctions,CreatePalette,GetDeviceCaps,LOGPALETTE,PALETTEENTRY 2.8 Arc The Arc functiondraws an ellipticalarc. Arc: procedure ( hdc: dword; nLeftRect: dword; nTopRect: dword; nRightRect: dword; Page9 Volume1 nBottomRect: dword; nXStartArc: dword; nYStartArc: dword; nXEndArc: dword; nYEndArc: dword ); stdcall; returns( "eax" ); external( "__imp__Arc@36" ); Parameters hdc [in]Handleto the device context wheredrawing takes place. nLeftRect [in]Specifies the logicalx-coordinateofthe upper-left corner ofthebounding rectangle. Windows 95/98:Thesumof nLeftRectplusnRightRect must beless than32768. nTopRect [in]Specifies the logicaly-coordinateofthe upper-left corner ofthebounding rectangle. Windows 95/98:Thesumof nTopRectplus nBottomRect mustbe less than 32768. nRightRect [in]Specifies the logicalx-coordinateofthe lower-rightcornerof the boundingrectangle. Windows 95/98:Thesumof nLeftRectplusnRightRect must beless than32768. nBottomRect [in]Specifies the logicaly-coordinateofthe lower-rightcornerof the boundingrectangle. Windows 95/98:Thesumof nTopRectplus nBottomRect mustbe less than 32768. nXStartArc [in]Specifies the logicalx-coordinateofthe endingpoint oftheradial line definingthe start- ingpointofthe arc. nYStartArc [in]Specifies the logicaly-coordinateofthe endingpoint oftheradial line definingthe start- ingpointofthe arc. nXEndArc [in]Specifiesthelogicalx-coordinateoftheendingpointoftheradiallinedefiningtheending pointofthe arc. nYEndArc [in]Specifiesthelogicaly-coordinateoftheendingpointoftheradiallinedefiningtheending pointofthe arc. Page10

Description:
Win32 API Reference Page 3 cbFont: dword; var pdv: var; var pcFonts This function allows an application to get a font that is embedded in a document or a Web page. A
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.