GDIRef.pdf

(831 KB) Pobierz
GDIRef.fm
Win32 API Reference
Win32 API Reference for HLA
2
GDI32.lib
2.1 AbortDoc
The AbortDoc function stops the current print job and erases everything drawn since the last call
to the StartDoc function.
AbortDoc: procedure
(
hdc:dword
);
stdcall;
returns( "eax" );
external( "__imp__AbortDoc@4" );
Parameters
hdc
[in] Handle to the device context for the print job.
Return Values
If the function succeeds, the return value is greater than zero.
If the function fails, the return value is SP_ERROR.
Windows NT/Windows 2000: To get extended error information, call GetLastError .
Remarks
Applications should call the AbortDoc function to stop a print job if an error occurs, or to stop a
print job after the user cancels that job. To end a successful print job, an application should call
the EndDoc function.
If Print Manager was used to start the print job, calling AbortDoc erases the entire spool job, so
that the printer receives nothing. If Print Manager was not used to start the print job, the data may
already have been sent to the printer. In this case, the printer driver resets the printer (when possi-
ble) and ends the print job.
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in gdi32.hhf.
Library: Use Gdi32.lib.
See Also
Printing and Print Spooler Overview, Printing and Print Spooler Functions, EndDoc, SetAbort-
Page 1
Volume 1
Proc, StartDoc
2.2 AbortPath
The AbortPath function closes and discards any paths in the specified device context.
AbortPath: procedure
(
hdc:dword
);
stdcall;
returns( "eax" );
external( "__imp__AbortPath@4" );
Parameters
hdc
[in] Handle to the device context from which a path will be discarded.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Windows NT/2000: To get extended error information, call GetLastError.
Remarks
If there is an open path bracket in the given device context, the path bracket is closed and the path
is discarded. If there is a closed path in the device context, the path is discarded.
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in gdi32.hhf
Library: Use Gdi32.lib.
See Also
Paths Overview, Path Functions, BeginPath, EndPath
2.3 AddFontMemResourceEx
The AddFontMemResourceEx function adds the font resource from a memory image to the sys-
tem.
AddFontMemResourceEx: procedure
(
var pbFont: var;
Page 2
Win32 API Reference
cbFont: dword;
var pdv: var;
var pcFonts:dword
);
stdcall;
returns( "eax" );
external( "__imp__AddFontMemResourceEx@16" );
Parameters
pbFont
[in] Pointer to a font resource.
cbFont
[in] Number of bytes in the font resource that is pointed to by pbFont .
pdv
[in] Reserved. Must be 0.
pcFonts
[in] Pointer to a variable that specifies the number of fonts installed.
Return Values
If the function succeeds, the return value specifies the handle to the font added. This handle
uniquely identifies the fonts that were installed on the system. If the function fails, the return
value is zero.
Remarks
This function allows an application to get a font that is embedded in a document or a Web page. A
font that is added by AddFontMemResourceEx is always private to the process that made the
call and is not enumerable.
A memory image can contain more than one font. When this function succeeds, pcFonts is a
pointer to a DWORD whose value is the number of fonts added to the system as a result of this
call. For example, this number could be 2 for the vertical and horizontal faces of an Asian font.
When the function succeeds, the caller of this function can free the memory pointed to by pbFont
because the system has made its own copy of the memory. To remove the fonts that were installed,
call RemoveFontMemResourceEx . However, when the process goes away, the system will unload the
fonts even if the process did not call RemoveFontMemResource .
Requirements
Windows NT/2000: Requires Windows 2000 or later.
Windows 95/98: Unsupported.
Header: Declared in gdi32.hhf.
Library: Use Gdi32.lib.
See Also
Fonts and Text Overview, Font and Text Functions, RemoveFontMemResourceEx, SendMessage, DESIGNVECTOR
Page 3
Volume 1
2.4 AddFontResource
The AddFontResource function adds the font resource from the specified file to the system font
table. The font can subsequently be used for text output by any Win32-based application.
To mark a font as private or no enumerable, use the AddFontResourceEx function.
AddFontResource: procedure
(
lpszFilename: string
);
stdcall;
returns( "eax" );
external( "__imp__AddFontResourceA@4" );
Parameters
lpszFilename
[in] Pointer to a null-terminated character string that contains a valid font file name. This
parameter can specify any of the following files.
File extension
Description
.fon
Font resource file.
.fnt
Raw bitmap font file.
.ttf
Raw TrueType file.
.ttc
Windows 95/98 East Asian and Windows NT: TrueType font col-
lection.
.fot
TrueType resource file.
.otf
PostScript OpenType font.
.mmm
multiple master Type1 font resource file. It must be used with .pfm
and.pfbfiles.
.pfb
Type 1 font bits file. It is used with a .pfm file.
.pfm
Type 1 font metrics file. It is used with a .pfb file.
Windows 2000: To add a font whose information comes from several resource files, have lpsz-
FileName point to a string with the file names separated by a | --for example, abcxxxxx.pfm |
abcxxxxx.pfb.
Return Values
If the function succeeds, the return value specifies the number of fonts added.
If the function fails, the return value is zero.
Page 4
Win32 API Reference
Remarks
Any application that adds or removes fonts from the system font table should notify other win-
dows of the change by sending a WM_FONTCHANGE message to all top-level windows in the
operating system. The application should send this message by calling the SendMessage function
and setting the hwnd parameter to HWND_BROADCAST.
When an application no longer needs a font resource that it loaded by calling the AddFontRe-
source function, it must remove that resource by calling the RemoveFontResource function.
This function installs the font only for the current session. When the system restarts, the font will
not be present. To have the font installed even after restarting the system, the font must be listed in
the registry.
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in gdi32.hhf
Library: Use Gdi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.
See Also
Fonts and Text Overview, Font and Text Functions, AddFontResourceEx, RemoveFontResource, SendMessage
2.5 AddFontResourceEx
The AddFontResourceEx function adds the font resource from the specified file to the system.
Fonts added with the AddFontResourceEx function can be marked as private and not enumera-
ble.
AddFontResourceEx: procedure
(
lpszFilename: string;
fl:
dword;
var pdv:
var
);
stdcall;
returns( "eax" );
external( "__imp__AddFontResourceExA@12" );
Parameters
lpszFilename
[in] Pointer to a null-terminated character string that contains a valid font file file name. This
parameter can specify any of the following files.
File extension
Description
.fon
Font resource file.
Page 5
Zgłoś jeśli naruszono regulamin