|
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
/// <content>
/// Contains extern methods from "GDI32.dll".
/// </content>
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal static partial class PInvoke
{
/// <summary>The AbortDoc function stops the current print job and erases everything drawn since the last call to the StartDoc function.</summary>
/// <param name="hdc">Handle to the device context for the print job.</param>
/// <returns>
/// <para>If the function succeeds, the return value is greater than zero. If the function fails, the return value is SP_ERROR.</para>
/// </returns>
/// <remarks>
/// <para><div class="alert"><b>Note</b> This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</div> <div> </div> Applications should call the <b>AbortDoc</b> 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 <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-enddoc">EndDoc</a> function. If Print Manager was used to start the print job, calling <b>AbortDoc</b> 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 possible) and ends the print job.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-abortdoc#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern int AbortDoc(winmdroot.Graphics.Gdi.HDC hdc);
/// <summary>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 enumerable. (Unicode)</summary>
/// <param name="name">
/// <para>A pointer to a null-terminated character string that contains a valid font file name. This parameter can specify any of the following files. </para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-addfontresourceexw#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="fl"></param>
/// <param name="res">Reserved. Must be zero.</param>
/// <returns>
/// <para>If the function succeeds, the return value specifies the number of fonts added. If the function fails, the return value is zero. No extended error information is available.</para>
/// </returns>
/// <remarks>
/// <para>This function allows a process to use fonts without allowing other processes access to the fonts. When an application no longer needs a font resource it loaded by calling the <b>AddFontResourceEx</b> function, it must remove the resource by calling the <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-removefontresourceexa">RemoveFontResourceEx</a> 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. A font listed in the registry and installed to a location other than the %windir%\fonts\ folder cannot be modified, deleted, or replaced as long as it is loaded in any session. In order to change one of these fonts, it must first be removed by calling <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-removefontresourcea">RemoveFontResource</a>, removed from the font registry (<b>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts</b>), and the system restarted. After restarting the system, the font will no longer be loaded and can be changed.</para>
/// <para>> [!NOTE] > The wingdi.h header defines AddFontResourceEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes).</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-addfontresourceexw#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true, EntryPoint = "AddFontResourceExW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern unsafe int AddFontResourceEx(winmdroot.Foundation.PCWSTR name, winmdroot.Graphics.Gdi.FONT_RESOURCE_CHARACTERISTICS fl, [Optional] void* res);
/// <summary>The EndDoc function ends a print job.</summary>
/// <param name="hdc">Handle to the device context for the print job.</param>
/// <returns>
/// <para>If the function succeeds, the return value is greater than zero. If the function fails, the return value is less than or equal to zero.</para>
/// </returns>
/// <remarks>
/// <para><div class="alert"><b>Note</b> This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</div> <div> </div> Applications should call <b>EndDoc</b> immediately after finishing a print job.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-enddoc#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern int EndDoc(winmdroot.Graphics.Gdi.HDC hdc);
/// <summary>The EndPage function notifies the device that the application has finished writing to a page. This function is typically used to direct the device driver to advance to a new page.</summary>
/// <param name="hdc">A handle to the device context for the print job.</param>
/// <returns>
/// <para>If the function succeeds, the return value is greater than zero. If the function fails, the return value is less than or equal to zero.</para>
/// </returns>
/// <remarks>
/// <para><div class="alert"><b>Note</b> This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</div> <div> </div> Use the <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-resetdca">ResetDC</a> function to change the device mode, if necessary, after calling the <b>EndPage</b> function. Note that a call to <b>ResetDC</b> resets all device context attributes back to default values. Neither <b>EndPage</b> nor <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-startpage">StartPage</a> resets the device context attributes. Device context attributes remain constant across subsequent pages. You do not need to re-select objects and set up the mapping mode again before printing the next page; however, doing so will produce the same results and reduce code differences between versions of Windows. When a page in a spooled file exceeds approximately 350 MB, it may fail to print and not send an error message. For example, this can occur when printing large EMF files. The page size limit depends on many factors including the amount of virtual memory available, the amount of memory allocated by calling processes, and the amount of fragmentation in the process heap.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-endpage#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern int EndPage(winmdroot.Graphics.Gdi.HDC hdc);
/// <summary>The ExtEscape function enables an application to access device capabilities that are not available through GDI.</summary>
/// <param name="hdc">A handle to the device context.</param>
/// <param name="iEscape">
/// <para>The escape function to be performed. It can be one of the following or it can be an application-defined escape function. </para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-extescape#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="cjInput">The number of bytes of data pointed to by the <i>lpszInData</i> parameter.</param>
/// <param name="lpInData">A pointer to the input structure required for the specified escape. See also Remarks.</param>
/// <param name="cjOutput">The number of bytes of data pointed to by the <i>lpszOutData</i> parameter.</param>
/// <param name="lpOutData">A pointer to the structure that receives output from this escape. This parameter must not be <b>NULL</b> if <b>ExtEscape</b> is called as a query function. If no data is to be returned in this structure, set <i>cbOutput</i> to 0. See also Remarks.</param>
/// <returns>The return value specifies the outcome of the function. It is greater than zero if the function is successful, except for the QUERYESCSUPPORT printer escape, which checks for implementation only. The return value is zero if the escape is not implemented. A return value less than zero indicates an error.</returns>
/// <remarks>
/// <para><div class="alert"><b>Note</b> This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</div> <div> </div> Use this function to pass a driver-defined escape value to a device. Use the <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-escape">Escape</a> function to pass one of the system-defined escape values to a device, unless the escape is one of the defined escapes in <i>nEscape</i>. <b>ExtEscape</b> might not work properly with the system-defined escapes. In particular, escapes in which <i>lpszInData</i> is a pointer to a structure that contains a member that is a pointer will fail. Note, that the behavior described in this article is the expected behavior, but it is up to the driver to comply with this model. The variables referenced by <i>lpszInData</i> and <i>lpszOutData</i> should not be the same or overlap. If the input and the output buffer size variables overlap, they may not contain the correct values after the call returns. For the best results, <i>lpszInData</i> and <i>lpszOutData</i> should refer to different variables. The <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/dd183421(v=vs.85)">CHECKJPEGFORMAT</a> printer escape function determines whether a printer supports printing a JPEG image. Before using the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/dd183421(v=vs.85)">CHECKJPEGFORMAT</a> printer escape function, call the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/ff686811(v=vs.85)">QUERYESCSUPPORT</a> printer escape function to determine whether the driver supports <b>CHECKJPEGFORMAT</b>. For sample code that demonstrates the use of <b>CHECKJPEGFORMAT</b>, see <a href="https://docs.microsoft.com/windows/desktop/gdi/testing-a-printer-for-jpeg-or-png-support">Testing a Printer for JPEG or PNG Support</a>. The <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/dd183424(v=vs.85)">CHECKPNGFORMAT</a> printer escape function determines whether a printer supports printing a PNG image. Before using the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/dd183421(v=vs.85)">CHECKJPEGFORMAT</a> printer escape function, call the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/ff686811(v=vs.85)">QUERYESCSUPPORT</a> printer escape function to determine whether the driver supports <b>CHECKJPEGFORMAT</b>. For sample code, see <a href="https://docs.microsoft.com/windows/desktop/gdi/testing-a-printer-for-jpeg-or-png-support">Testing a Printer for JPEG or PNG Support</a>. The <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/dd162495(v=vs.85)">DRAWPATTERNRECT</a> printer escape creates a white, gray scale, or solid black rectangle by using the pattern and rule capabilities of Page Control Language (PCL) on Hewlett-Packard LaserJet or LaserJet-compatible printers. A gray scale is a gray pattern that contains a specific mixture of black and white pixels. An application should use the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/ff686811(v=vs.85)">QUERYESCSUPPORT</a> escape to determine whether the printer is capable of drawing patterns and rules before using the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/dd162495(v=vs.85)">DRAWPATTERNRECT</a> escape.</para>
/// <para></para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-extescape#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern int ExtEscape(winmdroot.Graphics.Gdi.HDC hdc, int iEscape, int cjInput, winmdroot.Foundation.PCSTR lpInData, int cjOutput, winmdroot.Foundation.PSTR lpOutData);
/// <summary>The GetDIBits function retrieves the bits of the specified compatible bitmap and copies them into a buffer as a DIB using the specified format.</summary>
/// <param name="hdc">A handle to the device context.</param>
/// <param name="hbm">A handle to the bitmap. This must be a compatible bitmap (DDB).</param>
/// <param name="start">The first scan line to retrieve.</param>
/// <param name="cLines">The number of scan lines to retrieve.</param>
/// <param name="lpvBits">A pointer to a buffer to receive the bitmap data. If this parameter is <b>NULL</b>, the function passes the dimensions and format of the bitmap to the <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/ns-wingdi-bitmapinfo">BITMAPINFO</a> structure pointed to by the <i>lpbmi</i> parameter.</param>
/// <param name="lpbmi">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/ns-wingdi-bitmapinfo">BITMAPINFO</a> structure that specifies the desired format for the DIB data.</param>
/// <param name="usage"></param>
/// <returns>
/// <para>If the <i>lpvBits</i> parameter is non-<b>NULL</b> and the function succeeds, the return value is the number of scan lines copied from the bitmap. If the <i>lpvBits</i> parameter is <b>NULL</b> and <b>GetDIBits</b> successfully fills the <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/ns-wingdi-bitmapinfo">BITMAPINFO</a> structure, the return value is nonzero. If the function fails, the return value is zero. This function can return the following value. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>If the requested format for the DIB matches its internal format, the RGB values for the bitmap are copied. If the requested format doesn't match the internal format, a color table is synthesized. The following table describes the color table synthesized for each format. </para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-getdibits#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern unsafe int GetDIBits(winmdroot.Graphics.Gdi.HDC hdc, winmdroot.Graphics.Gdi.HBITMAP hbm, uint start, uint cLines, [Optional] void* lpvBits, winmdroot.Graphics.Gdi.BITMAPINFO* lpbmi, winmdroot.Graphics.Gdi.DIB_USAGE usage);
/// <summary>The ResetDC function updates the specified printer or plotter device context (DC) using the specified information. (Unicode)</summary>
/// <param name="hdc">A handle to the DC to update.</param>
/// <param name="lpdm">A pointer to a <a href="https://docs.microsoft.com/windows/win32/api/wingdi/ns-wingdi-devmodea">DEVMODE</a> structure containing information about the new DC.</param>
/// <returns>
/// <para>If the function succeeds, the return value is a handle to the original DC. If the function fails, the return value is <b>NULL</b>.</para>
/// </returns>
/// <remarks>
/// <para>An application will typically use the <b>ResetDC</b> function when a window receives a <a href="https://docs.microsoft.com/windows/desktop/gdi/wm-devmodechange">WM_DEVMODECHANGE</a> message. <b>ResetDC</b> can also be used to change the paper orientation or paper bins while printing a document. The <b>ResetDC</b> function cannot be used to change the driver name, device name, or the output port. When the user changes the port connection or device name, the application must delete the original DC and create a new DC with the new information. An application can pass an information DC to the <b>ResetDC</b> function. In that situation, <b>ResetDC</b> will always return a printer DC. <b>ICM:</b> The color profile of the DC specified by the <i>hdc</i> parameter will be reset based on the information contained in the <b>lpInitData</b> member of the <a href="https://docs.microsoft.com/windows/win32/api/wingdi/ns-wingdi-devmodea">DEVMODE</a> structure.</para>
/// <para>> [!NOTE] > The wingdi.h header defines ResetDC as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes).</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-resetdcw#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern unsafe winmdroot.Graphics.Gdi.HDC ResetDCW(winmdroot.Graphics.Gdi.HDC hdc, winmdroot.Graphics.Gdi.DEVMODEW* lpdm);
/// <summary>The StartDoc function starts a print job. (Unicode)</summary>
/// <param name="hdc">A handle to the device context for the print job.</param>
/// <param name="lpdi">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/ns-wingdi-docinfow">DOCINFO</a> structure containing the name of the document file and the name of the output file.</param>
/// <returns>
/// <para>If the function succeeds, the return value is greater than zero. This value is the print job identifier for the document. If the function fails, the return value is less than or equal to zero.</para>
/// </returns>
/// <remarks>
/// <para><div class="alert"><b>Note</b> This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</div> <div> </div> Applications should call the <b>StartDoc</b> function immediately before beginning a print job. Using this function ensures that multipage documents are not interspersed with other print jobs. Applications can use the value returned by <b>StartDoc</b> to retrieve or set the priority of a print job. Call the <a href="https://docs.microsoft.com/windows/desktop/printdocs/getjob">GetJob</a> or <a href="https://docs.microsoft.com/windows/desktop/printdocs/setjob">SetJob</a> function and supply this value as one of the required arguments.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-startdocw#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true, EntryPoint = "StartDocW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern unsafe int StartDoc(winmdroot.Graphics.Gdi.HDC hdc, winmdroot.Storage.Xps.DOCINFOW* lpdi);
/// <summary>The StartPage function prepares the printer driver to accept data.</summary>
/// <param name="hdc">A handle to the device context for the print job.</param>
/// <returns>
/// <para>If the function succeeds, the return value is greater than zero. If the function fails, the return value is less than or equal to zero.</para>
/// </returns>
/// <remarks>
/// <para><div class="alert"><b>Note</b> This is a blocking or synchronous function and might not return immediately. How quickly this function returns depends on run-time factors such as network status, print server configuration, and printer driver implementation—factors that are difficult to predict when writing an application. Calling this function from a thread that manages interaction with the user interface could make the application appear to be unresponsive.</div> <div> </div> The system disables the <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-resetdca">ResetDC</a> function between calls to the <b>StartPage</b> and <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-endpage">EndPage</a> functions. This means that you cannot change the device mode except at page boundaries. After calling <b>EndPage</b>, you can call <b>ResetDC</b> to change the device mode, if necessary. Note that a call to <b>ResetDC</b> resets all device context attributes back to default values. Neither <a href="https://docs.microsoft.com/windows/desktop/api/wingdi/nf-wingdi-endpage">EndPage</a> nor <b>StartPage</b> resets the device context attributes. Device context attributes remain constant across subsequent pages. You do not need to re-select objects and set up the mapping mode again before printing the next page; however, doing so will produce the same results and reduce code differences between versions of Windows.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/wingdi/nf-wingdi-startpage#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[DllImport("GDI32.dll", ExactSpelling = true),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[SupportedOSPlatform("windows5.0")]
internal static extern int StartPage(winmdroot.Graphics.Gdi.HDC hdc);
}
}
|