System.Private.Windows.Core
Allows renting a buffer from with a using statement. Can be used directly as if it
were a .
Buffers are not cleared and as such their initial contents will be random.
Create the with an initial buffer. Useful for creating with an initial stack
allocated buffer.
Create the with an initial buffer. Useful for creating with an initial stack
allocated buffer.
Creating with a stack allocated buffer:using BufferScope<char> buffer = new(stackalloc char[64]);
Stack allocated buffers should be kept small to avoid overflowing the stack.
The required minimum length. If the is not large enough, this will rent from
the shared .
Ensure that the buffer has enough space for number of elements.
Consider if creating new instances is possible and cleaner than using
this method.
True to copy the existing elements when new space is allocated.
Array based collection that tries to avoid copying the internal array and caps the maximum capacity.
To mitigate corrupted length attacks, the backing array has an initial allocation size cap.
The cannot grow past this value and is expected to be this value
when the collection is "finished".
Creates a list trimmed to the given count.
This is an optimized implementation that avoids iterating over the entire list when possible.
Helper class for converting values.
It is intended to save the allocation of a temporary list when converting values. If there are multiple passes
through the list this class should usually be avoided.
Used to suppress finalization in debug builds only.
Unfortunately this can only be used when there is a single implicit conversion operator when called from
a ref struct. C# tries to cast to anything that fits in object, which leads to an ambiguous error.
You need to add GC.SuppressFinalize under #ifdef when you don't have a single implicit conversion.
Enumeration defining the different Graphics properties to apply to an when creating it
from a Graphics object.
Apply clipping region.
Apply coordinate transformation.
Apply all supported Graphics properties.
Get the encoder guid for the given image format guid.
Used to provide a way to give direct internal access to HDC's.
If this flag is true we expect that the object obtained through
should not have a clip or GpMatrix
applied and therefore it is safe to skip getting them.
If a object hasn't been created it, by definition, will be clean when it is
created, so this will return true.
Gets the , if the object was created from one.
Get the object.
If true, this will pass back a object, creating a new one *if* needed.
If false, will pass back a object *if* one exists, otherwise returns null.
Do not dispose of the returned object.
Returns if the exception is an exception that isn't recoverable and/or a likely
bug in our implementation.
Reads a binary formatted from the given .
The data was invalid.
Creates a object from raw data with validation.
was invalid.
Returns the remaining amount of bytes in the given .
Reads an array of primitives.
Writes a collection of primitives.
Only supports , , , ,
, , , ,
, , , ,
, , and .
Writes a object to the given .
Writes .
Simple run length encoder (RLE) that works on spans.
Format used is a byte for the count, followed by a byte for the value.
Get the encoded length, in bytes, of the given data.
Get the decoded length, in bytes, of the given encoded data.
Encode the given data into the given span.
if the span was not large enough to hold the encoded data.
Get a wrapper around the given . Use the return value
in a scope.
Array information structure.
[MS-NRBF] 2.4.2.1
Base class for array records.
[MS-NRBF] 2.4 describes how item records must follow the array record and how multiple null records
can be coalesced into an or
record.
Identifier for the array.
Length of the array.
Typed class for array records.
The array items.
Multi-null records are always expanded to individual entries when reading.
Returns the item at the given index.
Single dimensional array of objects.
[MS-NRBF] 2.4.3.2
Single dimensional array of a primitive type.
[MS-NRBF] 2.4.3.3
Single dimensional array of strings.
[MS-NRBF] 2.4.3.4
Dereferences records.
Writer that writes specific types in binary format without using the BinaryFormatter.
Writes a in binary format.
Writes a in binary format.
Writes a in binary format.
Writes a in binary format.
Writes a nint in binary format.
Writes a nuint in binary format.
Writes a in binary format.
Writes a in binary format.
Attempts to write a value in binary format.
if successful.
Writes a .NET primitive value in binary format.
is not a a primitive value.
Writes a in binary format.
Writes a primitive list in binary format.
Writes the given in binary format if supported.
Writes the given in binary format if supported.
Writes the given in binary format if supported.
Tries to write the given if supported.
Writes a of primitive to primitive values to the given stream in binary format.
Primitive types are anything in the enum.
contained non-primitive values or a custom comparer or hash code provider.
Writes a in binary format.
Writes the given if supported.
Simple wrapper to ensure the is reset to it's original position if the
throws.
Simple wrapper to ensure the is reset to it's original position if the
throws or returns .
Library full name information.
[MS-NRBF] 2.6.2
String record.
[MS-NRBF] 2.5.7
Identifies the remoting type of a class member or array item.
[MS-NRBF] 2.1.2.2
Type is defined by and it is not a string.
Type is
length prefixed string.
Type is System.Object.
Type is a standard .NET object.
Type is an object.
Type is a single-dimensional array of objects.
Type is a single-dimensional array of strings.
Types is a single-dimensional array of a primitive type.
Class info.
[MS-NRBF] 2.3.1.1
Base class for class records.
Includes the values for the class (which trail the record)
[MS-NRBF] 2.3
.
Writes as specified by the
Identifies a class by it's name and library id.
[MS-NRBF] 2.1.1.8
Class information that references another class record's metadata.
[MS-NRBF] 2.3.2.5
The ObjectId of a prior
or .
Class information with type info and the source library.
[MS-NRBF] 2.3.2.1
Expresses that the object can be written with a
Writes the current object to the given .
Record that represents a primitive type or an array of primitive types.
Map of records.
Non-generic record base interface.
Id for the record, or null if the record has no id.
Typed record interface.
Expresses that the object can be written with a
Writes the current object to the given .
Primitive value other than .
[MS-NRBF] 2.5.1
is not primitive.
The record contains a reference to another record that contains the actual value.
[MS-NRBF] 2.5.3
Member type info.
[MS-NRBF] 2.3.1.2
Record that marks the end of the binary format stream.
Base class for null records.
Multiple null object record.
[MS-NRBF] 2.5.5
Multiple null object record (less than 256).
[MS-NRBF] 2.5.5
Null object record.
[MS-NRBF] 2.5.4
Primitive type.
[MS-NRBF] 2.1.2.3
Base record class.
Writes as to the given .
Writes records, coalescing null records into single entries.
contained an object that isn't a record.
Map of records that ensures that IDs are only entered once.
Record type.
[MS-NRBF] 2.1.2.1
Binary format header.
[MS-NRBF] 2.6.1
The id of the root object record.
Ignored. BinaryFormatter puts out -1.
Must be 1.
Must be 0.
that only returns default values.
Allows creating a when a
isn't necessary.
Get a typed value. Hard casts.
Helper to create and track records for and
when duplicates are found.
Returns the appropriate record for the given string.
Returns the for the given .
or if not a .
Returns the for the given if it is a simple primitive array.
or if not a primitive array.
Get the proper for the given .
System class information with type info.
[MS-NRBF] 2.3.2.3
Positive enforcing count of items.
Idea here is that doing this makes it less likely we'll slip through cases where
we don't check for negative numbers. And also not confuse counts with ids.
Identifier struct.
Is Windows 10 first release or later. (Threshold 1, build 10240, version 1507)
Is Windows 10 Anniversary Update or later. (Redstone 1, build 14393, version 1607)
Is Windows 10 Creators Update or later. (Redstone 2, build 15063, version 1703)
Is Windows 10 Creators Update or later. (Redstone 3, build 16299, version 1709)
Is Windows 10 Creators Update or later. (Redstone 4, build 17134, version 1803)
Is this Windows 11 public preview or later?
The underlying API does not read supportedOs from the manifest, it returns the actual version.
Is this Windows 11 version 22H2 or greater?
The underlying API does not read supportedOs from the manifest, it returns the actual version.
Is Windows 8.1 or later.
Is Windows 8 or later.
Function was ended.File access is denied.A Graphics object cannot be created from an image that has an indexed pixel format.SetPixel is not supported for images with indexed pixel formats.Destination points define a parallelogram which must have a length of 3. These points will represent the upper-left, upper-right, and lower-left coordinates (defined in that order).Destination points must be an array with a length of 3 or 4. A length of 3 defines a parallelogram with the upper-left, upper-right, and lower-left corners. A length of 4 defines a quadrilateral with the fourth element of the array specifying the lower-rig ...File not found.Font '{0}' cannot be found.Font '{0}' does not support style '{1}'.A generic error occurred in GDI+.Buffer is too small (internal GDI+ error).Parameter is not valid.Rectangle '{0}' cannot have a width or height equal to 0.Operation requires a transformation of the image from GDI+ to GDI. GDI does not support images with a width or height greater than 32767.Out of memory.Not implemented.GDI+ is not properly initialized (internal GDI+ error).Only TrueType fonts are supported. '{0}' is not a TrueType font.Only TrueType fonts are supported. This is not a TrueType font.Object is currently in use elsewhere.Overflow error.Property cannot be found.Property is not supported.Unknown GDI+ error occurred.Image format is unknown.Current version of GDI+ does not support this feature.Bitmap region is already locked.Unhandled VT: {0}.
Converts the given exception to a if needed, nesting the original exception
and assigning the original stack trace.
Tries to get this object as a .
Tries to get this object as a .
Tries to get this object as a primitive type or string.
if this represented a primitive type or string.
Tries to get this object as a of .
Tries to get this object as a of values.
Tries to get this object as an of primitive types.
Tries to get this object as a binary formatted of keys and values.
Tries to get this object as a binary formatted of keys and values.
Tries to get this object as a binary formatted .
Try to get a supported .NET type object (not WinForms).
Copies the to the ,
terminating with null and truncating to fit if
necessary.
Slices the given at the first null found (if any).
Slices the given at the first null found (if any).
Fast stack based reader.
Care must be used when reading struct values that depend on a specific field state for members to work
correctly. For example, has a very specific set of valid values for its packed
field.
Inspired by patterns.
Fast stack based reader.
Care must be used when reading struct values that depend on a specific field state for members to work
correctly. For example, has a very specific set of valid values for its packed
field.
Inspired by patterns.
Try to read everything up to the given . Advances the reader past the
if found.
Try to read everything up to the given .
The read data, if any.
The delimiter to look for.
to move past the if found.
if the was found.
Try to read the next value.
Try to read a span of the given .
Try to read a value of the given type. The size of the value must be evenly divisible by the size of
.
This is just a straight copy of bits. If has methods that depend on
specific field value constraints this could be unsafe.
The compiler will often optimize away the struct copy if you only read from the value.
Try to read a span of values of the given type. The size of the value must be evenly divisible by the size of
.
This effectively does a and the same
caveats apply about safety.
Check to see if the given values are next.
The span to compare the next items to.
Advance the reader if the given values are next.
The span to compare the next items to.
if the values were found and the reader advanced.
Advance the reader past consecutive instances of the given .
How many positions the reader has been advanced
Advance the reader by the given .
Rewind the reader by the given .
Reset the reader to the beginning of the span.
Advance the reader without bounds checking.
Slicing without bounds checking.
Slicing without bounds checking.
Fast stack based writer.
Fast stack based writer.
Try to write the given value.
Try to write the given value.
Try to write the given value times.
Advance the writer by the given .
Rewind the writer by the given .
Reset the reader to the beginning of the span.
Converts the to string and frees it.
Converts the to a nullable string and frees it.
Gets the length of the BSTR in characters.
The DECIMAL structure represents a decimal data type that provides a sign and scale for a number.Reserved.The high 32 bits of the number.Describes FILETIME and provides syntax, members, and additional remarks.A property of type PT_SYSTIME has a **FILETIME** structure for its value. Such a property has a **FILETIME** data type for the **Value** member in its definition in an [SPropValue](spropvalue.md) structure. The definition of the **FILETIME** structure is in the _Win32 Programmer's Reference_ and in the MAPI header file Mapidefs.h. MAPI defines the structure conditionally to make sure that it is defined when the Win32 definition is unavailable.Read more on docs.microsoft.com.> Low-order 32 bits of the file time value.> High-order 32 bits of the file time value.
Adapter to use when owning classes cannot directly implement .
The **HRESULT** data type is the same as the [SCODE](scode.md) data type. An **HRESULT** value consists of the following fields: - A 1-bit code indicating severity, where zero represents success and 1 represents failure. - A 4-bit reserved value. - An 11-bit code indicating responsibility for the error or warning, also known as a facility code. - A 16-bit code describing the error or warning. Most MAPI interface methods and functions return **HRESULT** values to provide detailed cause formation. **HRESULT** values are also used widely in OLE interface methods. OLE provides several macros for converting between **HRESULT** values and **SCODE** values, another common data type for error handling. > [!NOTE] > In 64-bit MAPI, **HRESULT** is still a 32-bit value. For information about the OLE use of **HRESULT** values, see the *OLE Programmer's Reference*. For more information about the use of these values in MAPI, see [Error Handling](error-handling-in-mapi.md) and any of the following interface methods: [IABLogon::GetLastError](iablogon-getlasterror.md) [IMAPISupport::GetLastError](imapisupport-getlasterror.md) [IMAPIControl::GetLastError](imapicontrol-getlasterror.md) [IMAPITable::GetLastError](imapitable-getlasterror.md) [IMAPIProp::GetLastError](imapiprop-getlasterror.md) [IMAPIViewAdviseSink::OnPrint](imapiviewadvisesink-onprint.md)Read more on docs.microsoft.com.
A pointer to the IErrorInfo interface that provides more information about the
error. You can specify to use the current IErrorInfo interface, or
new IntPtr(-1) to ignore the current IErrorInfo interface and construct the exception
just from the error code.
, if it does not reflect an error.The operation could not be completed.Learn more about this API from docs.microsoft.com.Documentation varies per use. Refer to each: IMbnConnectionContextEvents.OnSetProvisionedContextComplete, IMbnServiceActivationEvents.OnActivationComplete, IMbnSmsEvents.OnSmsSendComplete.Documentation varies per use. Refer to each: IMbnConnectionContextEvents.OnSetProvisionedContextComplete, IMbnConnectionEvents.OnConnectComplete, IMbnPinEvents.OnChangeComplete, IMbnPinEvents.OnDisableComplete, IMbnPinEvents.OnEnableComplete, IMbnPinEvents.OnEnterComplete, IMbnPinEvents.OnUnblockComplete, IMbnPinManagerEvents.OnGetPinStateComplete, IMbnRadioEvents.OnSetSoftwareRadioStateComplete, IMbnServiceActivationEvents.OnActivationComplete, IMbnSmsEvents.OnSetSmsConfigurationComplete, IMbnSmsEvents.OnSmsDeleteComplete, IMbnSmsEvents.OnSmsReadComplete, IMbnSmsEvents.OnSmsSendComplete.Places the window at the top of the Z order.Learn more about this API from docs.microsoft.com.Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window, the window loses its topmost status and is placed at the bottom of all other windows.Learn more about this API from docs.microsoft.com.Places the window above all non-topmost windows. The window maintains its topmost position even when it is deactivated.Learn more about this API from docs.microsoft.com.Places the window above all non-topmost windows (that is, behind all topmost windows). This flag has no effect if the window is already a non-topmost window.Learn more about this API from docs.microsoft.com.
Used to abstract access to classes that contain a potentially owned handle.
The key benefit of this is that we can keep the owning class from being collected during interop calls.
wraps arbitrary owners with target handles. Having this interface allows implicit use
of the classes (such as System.Windows.Forms.Control) that meet this common pattern in interop and encourages
correct alignment with the proper owner.
Note that keeping objects alive is necessary ONLY when the object has a finalizer that will explicitly
close the handle.
When implementing P/Invoke wrappers that take this interface they should not directly take
, but should take a generic "T" that is constrained to IHandle{T}. Doing
it this way prevents boxing of structs. The "T" parameters should also be marked as
to allow structs to be passed by reference instead of by value.
When implementing this on a struct it is important that either the struct itself is marked as readonly
or these properties are to avoid extra struct copies.
Owner of the that might close it when finalized. Default is the
implementer.
This allows decoupling the owner from the provider and avoids boxing when
is on a struct. See for a concrete usage.
Used to indicate ownership of a native resource pointer.
This should never be put on a struct.
A pointer to a null-terminated, constant character string.
A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK.
Gets the number of characters up to the first null character (exclusive).
Returns a with a copy of this character array, up to the first null character (exclusive).
A , or if is .
Returns a span of the characters in this string, up to the first null character (exclusive).
The POINTS structure defines the x- and y-coordinates of a point.The POINTS structure is similar to the POINT and POINTL structures. The difference is that the members of the POINTS structure are of type SHORT, while those of the other two structures are of type LONG.Specifies the x-coordinate of the point.Specifies the y-coordinate of the point.
The length of the string when it is a null separated list of values that is terminated by
a double null. Does not include the final double null.
Returns a span of the characters in this string, up to the first null character (exclusive).
The RECT structure defines a rectangle by the coordinates of its upper-left and lower-right corners.The RECT structure is identical to the RECTL structure.Specifies the x-coordinate of the upper-left corner of the rectangle.Specifies the y-coordinate of the upper-left corner of the rectangle.Specifies the x-coordinate of the lower-right corner of the rectangle.Specifies the y-coordinate of the lower-right corner of the rectangle.
Finalizable wrapper for COM pointers that gives agile access to the specified interface.
This class should be used to hold all COM pointers that are stored as fields to ensure that they are
safely finalized when needed. Finalization should be avoided whenever possible for performance and timely
resource release (that is, this class should be disposed).
Fields should be nulled out before calling . Releasing the COM pointer during disposal
can result in callbacks to containing classes. Rather than evaluate the risk of this for every class, always
follow this pattern. facilitates doing this safely.
Returns if has the same pointer this
was created from.
Gets the default interface. Throws if failed.
Gets the specified interface. Throws if failed.
Tries to get the default interface.
Tries to get the specified interface.
Gets the managed object using the pointer
this was created from.
Simple list for "typed" COM struct pointer storage. Prevents nulls.
Doesn't implement generic interfaces as pointer types can't be used as generic arguments.
Lifetime management struct for a native COM pointer. Meant to be utilized in a statement
to ensure is called when going out of scope with the using.
This struct has implicit conversions to T** and void** so it can be passed directly to out methods.
For example:
using ComScope<IUnknown> unknown = new(null);
comObject->QueryInterface(&iid, unknown);
Take care to NOT make copies of the struct to avoid accidental over-release.
This should be one of the struct COM definitions as generated by CsWin32. Ideally we'd constrain to
or some other interface tag to enforce that this is being used around
a struct that is actually a COM wrapper.
Tries querying the requested interface into a new .
The result of the query.
Queries the requested interface into a new .
Attempt to create a from the given COM interface.
Create a from the given COM interface. Throws on failure.
Simple helper for checking if a given interface is supported. Only use this if you don't intend to
use the interface, otherwise use .
Wrapper for the COM global interface table.
Registers the given in the global interface table. This decrements the
ref count so that the entry in the table will "own" the interface (as it increments the ref count).
The cookie used to refer to the interface in the table.
Gets an agile interface for the that was given back by
Revokes the interface registered with .
This will decrement the ref count for the interface.
Creates a new instance of an for
that uses the Global Interface Table.
The returned instance should not be cached.
Strategy for that uses the .
Gets a pointer to the IID for the given .
Gets a reference to the IID for the given .
Empty (GUID_NULL in docs).
A pointer to a null-terminated, constant, ANSI character string.
A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK.
Gets the number of characters up to the first null character (exclusive).
Returns a with a copy of this character array, decoding as UTF-8.
A , or if is .
Returns a span of the characters in this string, up to the first null character (exclusive).
The POINTL structure defines the x- and y-coordinates of a point.The POINTL structure is identical to the POINT structure.Specifies the x-coordinate of the point.Specifies the y-coordinate of the point.
Returns a span of the characters in this string, up to the first null character (exclusive).
The SIZE structure defines the width and height of a rectangle.The rectangle dimensions stored in this structure can correspond to viewport extents, window extents, text extents, bitmap dimensions, or the aspect-ratio filter for some extended functions.Specifies the rectangle's width. The units depend on which function uses this structure.Specifies the rectangle's height. The units depend on which function uses this structure.Computes the amount of memory that must be allocated to store this struct, including the specified number of elements in the variable length inline array at the end.
Helper to ensure GDI+ is initialized before making calls.
Returns true if GDI+ has been started.
This should be called anywhere you make calls to GDI+ where you don't
already have a GDI+ handle. In System.Drawing.Common, this is done in the PInvoke static constructor
so it is not necessary for methods defined there.
We don't do this implicitly in the Core assembly to avoid unnecessary loading of GDI+.
https://github.com/microsoft/CsWin32/issues/1308 tracks a proposal to make this more automatic.
Specifies that pixel data contains color indexed values which means they are an index to colors in the
system color table, as opposed to individual color values.
Specifies that pixel data contains GDI colors.
Specifies that pixel data contains alpha values that are not pre-multiplied.
Specifies that pixel format contains pre-multiplied alpha values.
Specifies that pixel format contains extended color values of 16 bits per channel.
Specifies that pixel format is undefined.
Specifies that pixel format doesn't matter.
Specifies that pixel format is 1 bit per pixel indexed color. The color table therefore has two colors in it.
Specifies that pixel format is 4 bits per pixel indexed color. The color table therefore has 16 colors in it.
Specifies that pixel format is 8 bits per pixel indexed color. The color table therefore has 256 colors in it.
Specifies that pixel format is 16 bits per pixel. The color information specifies 65536 shades of gray.
Specifies that pixel format is 16 bits per pixel. The color information specifies 32768 shades of color of
which 5 bits are red, 5 bits are green and 5 bits are blue.
Specifies that pixel format is 16 bits per pixel. The color information specifies 32768 shades of color of
which 5 bits are red, 5 bits are green, 5 bits are blue and 1 bit is alpha.
Specifies that pixel format is 24 bits per pixel. The color information specifies 16777216 shades of color
of which 8 bits are red, 8 bits are green and 8 bits are blue.
Specifies that pixel format is 24 bits per pixel. The color information specifies 16777216 shades of color
of which 8 bits are red, 8 bits are green and 8 bits are blue.
Specifies that pixel format is 32 bits per pixel. The color information specifies 16777216 shades of color
of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are alpha bits.
Specifies that pixel format is 32 bits per pixel. The color information specifies 16777216 shades of color
of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are pre-multiplied alpha bits.
Specifies that pixel format is 48 bits per pixel. The color information specifies 16777216 shades of color
of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are alpha bits.
Specifies pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color of
which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are alpha bits.
Specifies that pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color
of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are pre-multiplied
alpha bits.
Specifies that pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color
of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are alpha bits.
Contains a set of four floating-point numbers that represent the location and size of a rectangle.Learn more about this API from docs.microsoft.com.Creates a D2D1_RECT_F structure that contains the specified dimensions.Type: D2D1_RECT_F A rectangle structure that contains the specified dimensions.Learn more about this API from docs.microsoft.com.This section lists the styles, in addition to standard window styles, supported by status bar controls.Learn more about this API from docs.microsoft.com.
Buffer for values. Uses the stack for buffer sizes up to 16. Use in a
statement.
Helper to scope lifetime of a created via
Deletes the (if any) when disposed.
Use in a statement. If you must pass this around, always pass
by to avoid duplicating the handle and risking a double delete.
Creates a bitmap using
Creates a bitmap compatible with the given via
Helper to scope lifetime of an HDC retrieved via CreateDC/CreateCompatibleDC.
Deletes the HDC (if any) when disposed.
Use in a statement. If you must pass this around, always pass
by to avoid duplicating the handle and risking a double delete.
Creates a compatible HDC for using .
Passing a HDC will use the current screen.
Helper to scope getting a from a object. Releases
the when disposed, unlocking the parent object.
Also saves and restores the state of the HDC.
Use in a statement. If you must pass this around, always pass by+
to avoid duplicating the handle and risking a double release.
Gets the from the given .
When a object is created from a the clipping region and
the viewport origin are applied (). The clipping
region isn't reflected in , which is combined with the HDC HRegion.
The Graphics object saves and restores DC state when performing operations that would modify the DC to
maintain the DC in its original or returned state after .
Applies the origin transform and clipping region of the if it is an
object of type . Otherwise this is a no-op.
When true, saves and restores the state.
Prefer to use .
Ideally we'd not bifurcate what properties we apply unless we're absolutely sure we only want one.
The DEVMODEW structure is used for specifying characteristics of display and print devices in the Unicode (wide) character set.The DEVMODEW structure is the Unicode version of the DEVMODE structure (described in the Microsoft Windows SDK documentation). While applications can use either the ANSI or Unicode version of the structure, drivers are required to use the Unicode version. For printer drivers, the DEVMODEW structure is used for specifying printer characteristics required by a print document. It is also used for specifying a printer's default characteristics. Immediately following a DEVMODEW structure's defined members (often referred to as its public members), there can be a set of driver-defined members (often referred to as private DEVMODEW members). The driver supplies the size, in bytes, of this private area in dmDriverExtra. Driver-defined private members are for exclusive use by the driver. The starting address for the private members can be referenced using the dmSize member as follows:This doc was truncated.Read more on docs.microsoft.com.For a display, specifies the name of the display driver's DLL; for example, "perm3dd" for the 3Dlabs Permedia3 display driver. For a printer, specifies the "friendly name"; for example, "PCL/HP LaserJet" in the case of PCL/HP LaserJet. If the name is greater than CCHDEVICENAME characters in length, the spooler truncates it to fit in the array.Read more on docs.microsoft.com.Specifies the version number of this DEVMODEW structure. The current version number is identified by the DM_SPECVERSION constant in wingdi.h.For a printer, specifies the printer driver version number assigned by the printer driver developer. Display drivers can set this member to DM_SPECVERSION.Read more on docs.microsoft.com.Specifies the size in bytes of the public DEVMODEW structure, not including any private, driver-specified members identified by the dmDriverExtra member.Specifies the number of bytes of private driver data that follow the public structure members. If a device driver does not provide private DEVMODEW members, this member should be set to zero.Specifies bit flags identifying which of the following DEVMODEW members are in use. For example, the DM_ORIENTATION flag is set when the dmOrientation member contains valid data. The DM_XXX flags are defined in wingdi.h.For printers, specifies whether a color printer should print color or monochrome. This member can be one of DMCOLOR_COLOR or DMCOLOR_MONOCHROME. This member is not used for displays.Read more on docs.microsoft.com.For printers, specifies the y resolution of the printer, in DPI. If this member is used, the dmPrintQuality member specifies the x resolution. This member is not used for displays.Read more on docs.microsoft.com.For printers, specifies how TrueType fonts should be printed. This member must be one of the DMTT-prefixed constants defined in wingdi.h. This member is not used for displays.Read more on docs.microsoft.com.For printers, specifies the name of the form to use; such as "Letter" or "Legal". This must be a name that can be obtain by calling the Win32 EnumForms function (described in the Microsoft Window SDK documentation). This member is not used for displays.Read more on docs.microsoft.com.For displays, specifies the number of logical pixels per inch of a display device and should be equal to the ulLogPixels member of the GDIINFO structure. This member is not used for printers.Read more on docs.microsoft.com.For displays, specifies the color resolution, in bits per pixel, of a display device. This member is not used for printers.Read more on docs.microsoft.com.For displays, specifies the width, in pixels, of the visible device surface. This member is not used for printers.Read more on docs.microsoft.com.For displays, specifies the height, in pixels, of the visible device surface. This member is not used for printers.Read more on docs.microsoft.com.For displays, specifies the frequency, in hertz, of a display device in its current mode. This member is not used for printers.Read more on docs.microsoft.com.Specifies one of the DMICMMETHOD-prefixed constants defined in wingdi.h.Specifies one of the DMICM-prefixed constants defined in wingdi.h.Specifies one of the DMMEDIA-prefixed constants defined in wingdi.h.Specifies one of the DMDITHER-prefixed constants defined in wingdi.h.Is reserved for system use and should be ignored by the driver.Is reserved for system use and should be ignored by the driver.Is reserved for system use and should be ignored by the driver.Is reserved for system use and should be ignored by the driver.
Helper to scope lifetime of an retrieved via and
. Releases the (if any)
when disposed.
Use in a statement. If you must pass this around, always pass by
to avoid duplicating the handle and risking a double release.
Creates a using .
GetWindowDC calls GetDCEx(hwnd, null, DCX_WINDOW | DCX_USESTYLE).
GetDC calls GetDCEx(hwnd, null, DCX_USESTYLE) when given a handle. (When given null it has additional
logic, and can't be replaced directly by GetDCEx.
Creates a DC scope for the primary monitor (not the entire desktop).
is the
API to get the DC for the entire desktop.
Used when you must keep a handle to an in a field. Avoid keeping HDC handles in fields
when possible.
Take ownership from a .
Defines the attributes of a font. (LOGFONTW)The following situations do not support ClearType antialiasing: This doc was truncated.Read more on docs.microsoft.com.Type: LONG Specifies the height, in logical units, of the font's character cell or character. The character height value (also known as the em height) is the character cell height value minus the internal-leading value. The font mapper interprets the value specified in lfHeight in the following manner. This doc was truncated.Read more on docs.microsoft.com.Type: LONG Specifies the average width, in logical units, of characters in the font. If lfWidth is not zero, the aspect ratio of the device is matched against the digitization aspect ratio of the available fonts to find the closest match, determined by the absolute value of the difference.Read more on docs.microsoft.com.Type: LONG Specifies the angle, in tenths of degrees, between the escapement vector and the x-axis of the device. The escapement vector is parallel to the base line of a row of text. The lfEscapement member specifies both the escapement and orientation. You should set lfEscapement and lfOrientation to the same value.Read more on docs.microsoft.com.Type: LONG Specifies the angle, in tenths of degrees, between each character's base line and the x-axis of the device.Read more on docs.microsoft.com.Type: LONG Specifies the weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used. The following values are defined in Wingdi.h for convenience. This doc was truncated.Read more on docs.microsoft.com.Type: BYTETRUE to specify an italic font.Read more on docs.microsoft.com.Type: BYTETRUE to specify an underlined font.Read more on docs.microsoft.com.Type: BYTETRUE to specify a strikeout font.Read more on docs.microsoft.com.Type: BYTE Specifies the character set. The following values are predefined: This doc was truncated.Read more on docs.microsoft.com.Type: BYTEType: BYTEType: BYTEType: BYTEType: TCHAR[LF_FACESIZE] Specifies a null-terminated string that specifies the typeface name of the font. The length of this string must not exceed 32 characters, including the terminating null character. The EnumFontFamilies function can be used to enumerate the typeface names of all currently available fonts. If lfFaceName is an empty string, GDI uses the first font that matches the other specified attributes.Read more on docs.microsoft.com.
Helper to scope creating regions. Deletes the region when disposed.
Use in a statement. If you must pass this around, always pass
by to avoid duplicating the handle and risking a double deletion.
Creates a region with the given rectangle via .
Creates a region with the given rectangle via .
Creates a clipping region copy via for the given device context.
Handle to a device context to copy the clipping region from.
Creates a native region from a GDI+ .
Returns true if this represents a null HRGN.
Clears the handle. Use this to hand over ownership to another entity.
The RGNDATAHEADER structure describes the data returned by the GetRegionData function.Learn more about this API from docs.microsoft.com.The size, in bytes, of the header.The type of region. This value must be RDH_RECTANGLES.The number of rectangles that make up the region.The size of the RGNDATA buffer required to receive the RECT structures that make up the region. If the size is not known, this member can be zero.A bounding rectangle for the region in logical units.
Helper to scope lifetime of a saved device context state.
Use in a statement. If you must pass this around, always pass by
to avoid duplicating the handle and risking a double restore.
The state that is saved includes ICM (color management), palette, path drawing state, and other objects
that are selected into the DC (bitmap, brush, pen, clipping region, font).
Ideally saving the entire DC state can be avoided for simple drawing operations and relying on restoring
individual state pieces can be done instead (putting back the original pen, etc.).
Saves the device context state using .
Helper to scope selecting a GDI object into an . Restores the original
object into the when disposed.
Use in a statement. If you must pass this around, always pass
by to avoid duplicating the handle and risking a double selection.
Selects into the given using
.
A BITMAPINFOHEADER structure that contains information about the dimensions of color format. .Read more on docs.microsoft.com.The bmiColors member contains one of the following: This doc was truncated.Read more on docs.microsoft.com.Computes the amount of memory that must be allocated to store this struct, including the specified number of elements in the variable length inline array at the end.The BITMAPINFOHEADER structure contains information about the dimensions and color format of a device-independent bitmap (DIB).
Color Tables
The BITMAPINFOHEADER structure may be followed by an array of palette entries or color masks. The rules depend on the value of biCompression. This doc was truncated.Read more on docs.microsoft.com.Specifies the number of bytes required by the structure. This value does not include the size of the color table or the size of the color masks, if they are appended to the end of structure. See Remarks.Specifies the width of the bitmap, in pixels. For information about calculating the stride of the bitmap, see Remarks.Specifies the height of the bitmap, in pixels. This doc was truncated.Read more on docs.microsoft.com.Specifies the number of planes for the target device. This value must be set to 1.Specifies the number of bits per pixel (bpp). For uncompressed formats, this value is the average number of bits per pixel. For compressed formats, this value is the implied bit depth of the uncompressed image, after the image has been decoded.For compressed video and YUV formats, this member is a FOURCC code, specified as a DWORD in little-endian order. For example, YUYV video has the FOURCC 'VYUY' or 0x56595559. For more information, see FOURCC Codes. For uncompressed RGB formats, the following values are possible: This doc was truncated.Read more on docs.microsoft.com.Specifies the size, in bytes, of the image. This can be set to 0 for uncompressed RGB bitmaps.Specifies the horizontal resolution, in pixels per meter, of the target device for the bitmap.Specifies the vertical resolution, in pixels per meter, of the target device for the bitmap.Specifies the number of color indices in the color table that are actually used by the bitmap. See Remarks for more information.Specifies the number of color indices that are considered important for displaying the bitmap. If this value is zero, all colors are important.The MONITORINFO structure contains information about a display monitor.The GetMonitorInfo function stores information in a MONITORINFO structure or a MONITORINFOEX structure.The MONITORINFO structure is a subset of the MONITORINFOEX structure.Learn more about this API from docs.microsoft.com.The size of the structure, in bytes. Set this member to sizeof ( MONITORINFO ) before calling the GetMonitorInfo function. Doing so lets the function determine the type of structure you are passing to it.Read more on docs.microsoft.com.A RECT structure that specifies the display monitor rectangle, expressed in virtual-screen coordinates. Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.A RECT structure that specifies the work area rectangle of the display monitor, expressed in virtual-screen coordinates. Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative values.A set of flags that represent attributes of the display monitor. The following flag is defined. This doc was truncated.Read more on docs.microsoft.com.The MONITORINFOEX structure contains information about a display monitor.The GetMonitorInfo function stores information into a MONITORINFOEX structure or a MONITORINFO structure.The MONITORINFOEX structure is a superset of the MONITORINFO structure. (Unicode)> [!NOTE] > The winuser.h header defines MONITORINFOEX 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).Read more on docs.microsoft.com.A string that specifies the device name of the monitor being used. Most applications have no use for a display monitor name, and so can save some bytes by using a MONITORINFO structure.Specifies the color and usage of an entry in a logical palette.Learn more about this API from docs.microsoft.com.Type: BYTE The red intensity value for the palette entry.Read more on docs.microsoft.com.Type: BYTE The green intensity value for the palette entry.Read more on docs.microsoft.com.Type: BYTE The blue intensity value for the palette entry.Read more on docs.microsoft.com.Type: BYTE The alpha intensity value for the palette entry. Note that as of DirectX 8, this member is treated differently than documented for Windows.Read more on docs.microsoft.com.The RGBQUAD structure describes a color consisting of relative intensities of red, green, and blue.The bmiColors member of the BITMAPINFO structure consists of an array of RGBQUAD structures.The intensity of blue in the color.The intensity of green in the color.The intensity of red in the color.This member is reserved and must be zero.The RGNDATA structure contains a header and an array of rectangles that compose a region. The rectangles are sorted top to bottom, left to right. They do not overlap.Learn more about this API from docs.microsoft.com.A RGNDATAHEADER structure. The members of this structure specify the type of region (whether it is rectangular or trapezoidal), the number of rectangles that make up the region, the size of the buffer that contains the rectangle structures, and so on.Specifies an arbitrary-size buffer that contains the RECT structures that make up the region.Computes the amount of memory that must be allocated to store this struct, including the specified number of elements in the variable length inline array at the end.
Helper to scope lifetime of a GDI object. Deletes the given object (if any) when disposed.
Use in a statement. If you must pass this around, always pass
by to avoid duplicating the handle and risking a double deletion.
The object to be deleted when the scope closes.
Contains extern methods from "COMCTL32.dll".
Contains extern methods from "GDI32.dll".
Contains extern methods from "gdiplus.dll".
Contains extern methods from "KERNEL32.dll".
Contains extern methods from "OLE32.dll".
Contains extern methods from "OLEAUT32.dll".
Contains extern methods from "USER32.dll".
/>
Tries to get system parameter info for the dpi. dpi is ignored if "SystemParametersInfoForDpi()" API
is not available on the OS that this application is running.
Destroys a property sheet page. An application must call this function for pages that have not been passed to the PropertySheet function.Type: BOOL Returns nonzero if successful, or zero otherwise.Learn more about this API from docs.microsoft.com.Documentation varies per use. Refer to each: GetIconInfo, GetIconInfoEx, GetIconInfoEx, GetIconInfoExA, GetIconInfoExA, GetIconInfoExW, GetIconInfoExW, LoadIcon, LoadIcon, LoadIconA, LoadIconA, LoadIconW, LoadIconW.Documentation varies per use. Refer to each: GetIconInfo, GetIconInfoEx, GetIconInfoEx, GetIconInfoExA, GetIconInfoExA, GetIconInfoExW, GetIconInfoExW, LoadIcon, LoadIcon, LoadIconA, LoadIconA, LoadIconW, LoadIconW.Documentation varies per use. Refer to each: GetIconInfo, GetIconInfoEx, GetIconInfoEx, GetIconInfoExA, GetIconInfoExA, GetIconInfoExW, GetIconInfoExW, LoadIcon, LoadIcon, LoadIconA, LoadIconA, LoadIconW, LoadIconW.Documentation varies per use. Refer to each: GetIconInfo, GetIconInfoEx, GetIconInfoEx, GetIconInfoExA, GetIconInfoExA, GetIconInfoExW, GetIconInfoExW, LoadIcon, LoadIcon, LoadIconA, LoadIconA, LoadIconW, LoadIconW.Documentation varies per use. Refer to each: GetIconInfo, GetIconInfoEx, GetIconInfoEx, GetIconInfoExA, GetIconInfoExA, GetIconInfoExW, GetIconInfoExW, LoadIcon, LoadIcon, LoadIconA, LoadIconA, LoadIconW, LoadIconW.Documentation varies per use. Refer to each: GetIconInfo, GetIconInfoEx, GetIconInfoEx, GetIconInfoExA, GetIconInfoExA, GetIconInfoExW, GetIconInfoExW, LoadIcon, LoadIcon, LoadIconA, LoadIconA, LoadIconW, LoadIconW.Security Shield icon.Learn more about this API from docs.microsoft.com.Exclamation point icon.Learn more about this API from docs.microsoft.com.Hand-shaped icon.Learn more about this API from docs.microsoft.com.Asterisk icon.Learn more about this API from docs.microsoft.com.The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.
A handle to the destination device context.
The x-coordinate, in logical units, of the upper-left corner of the destination rectangle.
The y-coordinate, in logical units, of the upper-left corner of the destination rectangle.
The width, in logical units, of the source and destination rectangles.
The height, in logical units, of the source and the destination rectangles.
A handle to the source device context.
The x-coordinate, in logical units, of the upper-left corner of the source rectangle.
The y-coordinate, in logical units, of the upper-left corner of the source rectangle.
A raster-operation code. These codes define how the color data for the source rectangle is to be combined with the color data for the destination rectangle to achieve the final color. The following list shows some common raster operation codes. This doc was truncated.Read more on docs.microsoft.com.If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.BitBlt only does clipping on the destination DC. If a rotation or shear transformation is in effect in the source device context, BitBlt returns an error. If other transformations exist in the source device context (and a matching transformation is not in effect in the destination device context), the rectangle in the destination device context is stretched, compressed, or rotated, as necessary. If the color formats of the source and destination device contexts do not match, the BitBlt function converts the source color format to match the destination format. When an enhanced metafile is being recorded, an error occurs if the source device context identifies an enhanced-metafile device context. Not all devices support the BitBlt function. For more information, see the RC_BITBLT raster capability entry in the GetDeviceCaps function as well as the following functions: MaskBlt, PlgBlt, and StretchBlt. BitBlt returns an error if the source and destination device contexts represent different devices. To transfer data between DCs for different devices, convert the memory bitmap to a DIB by calling GetDIBits. To display the DIB to the second device, call SetDIBits or StretchDIBits. ICM: No color management is performed when blits occur.Read more on docs.microsoft.com.The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid.
A handle to a logical pen, brush, font, bitmap, region, or palette.
If the function succeeds, the return value is nonzero. If the specified handle is not valid or is currently selected into a DC, the return value is zero.Do not delete a drawing object (pen or brush) while it is still selected into a DC. When a pattern brush is deleted, the bitmap associated with the brush is not deleted. The bitmap must be deleted independently.Read more on docs.microsoft.com.The CombineRgn function combines two regions and stores the result in a third region. The two regions are combined according to the specified mode.
A handle to a new region with dimensions defined by combining two other regions. (This region must exist before CombineRgn is called.)
A handle to the first of two regions to be combined.
A handle to the second of two regions to be combined.
The return value specifies the type of the resulting region. It can be one of the following values. This doc was truncated.The three regions need not be distinct. For example, the hrgnSrc1 parameter can equal the hrgnDest parameter.The CreateBitmap function creates a bitmap with the specified width, height, and color format (color planes and bits-per-pixel).
The bitmap width, in pixels.
The bitmap height, in pixels.
The number of color planes used by the device.
The number of bits required to identify the color of a single pixel.
A pointer to an array of color data used to set the colors in a rectangle of pixels. Each scan line in the rectangle must be word aligned (scan lines that are not word aligned must be padded with zeros). The buffer size expected, *cj*, can be calculated using the formula: This doc was truncated.Read more on docs.microsoft.com.If the function succeeds, the return value is a handle to a bitmap. If the function fails, the return value is NULL. This function can return the following value. This doc was truncated.The CreateBitmap function creates a device-dependent bitmap. After a bitmap is created, it can be selected into a device context by calling the SelectObject function. However, the bitmap can only be selected into a device context if the bitmap and the DC have the same format. The CreateBitmap function can be used to create color bitmaps. However, for performance reasons applications should use CreateBitmap to create monochrome bitmaps and CreateCompatibleBitmap to create color bitmaps. Whenever a color bitmap returned from CreateBitmap is selected into a device context, the system checks that the bitmap matches the format of the device context it is being selected into. Because CreateCompatibleBitmap takes a device context, it returns a bitmap that has the same format as the specified device context. Thus, subsequent calls to SelectObject are faster with a color bitmap from CreateCompatibleBitmap than with a color bitmap returned from CreateBitmap. If the bitmap is monochrome, zeros represent the foreground color and ones represent the background color for the destination device context. If an application sets the nWidth or nHeight parameters to zero, CreateBitmap returns the handle to a 1-by-1 pixel, monochrome bitmap. When you no longer need the bitmap, call the DeleteObject function to delete it.Read more on docs.microsoft.com.The CreateCompatibleBitmap function creates a bitmap compatible with the device that is associated with the specified device context.
A handle to a device context.
The bitmap width, in pixels.
The bitmap height, in pixels.
If the function succeeds, the return value is a handle to the compatible bitmap (DDB). If the function fails, the return value is NULL.The color format of the bitmap created by the CreateCompatibleBitmap function matches the color format of the device identified by the hdc parameter. This bitmap can be selected into any memory device context that is compatible with the original device. Because memory device contexts allow both color and monochrome bitmaps, the format of the bitmap returned by the CreateCompatibleBitmap function differs when the specified device context is a memory device context. However, a compatible bitmap that was created for a nonmemory device context always possesses the same color format and uses the same color palette as the specified device context. Note: When a memory device context is created, it initially has a 1-by-1 monochrome bitmap selected into it. If this memory device context is used in CreateCompatibleBitmap, the bitmap that is created is a monochrome bitmap. To create a color bitmap, use the HDC that was used to create the memory device context, as shown in the following code:This doc was truncated.Read more on docs.microsoft.com.The CreateCompatibleDC function creates a memory device context (DC) compatible with the specified device.
A handle to an existing DC. If this handle is NULL, the function creates a memory DC compatible with the application's current screen.
If the function succeeds, the return value is the handle to a memory DC. If the function fails, the return value is NULL.A memory DC exists only in memory. When the memory DC is created, its display surface is exactly one monochrome pixel wide and one monochrome pixel high. Before an application can use a memory DC for drawing operations, it must select a bitmap of the correct width and height into the DC. To select a bitmap into a DC, use the CreateCompatibleBitmap function, specifying the height, width, and color organization required. When a memory DC is created, all attributes are set to normal default values. The memory DC can be used as a normal DC. You can set the attributes; obtain the current settings of its attributes; and select pens, brushes, and regions. The CreateCompatibleDC function can only be used with devices that support raster operations. An application can determine whether a device supports these operations by calling the GetDeviceCaps function. When you no longer need the memory DC, call the DeleteDC function. We recommend that you call DeleteDC to delete the DC. However, you can also call DeleteObject with the HDC to delete the DC. If hdc is NULL, the thread that calls CreateCompatibleDC owns the HDC that is created. When this thread is destroyed, the HDC is no longer valid. Thus, if you create the HDC and pass it to another thread, then exit the first thread, the second thread will not be able to use the HDC. ICM: If the DC that is passed to this function is enabled for Image Color Management (ICM), the DC created by the function is ICM-enabled. The source and destination color spaces are specified in the DC.Read more on docs.microsoft.com.The CreateDC function creates a device context (DC) for a device using the specified name. (Unicode)
A pointer to a null-terminated character string that specifies either DISPLAY or the name of a specific display device. For printing, we recommend that you pass NULL to lpszDriver because GDI ignores lpszDriver for printer devices.
A pointer to a null-terminated character string that specifies the name of the specific output device being used, as shown by the Print Manager (for example, Epson FX-80). It is not the printer model name. The lpszDevice parameter must be used. To obtain valid names for displays, call EnumDisplayDevices. If lpszDriver is DISPLAY or the device name of a specific display device, then lpszDevice must be NULL or that same device name. If lpszDevice is NULL, then a DC is created for the primary display device. If there are multiple monitors on the system, calling CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL) will create a DC covering all the monitors.Read more on docs.microsoft.com.
This parameter is ignored and should be set to NULL. It is provided only for compatibility with 16-bit Windows.
A pointer to a DEVMODE structure containing device-specific initialization data for the device driver. The DocumentProperties function retrieves this structure filled in for a specified device. The pdm parameter must be NULL if the device driver is to use the default initialization (if any) specified by the user. If lpszDriver is DISPLAY, pdm must be NULL; GDI then uses the display device's current DEVMODE.Read more on docs.microsoft.com.If the function succeeds, the return value is the handle to a DC for the specified device. If the function fails, the return value is NULL.Note that the handle to the DC can only be used by a single thread at any one time. For parameters lpszDriver and lpszDevice, call EnumDisplayDevices to obtain valid names for displays. When you no longer need the DC, call the DeleteDC function. If lpszDriver or lpszDevice is DISPLAY, the thread that calls CreateDC owns the HDC that is created. When this thread is destroyed, the HDC is no longer valid. Thus, if you create the HDC and pass it to another thread, then exit the first thread, the second thread will not be able to use the HDC. When you call CreateDC to create the HDC for a display device, you must pass to pdm either NULL or a pointer to DEVMODE that matches the current DEVMODE of the display device that lpszDevice specifies. We recommend to pass NULL and not to try to exactly match the DEVMODE for the current display device. When you call CreateDC to create the HDC for a printer device, the printer driver validates the DEVMODE. If the printer driver determines that the DEVMODE is invalid (that is, printer driver can’t convert or consume the DEVMODE), the printer driver provides a default DEVMODE to create the HDC for the printer device. ICM: To enable ICM, set the dmICMMethod member of the DEVMODE structure (pointed to by the pInitData parameter) to the appropriate value.Read more on docs.microsoft.com.The CreateDIBSection function creates a DIB that applications can write to directly.
A handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses this device context's logical palette to initialize the DIB colors.
A pointer to a BITMAPINFO structure that specifies various attributes of the DIB, including the bitmap dimensions and colors.
The type of data contained in the bmiColors array member of the BITMAPINFO structure pointed to by pbmi (either logical palette indexes or literal RGB values). The following values are defined. This doc was truncated.Read more on docs.microsoft.com.
A pointer to a variable that receives a pointer to the location of the DIB bit values.
A handle to a file-mapping object that the function will use to create the DIB. This parameter can be NULL. If hSection is not NULL, it must be a handle to a file-mapping object created by calling the CreateFileMapping function with the PAGE_READWRITE or PAGE_WRITECOPY flag. Read-only DIB sections are not supported. Handles created by other means will cause CreateDIBSection to fail. If hSection is not NULL, the CreateDIBSection function locates the bitmap bit values at offset dwOffset in the file-mapping object referred to by hSection. An application can later retrieve the hSection handle by calling the GetObject function with the HBITMAP returned by CreateDIBSection. If hSection is NULL, the system allocates memory for the DIB. In this case, the CreateDIBSection function ignores the dwOffset parameter. An application cannot later obtain a handle to this memory. The dshSection member of the DIBSECTION structure filled in by calling the GetObject function will be NULL.Read more on docs.microsoft.com.
The offset from the beginning of the file-mapping object referenced by hSection where storage for the bitmap bit values is to begin. This value is ignored if hSection is NULL. The bitmap bit values are aligned on doubleword boundaries, so dwOffset must be a multiple of the size of a DWORD.
If the function succeeds, the return value is a handle to the newly created DIB, and *ppvBits points to the bitmap bit values. If the function fails, the return value is NULL, and *ppvBits is NULL. To get extended error information, call GetLastError. GetLastError can return the following value: This doc was truncated.As noted above, if hSection is NULL, the system allocates memory for the DIB. The system closes the handle to that memory when you later delete the DIB by calling the DeleteObject function. If hSection is not NULL, you must close the hSection memory handle yourself after calling DeleteObject to delete the bitmap. You cannot paste a DIB section from one application into another application. CreateDIBSection does not use the BITMAPINFOHEADER parameters biXPelsPerMeter or biYPelsPerMeter and will not provide resolution information in the BITMAPINFO structure. You need to guarantee that the GDI subsystem has completed any drawing to a bitmap created by CreateDIBSection before you draw to the bitmap yourself. Access to the bitmap must be synchronized. Do this by calling the GdiFlush function. This applies to any use of the pointer to the bitmap bit values, including passing the pointer in calls to functions such as SetDIBits. ICM: No color management is done.Read more on docs.microsoft.com.The CreateFontIndirect function creates a logical font that has the specified characteristics. The font can subsequently be selected as the current font for any device context. (Unicode)
A pointer to a LOGFONT structure that defines the characteristics of the logical font.
If the function succeeds, the return value is a handle to a logical font. If the function fails, the return value is NULL.The CreateFontIndirect function creates a logical font with the characteristics specified in the LOGFONT structure. When this font is selected by using the SelectObject function, GDI's font mapper attempts to match the logical font with an existing physical font. If it fails to find an exact match, it provides an alternative whose characteristics match as many of the requested characteristics as possible. To get the appropriate font on different language versions of the OS, call EnumFontFamiliesEx with the desired font characteristics in the LOGFONT structure, retrieve the appropriate typeface name, and create the font using CreateFont or CreateFontIndirect. When you no longer need the font, call the DeleteObject function to delete it. The fonts for many East Asian languages have two typeface names: an English name and a localized name. CreateFont and CreateFontIndirect take the localized typeface name only on a system locale that matches the language, while they take the English typeface name on all other system locales. The best method is to try one name and, on failure, try the other. Note that EnumFonts, EnumFontFamilies, and EnumFontFamiliesEx return the English typeface name if the system locale does not match the language of the font. The font mapper for CreateFont, CreateFontIndirect, and CreateFontIndirectEx recognizes both the English and the localized typeface name, regardless of locale.Read more on docs.microsoft.com.The CreateIC function creates an information context for the specified device. (Unicode)
A pointer to a null-terminated character string that specifies the name of the device driver (for example, Epson).
A pointer to a null-terminated character string that specifies the name of the specific output device being used, as shown by the Print Manager (for example, Epson FX-80). It is not the printer model name. The lpszDevice parameter must be used.
This parameter is ignored and should be set to NULL. It is provided only for compatibility with 16-bit Windows.
A pointer to a DEVMODE structure containing device-specific initialization data for the device driver. The DocumentProperties function retrieves this structure filled in for a specified device. The lpdvmInit parameter must be NULL if the device driver is to use the default initialization (if any) specified by the user.
If the function succeeds, the return value is the handle to an information context. If the function fails, the return value is NULL.When you no longer need the information DC, call the DeleteDC function.> [!NOTE] > The wingdi.h header defines CreateIC 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).Read more on docs.microsoft.com.The CreateRectRgn function creates a rectangular region.
Specifies the x-coordinate of the upper-left corner of the region in logical units.
Specifies the y-coordinate of the upper-left corner of the region in logical units.
Specifies the x-coordinate of the lower-right corner of the region in logical units.
Specifies the y-coordinate of the lower-right corner of the region in logical units.
If the function succeeds, the return value is the handle to the region. If the function fails, the return value is NULL.When you no longer need the HRGN object, call the DeleteObject function to delete it. Region coordinates are represented as 27-bit signed integers. Regions created by the Create<shape>Rgn methods (such as CreateRectRgn and CreatePolygonRgn) only include the interior of the shape; the shape's outline is excluded from the region. This means that any point on a line between two sequential vertices is not included in the region. If you were to call PtInRegion for such a point, it would return zero as the result.Read more on docs.microsoft.com.The DeleteDC function deletes the specified device context (DC).
A handle to the device context.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.An application must not delete a DC whose handle was obtained by calling the GetDC function. Instead, it must call the ReleaseDC function to free the DC.The DeleteEnhMetaFile function deletes an enhanced-format metafile or an enhanced-format metafile handle.
A handle to an enhanced metafile.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.If the hemf parameter identifies an enhanced metafile stored in memory, the DeleteEnhMetaFile function deletes the metafile. If hemf identifies a metafile stored on a disk, the function deletes the metafile handle but does not destroy the actual metafile. An application can retrieve the file by calling the GetEnhMetaFile function.The GetClipRgn function retrieves a handle identifying the current application-defined clipping region for the specified device context.
A handle to the device context.
A handle to an existing region before the function is called. After the function returns, this parameter is a handle to a copy of the current clipping region.
If the function succeeds and there is no clipping region for the given device context, the return value is zero. If the function succeeds and there is a clipping region for the given device context, the return value is 1. If an error occurs, the return value is -1.An application-defined clipping region is a clipping region identified by the SelectClipRgn function. It is not a clipping region created when the application calls the BeginPaint function. If the function succeeds, the hrgn parameter is a handle to a copy of the current clipping region. Subsequent changes to this copy will not affect the current clipping region.Read more on docs.microsoft.com.The GetDeviceCaps function retrieves device-specific information for the specified device.
A handle to the DC.
The return value specifies the value of the desired item. When nIndex is BITSPIXEL and the device has 15bpp or 16bpp, the return value is 16.When nIndex is SHADEBLENDCAPS: This doc was truncated.Read more on docs.microsoft.com.The GetObjectW (Unicode) function (wingdi.h) retrieves information for the specified graphics object.If the function succeeds, and lpvObject is a valid pointer, the return value is the number of bytes stored into the buffer. If the function succeeds, and lpvObject is NULL, the return value is the number of bytes required to hold the information the function would store into the buffer. If the function fails, the return value is zero.The buffer pointed to by the lpvObject parameter must be sufficiently large to receive the information about the graphics object. Depending on the graphics object, the function uses a BITMAP, DIBSECTION, EXTLOGPEN, LOGBRUSH, LOGFONT, or LOGPEN structure, or a count of table entries (for a logical palette). If hgdiobj is a handle to a bitmap created by calling CreateDIBSection, and the specified buffer is large enough, the GetObject function returns a DIBSECTION structure. In addition, the bmBits member of the BITMAP structure contained within the DIBSECTION will contain a pointer to the bitmap's bit values. If hgdiobj is a handle to a bitmap created by any other means, GetObject returns only the width, height, and color format information of the bitmap. You can obtain the bitmap's bit values by calling the GetDIBits or GetBitmapBits function. If hgdiobj is a handle to a logical palette, GetObject retrieves a 2-byte integer that specifies the number of entries in the palette. The function does not retrieve the LOGPALETTE structure defining the palette. To retrieve information about palette entries, an application can call the GetPaletteEntries function. If hgdiobj is a handle to a font, the LOGFONT that is returned is the LOGFONT used to create the font. If Windows had to make some interpolation of the font because the precise LOGFONT could not be represented, the interpolation will not be reflected in the LOGFONT. For example, if you ask for a vertical version of a font that doesn't support vertical painting, the LOGFONT indicates the font is vertical, but Windows will paint it horizontally.Read more on docs.microsoft.com.The GetObjectType retrieves the type of the specified object.
A handle to the graphics object.
If the function succeeds, the return value identifies the object. This value can be one of the following. This doc was truncated.Learn more about this API from docs.microsoft.com.The GetPaletteEntries function retrieves a specified range of palette entries from the given logical palette.
A handle to the logical palette.
The first entry in the logical palette to be retrieved.
The number of entries in the logical palette to be retrieved.
A pointer to an array of PALETTEENTRY structures to receive the palette entries. The array must contain at least as many structures as specified by the nEntries parameter.
If the function succeeds and the handle to the logical palette is a valid pointer (not NULL), the return value is the number of entries retrieved from the logical palette. If the function succeeds and handle to the logical palette is NULL, the return value is the number of entries in the given palette. If the function fails, the return value is zero.An application can determine whether a device supports palette operations by calling the GetDeviceCaps function and specifying the RASTERCAPS constant. If the nEntries parameter specifies more entries than exist in the palette, the remaining members of the PALETTEENTRY structure are not altered.Read more on docs.microsoft.com.The GetRegionData function fills the specified buffer with data describing a region. This data includes the dimensions of the rectangles that make up the region.
A handle to the region.
The size, in bytes, of the lpRgnData buffer.
A pointer to a RGNDATA structure that receives the information. The dimensions of the region are in logical units. If this parameter is NULL, the return value contains the number of bytes needed for the region data.
If the function succeeds and dwCount specifies an adequate number of bytes, the return value is always dwCount. If dwCount is too small or the function fails, the return value is 0. If lpRgnData is NULL, the return value is the required number of bytes. If the function fails, the return value is zero.The GetRegionData function is used in conjunction with the ExtCreateRegion function.The GetStockObject function retrieves a handle to one of the stock pens, brushes, fonts, or palettes.If the function succeeds, the return value is a handle to the requested logical object. If the function fails, the return value is NULL.It is not recommended that you employ this method to obtain the current font used by dialogs and windows. Instead, use the SystemParametersInfo function with the SPI_GETNONCLIENTMETRICS parameter to retrieve the current font. SystemParametersInfo will take into account the current theme and provides font information for captions, menus, and message dialogs. Use the DKGRAY_BRUSH, GRAY_BRUSH, and LTGRAY_BRUSH stock objects only in windows with the CS_HREDRAW and CS_VREDRAW styles. Using a gray stock brush in any other style of window can lead to misalignment of brush patterns after a window is moved or sized. The origins of stock brushes cannot be adjusted. The HOLLOW_BRUSH and NULL_BRUSH stock objects are equivalent. It is not necessary (but it is not harmful) to delete stock objects by calling DeleteObject. Both DC_BRUSH and DC_PEN can be used interchangeably with other stock objects like BLACK_BRUSH and BLACK_PEN. For information on retrieving the current pen or brush color, see GetDCBrushColor and GetDCPenColor. See Setting the Pen or Brush Color for an example of setting colors. The GetStockObject function with an argument of DC_BRUSH or DC_PEN can be used interchangeably with the SetDCPenColor and SetDCBrushColor functions.Read more on docs.microsoft.com.The GetViewportExtEx function retrieves the x-extent and y-extent of the current viewport for the specified device context.
A handle to the device context.
A pointer to a SIZE structure that receives the x- and y-extents, in device units.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.Learn more about this API from docs.microsoft.com.The GetViewportOrgEx function retrieves the x-coordinates and y-coordinates of the viewport origin for the specified device context.
A handle to the device context.
A pointer to a POINT structure that receives the coordinates of the origin, in device units.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.Learn more about this API from docs.microsoft.com.The IntersectClipRect function creates a new clipping region from the intersection of the current clipping region and the specified rectangle.
A handle to the device context.
The x-coordinate, in logical units, of the upper-left corner of the rectangle.
The y-coordinate, in logical units, of the upper-left corner of the rectangle.
The x-coordinate, in logical units, of the lower-right corner of the rectangle.
The y-coordinate, in logical units, of the lower-right corner of the rectangle.
The return value specifies the new clipping region's type and can be one of the following values. This doc was truncated.The lower and right-most edges of the given rectangle are excluded from the clipping region. If a clipping region does not already exist then the system may apply a default clipping region to the specified HDC. A clipping region is then created from the intersection of that default clipping region and the rectangle specified in the function parameters.Read more on docs.microsoft.com.The OffsetViewportOrgEx function modifies the viewport origin for a device context using the specified horizontal and vertical offsets.
A handle to the device context.
The horizontal offset, in device units.
The vertical offset, in device units.
A pointer to a POINT structure. The previous viewport origin, in device units, is placed in this structure. If lpPoint is NULL, the previous viewport origin is not returned.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.The new origin is the sum of the current origin and the horizontal and vertical offsets.The DeleteMetaFile function deletes a Windows-format metafile or Windows-format metafile handle.
A handle to a Windows-format metafile.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.If the metafile identified by the hmf parameter is stored in memory (rather than on a disk), its content is lost when it is deleted by using the DeleteMetaFile function.The RestoreDC function restores a device context (DC) to the specified state. The DC is restored by popping state information off a stack created by earlier calls to the SaveDC function.
A handle to the DC.
The saved state to be restored. If this parameter is positive, nSavedDC represents a specific instance of the state to be restored. If this parameter is negative, nSavedDC represents an instance relative to the current state. For example, -1 restores the most recently saved state.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.Each DC maintains a stack of saved states. The SaveDC function pushes the current state of the DC onto its stack of saved states. That state can be restored only to the same DC from which it was created. After a state is restored, the saved state is destroyed and cannot be reused. Furthermore, any states saved after the restored state was created are also destroyed and cannot be used. In other words, the RestoreDC function pops the restored state (and any subsequent states) from the state information stack.The SaveDC function saves the current state of the specified device context (DC) by copying data describing selected objects and graphic modes (such as the bitmap, brush, palette, font, pen, region, drawing mode, and mapping mode) to a context stack.
A handle to the DC whose state is to be saved.
If the function succeeds, the return value identifies the saved state. If the function fails, the return value is zero.The SaveDC function can be used any number of times to save any number of instances of the DC state. A saved state can be restored by using the RestoreDC function.Read more on docs.microsoft.com.The SelectClipRgn function selects a region as the current clipping region for the specified device context.
A handle to the device context.
A handle to the region to be selected.
The return value specifies the region's complexity and can be one of the following values. This doc was truncated.Only a copy of the selected region is used. The region itself can be selected for any number of other device contexts or it can be deleted. The SelectClipRgn function assumes that the coordinates for a region are specified in device units. To remove a device-context's clipping region, specify a NULL region handle.Read more on docs.microsoft.com.The SelectObject function selects an object into the specified device context (DC). The new object replaces the previous object of the same type.
A handle to the DC.
A handle to the object to be selected. The specified object must have been created by using one of the following functions. This doc was truncated.Read more on docs.microsoft.com.If the selected object is not a region and the function succeeds, the return value is a handle to the object being replaced. If the selected object is a region and the function succeeds, the return value is one of the following values. This doc was truncated.This function returns the previously selected object of the specified type. An application should always replace a new object with the original, default object after it has finished drawing with the new object. An application cannot select a single bitmap into more than one DC at a time. ICM: If the object being selected is a brush or a pen, color management is performed.Read more on docs.microsoft.com.Closes an open object handle.
A valid handle to an open object.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. If the application is running under a debugger, the function will throw an exception if it receives either a handle value that is not valid or a pseudo-handle value. This can happen if you close a handle twice, or if you call CloseHandle on a handle returned by the FindFirstFile function instead of calling the FindClose function.The CloseHandle function closes handles to the following objects: This doc was truncated.Read more on docs.microsoft.com.Returns the locale identifier for the system locale.Note Any application that runs only on Windows Vista and later should use GetSystemDefaultLocaleName in preference to this function.Returns the locale identifier for the system default locale, identified by LOCALE_SYSTEM_DEFAULT.This function can retrieve data from custom locales. Data is not guaranteed to be the same from computer to computer or between runs of an application. If your application must persist or transmit data, see Using Persistent Locale Data.Returns the locale identifier of the current locale for the calling thread.Note This function can retrieve data that changes between releases, for example, due to a custom locale.Returns the locale identifier of the locale associated with the current thread. Windows Vista: This function can return the identifier of a custom locale. If the current thread locale is a custom locale, the function returns LOCALE_CUSTOM_DEFAULT. If the current thread locale is a supplemental custom locale, the function can return LOCALE_CUSTOM_UNSPECIFIED. All supplemental locales share this locale identifier.When an application process launches, it uses the Standards and Formats variable for the locale. For more information, see NLS Terminology. When a new thread is created in a process, it inherits the locale of the creating thread. This locale can be either the default Standards and Formats locale or a different locale set for the creating thread in a call to SetThreadLocale. GetThreadLocale and SetThreadLocale can be used to modify the locale of the new thread.Read more on docs.microsoft.com.Frees the specified global memory object and invalidates its handle.A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function. It is not safe to free memory allocated with LocalAlloc.Read more on docs.microsoft.com.If the function succeeds, the return value is NULL. If the function fails, the return value is equal to a handle to the global memory object. To get extended error information, call GetLastError.If the process examines or modifies the memory after it has been freed, heap corruption may occur or an access violation exception (EXCEPTION_ACCESS_VIOLATION) may be generated. The GlobalFree function will free a locked memory object. A locked memory object has a lock count greater than zero. The GlobalLock function locks a global memory object and increments the lock count by one. The GlobalUnlock function unlocks it and decrements the lock count by one. To get the lock count of a global memory object, use the GlobalFlags function. If an application is running under a debug version of the system, GlobalFree will issue a message that tells you that a locked object is being freed. If you are debugging the application, GlobalFree will enter a breakpoint just before freeing a locked object. This allows you to verify the intended behavior, then continue execution.Read more on docs.microsoft.com.Allocates the specified number of bytes from the heap. (GlobalAlloc)
The number of bytes to allocate. If this parameter is zero and the uFlags parameter specifies GMEM_MOVEABLE, the function returns a handle to a memory object that is marked as discarded.
If the function succeeds, the return value is a handle to the newly allocated memory object. If the function fails, the return value is NULL. To get extended error information, call GetLastError.Windows memory management does not provide a separate local heap and global heap. Therefore, the GlobalAlloc and LocalAlloc functions are essentially the same. The movable-memory flags GHND and GMEM_MOVABLE add unnecessary overhead and require locking to be used safely. They should be avoided unless documentation specifically states that they should be used. New applications should use the heap functions to allocate and manage memory unless the documentation specifically states that a global function should be used. For example, the global functions are still used with Dynamic Data Exchange (DDE), the clipboard functions, and OLE data objects. If the GlobalAlloc function succeeds, it allocates at least the amount of memory requested. If the actual amount allocated is greater than the amount requested, the process can use the entire amount. To determine the actual number of bytes allocated, use the GlobalSize function. If the heap does not contain sufficient free space to satisfy the request, GlobalAlloc returns NULL. Because NULL is used to indicate an error, virtual address zero is never allocated. It is, therefore, easy to detect the use of a NULL pointer. Memory allocated with this function is guaranteed to be aligned on an 8-byte boundary. To execute dynamically generated code, use the VirtualAlloc function to allocate memory and the VirtualProtect function to grant PAGE_EXECUTE access. To free the memory, use the GlobalFree function. It is not safe to free memory allocated with GlobalAlloc using LocalFree.Read more on docs.microsoft.com.Locks a global memory object and returns a pointer to the first byte of the object's memory block.A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function.Read more on docs.microsoft.com.If the function succeeds, the return value is a pointer to the first byte of the memory block. If the function fails, the return value is NULL. To get extended error information, call GetLastError.The internal data structures for each memory object include a lock count that is initially zero. For movable memory objects, GlobalLock increments the count by one, and the GlobalUnlock function decrements the count by one. Each successful call that a process makes to GlobalLock for an object must be matched by a corresponding call to GlobalUnlock. Locked memory will not be moved or discarded, unless the memory object is reallocated by using the GlobalReAlloc function. The memory block of a locked memory object remains locked until its lock count is decremented to zero, at which time it can be moved or discarded. Memory objects allocated with GMEM_FIXED always have a lock count of zero. For these objects, the value of the returned pointer is equal to the value of the specified handle. If the specified memory block has been discarded or if the memory block has a zero-byte size, this function returns NULL. Discarded objects always have a lock count of zero.Read more on docs.microsoft.com.Changes the size or attributes of a specified global memory object. The size can increase or decrease.A handle to the global memory object to be reallocated. This handle is returned by either the GlobalAlloc or GlobalReAlloc function.Read more on docs.microsoft.com.
The new size of the memory block, in bytes. If uFlags specifies GMEM_MODIFY, this parameter is ignored.
The reallocation options. If GMEM_MODIFY is specified, the function modifies the attributes of the memory object only (the dwBytes parameter is ignored.) Otherwise, the function reallocates the memory object. You can optionally combine GMEM_MODIFY with the following value. This doc was truncated.Read more on docs.microsoft.com.If the function succeeds, the return value is a handle to the reallocated memory object. If the function fails, the return value is NULL. To get extended error information, call GetLastError.If GlobalReAlloc reallocates a movable object, the return value is a handle to the memory object. To convert the handle to a pointer, use the GlobalLock function. If GlobalReAlloc reallocates a fixed object, the value of the handle returned is the address of the first byte of the memory block. To access the memory, a process can simply cast the return value to a pointer. If GlobalReAlloc fails, the original memory is not freed, and the original handle and pointer are still valid.Read more on docs.microsoft.com.Retrieves the current size of the specified global memory object, in bytes.A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function.Read more on docs.microsoft.com.If the function succeeds, the return value is the size of the specified global memory object, in bytes. If the specified handle is not valid or if the object has been discarded, the return value is zero. To get extended error information, call GetLastError.The size of a memory block may be larger than the size requested when the memory was allocated. To verify that the specified object's memory block has not been discarded, use the GlobalFlags function before calling GlobalSize.Read more on docs.microsoft.com.Decrements the lock count associated with a memory object that was allocated with GMEM_MOVEABLE.A handle to the global memory object. This handle is returned by either the GlobalAlloc or GlobalReAlloc function.Read more on docs.microsoft.com.If the memory object is still locked after decrementing the lock count, the return value is a nonzero value. If the memory object is unlocked after decrementing the lock count, the function returns zero and GetLastError returns NO_ERROR. If the function fails, the return value is zero and GetLastError returns a value other than NO_ERROR.The internal data structures for each memory object include a lock count that is initially zero. For movable memory objects, the GlobalLock function increments the count by one, and GlobalUnlock decrements the count by one. For each call that a process makes to GlobalLock for an object, it must eventually call GlobalUnlock. Locked memory will not be moved or discarded, unless the memory object is reallocated by using the GlobalReAlloc function. The memory block of a locked memory object remains locked until its lock count is decremented to zero, at which time it can be moved or discarded. Memory objects allocated with GMEM_FIXED always have a lock count of zero. If the specified memory block is fixed memory, this function returns TRUE. If the memory object is already unlocked, GlobalUnlock returns FALSE and GetLastError reports ERROR_NOT_LOCKED. A process should not rely on the return value to determine the number of times it must subsequently call GlobalUnlock for a memory object.Read more on docs.microsoft.com.Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count.A handle to the loaded library module. The LoadLibrary, LoadLibraryEx, GetModuleHandle, or GetModuleHandleEx function returns this handle.Read more on docs.microsoft.com.If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call the GetLastError function.The system maintains a per-process reference count for each loaded module. A module that was loaded at process initialization due to load-time dynamic linking has a reference count of one. The reference count for a module is incremented each time the module is loaded by a call to LoadLibrary. The reference count is also incremented by a call to LoadLibraryEx unless the module is being loaded for the first time and is being loaded as a data or image file. The reference count is decremented each time the FreeLibrary or FreeLibraryAndExitThread function is called for the module. When a module's reference count reaches zero or the process terminates, the system unloads the module from the address space of the process. Before unloading a library module, the system enables the module to detach from the process by calling the module's DllMain function, if it has one, with the DLL_PROCESS_DETACH value. Doing so gives the library module an opportunity to clean up resources allocated on behalf of the current process. After the entry-point function returns, the library module is removed from the address space of the current process. It is not safe to call FreeLibrary from DllMain. For more information, see the Remarks section in DllMain. Calling FreeLibrary does not affect other processes that are using the same module. Use caution when calling FreeLibrary with a handle returned by GetModuleHandle. The GetModuleHandle function does not increment a module's reference count, so passing this handle to FreeLibrary can cause a module to be unloaded prematurely. A thread that must unload the DLL in which it is executing and then terminate itself should call FreeLibraryAndExitThread instead of calling FreeLibrary and ExitThread separately. Otherwise, a race condition can occur. For details, see the Remarks section of FreeLibraryAndExitThread.Read more on docs.microsoft.com.Creates a single uninitialized object of the class associated with a specified CLSID.
The CLSID associated with the data and code that will be used to create the object.
If NULL, indicates that the object is not being created as part of an aggregate. If non-NULL, pointer to the aggregate object's IUnknown interface (the controlling IUnknown).
Context in which the code that manages the newly created object will run. The values are taken from the enumeration CLSCTX.
A reference to the identifier of the interface to be used to communicate with the object.
Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, *ppv contains the requested interface pointer. Upon failure, *ppv contains NULL.
This function can return the following values. This doc was truncated.The CoCreateInstance function provides a convenient shortcut by connecting to the class object associated with the specified CLSID, creating a default-initialized instance, and releasing the class object. As such, it encapsulates the following functionality:This doc was truncated.Read more on docs.microsoft.com.Frees all elements that can be freed in a given PROPVARIANT structure.A pointer to an initialized PROPVARIANT structure for which any deallocatable elements are to be freed. On return, all zeroes are written to the PROPVARIANT structure.Read more on docs.microsoft.com.This function returns HRESULT.At any level of indirection, NULL pointers are ignored. For example, the pvar parameter points to a PROPVARIANT structure of type VT_CF. The pclipdata member of the PROPVARIANT structure points to a CLIPDATA structure. The pClipData pointer in the CLIPDATA structure is NULL. In this example, the pClipData pointer is ignored. However, the CLIPDATA structure pointed to by the pclipdata member of the PROPVARIANT structure is freed. On return, this function writes zeroes to the specified PROPVARIANT structure, so the VT-type is VT_EMPTY. Passing NULL as the pvar parameter produces a return code of S_OK.
Note Do not use this function to initialize PROPVARIANT structures. Instead, initialize these structures using the PropVariantInit macro (defined in Propidl.h).
Read more on docs.microsoft.com.Deallocates a string allocated previously by SysAllocString, SysAllocStringByteLen, SysReAllocString, SysAllocStringLen, or SysReAllocStringLen.
The previously allocated string. If this parameter is NULL, the function simply returns.
Learn more about this API from docs.microsoft.com.Uses registry information to load a type library.
The GUID of the library.
The major version of the library.
The minor version of the library.
The national language code of the library.
The loaded type library.
This function can return one of these values. This doc was truncated.The function LoadRegTypeLib defers to LoadTypeLib to load the file.LoadRegTypeLib compares the requested version numbers against those found in the system registry, and takes one of the following actions:This doc was truncated.Read more on docs.microsoft.com.Creates a new picture object initialized according to a PICTDESC structure.
Pointer to a caller-allocated structure containing the initial state of the picture. The specified structure can be NULL to create an uninitialized object, in the event the picture needs to initialize via IPersistStream::Load.
Reference to the identifier of the interface describing the type of interface pointer to return in lplpvObj.
If TRUE, the picture object is to destroy its picture when the object is destroyed. If FALSE, the caller is responsible for destroying the picture.
Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, this parameter contains the requested interface pointer on the newly created object. If the call is successful, the caller is responsible for calling Release through this interface pointer when the new object is no longer needed. If the call fails, the value is set to NULL.
This function returns S_OK on success. Other possible values include the following. This doc was truncated.The fOwn parameter indicates whether the picture is to own the GDI picture handle for the picture it contains, so that the picture object will destroy its picture when the object itself is destroyed. The function returns an interface pointer to the new picture object specified by the caller in the riid parameter. A QueryInterface is built into this call. The caller is responsible for calling Release through the interface pointer returned.Creates a new array descriptor, allocates and initializes the data for the array, and returns a pointer to the new array descriptor.
The base type of the array (the VARTYPE of each element of the array). The VARTYPE is restricted to a subset of the variant types. Neither the VT_ARRAY nor the VT_BYREF flag can be set. VT_EMPTY and VT_NULL are not valid base types for the array. All other types are legal.
The number of dimensions in the array. The number cannot be changed after the array is created.
A vector of bounds (one for each dimension) to allocate for the array.
A safe array descriptor, or null if the array could not be created.Learn more about this API from docs.microsoft.com.Creates and returns a safe array descriptor from the specified VARTYPE, number of dimensions and bounds.
The base type or the VARTYPE of each element of the array. The FADF_RECORD flag can be set for a variant type VT_RECORD, The FADF_HAVEIID flag can be set for VT_DISPATCH or VT_UNKNOWN, and FADF_HAVEVARTYPE can be set for all other VARTYPEs.
The number of dimensions in the array.
A vector of bounds (one for each dimension) to allocate for the array.
the type information of the user-defined type, if you are creating a safe array of user-defined types. If the vt parameter is VT_RECORD, then pvExtra will be a pointer to an IRecordInfo describing the record. If the vt parameter is VT_DISPATCH or VT_UNKNOWN, then pvExtra will contain a pointer to a GUID representing the type of interface being passed to the array.
A safe array descriptor, or null if the array could not be created.If the VARTYPE is VT_RECORD then SafeArraySetRecordInfo is called. If the VARTYPE is VT_DISPATCH or VT_UNKNOWN then the elements of the array must contain interfaces of the same type. Part of the process of marshaling this array to other processes does include generating the proxy/stub code of the IID pointed to by the pvExtra parameter. To actually pass heterogeneous interfaces one will need to specify either IID_IUnknown or IID_IDispatch in pvExtra and provide some other means for the caller to identify how to query for the actual interface.Destroys an existing array descriptor and all of the data in the array.
An array descriptor created by SafeArrayCreate.
This function can return one of these values. This doc was truncated.Safe arrays of variant will have the VariantClear function called on each member and safe arrays of BSTR will have the SysFreeString function called on each element. IRecordInfo::RecordClear will be called to release object references and other values of a record without deallocating the record.Retrieves a single element of the array.
An array descriptor created by SafeArrayCreate.
A vector of indexes for each dimension of the array. The right-most (least significant) dimension is rgIndices[0]. The left-most dimension is stored at rgIndices[psa->cDims – 1].
The element of the array.
This function can return one of these values. This doc was truncated.This function calls SafeArrayLock and SafeArrayUnlock automatically, before and after retrieving the element. The caller must provide a storage area of the correct size to receive the data. If the data element is a string, object, or variant, the function copies the element in the correct way.Retrieves the IRecordInfo interface of the UDT contained in the specified safe array.
An array descriptor created by SafeArrayCreate.
The IRecordInfo interface.
This function can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Gets the VARTYPE stored in the specified safe array.
An array descriptor created by SafeArrayCreate.
The VARTYPE.
This function can return one of these values. This doc was truncated.If FADF_HAVEVARTYPE is set, SafeArrayGetVartype returns the VARTYPE stored in the array descriptor. If FADF_RECORD is set, it returns VT_RECORD; if FADF_DISPATCH is set, it returns VT_DISPATCH; and if FADF_UNKNOWN is set, it returns VT_UNKNOWN. SafeArrayGetVartype can fail to return VT_UNKNOWN for SAFEARRAY types that are based on IUnknown. Callers should additionally check whether the SAFEARRAY type's fFeatures field has the FADF_UNKNOWN flag set.Read more on docs.microsoft.com.Increments the lock count of an array, and places a pointer to the array data in pvData of the array descriptor.
An array descriptor created by SafeArrayCreate.
This function can return one of these values. This doc was truncated.The pointer in the array descriptor is valid until the SafeArrayUnlock function is called. Calls to SafeArrayLock can be nested, in which case an equal number of calls to SafeArrayUnlock are required. An array cannot be deleted while it is locked.Read more on docs.microsoft.com.Stores the data element at the specified location in the array.
An array descriptor created by SafeArrayCreate.
A vector of indexes for each dimension of the array. The right-most (least significant) dimension is rgIndices[0]. The left-most dimension is stored at rgIndices[psa->cDims – 1].
The data to assign to the array. The variant types VT_DISPATCH, VT_UNKNOWN, and VT_BSTR are pointers, and do not require another level of indirection.
This function can return one of these values. This doc was truncated.This function automatically calls SafeArrayLock and SafeArrayUnlock before and after assigning the element. If the data element is a string, object, or variant, the function copies it correctly when the safe array is destroyed. If the existing element is a string, object, or variant, it is cleared correctly. If the data element is a VT_DISPATCH or VT_UNKNOWN, AddRef is called to increment the object's reference count.
Note Multiple locks can be on an array. Elements can be put into an array while the array is locked by other operations.
For an example that demonstrates calling SafeArrayPutElement, see the COM Fundamentals Lines sample (CLines::Add in Lines.cpp).Read more on docs.microsoft.com.Decrements the lock count of an array so it can be freed or resized.
An array descriptor created by SafeArrayCreate.
This function can return one of these values. This doc was truncated.This function is called after access to the data in an array is finished.Creates a new image (icon, cursor, or bitmap) and copies the attributes of the specified image to the new one. If necessary, the function stretches the bits to fit the desired size of the new image.Type: HANDLE A handle to the image to be copied.Read more on docs.microsoft.com.
Type: UINTType: int The desired width, in pixels, of the image. If this is zero, then the returned image will have the same width as the original hImage.Read more on docs.microsoft.com.Type: int The desired height, in pixels, of the image. If this is zero, then the returned image will have the same height as the original hImage.Read more on docs.microsoft.com.
Type: UINTType: HANDLE If the function succeeds, the return value is the handle to the newly created image. If the function fails, the return value is NULL. To get extended error information, call GetLastError.When you are finished using the resource, you can release its associated memory by calling one of the functions in the following table. This doc was truncated.Read more on docs.microsoft.com.Destroys an icon and frees any memory the icon occupied.Type: HICON A handle to the icon to be destroyed. The icon must not be in use.Read more on docs.microsoft.com.Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.It is only necessary to call DestroyIcon for icons and cursors created with the following functions: CreateIconFromResourceEx (if called without the LR_SHARED flag), CreateIconIndirect, and CopyIcon. Do not use this function to destroy a shared icon. A shared icon is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared icon. This doc was truncated.Read more on docs.microsoft.com.Draws an icon or cursor into the specified device context, performing the specified raster operations, and stretching or compressing the icon or cursor as specified.Type: HDC A handle to the device context into which the icon or cursor will be drawn.Read more on docs.microsoft.com.Type: int The logical x-coordinate of the upper-left corner of the icon or cursor.Read more on docs.microsoft.com.Type: int The logical y-coordinate of the upper-left corner of the icon or cursor.Read more on docs.microsoft.com.Type: HICON A handle to the icon or cursor to be drawn. This parameter can identify an animated cursor.Read more on docs.microsoft.com.Type: int The logical width of the icon or cursor. If this parameter is zero and the diFlags parameter is DI_DEFAULTSIZE, the function uses the SM_CXICON system metric value to set the width. If this parameter is zero and DI_DEFAULTSIZE is not used, the function uses the actual resource width.Read more on docs.microsoft.com.Type: int The logical height of the icon or cursor. If this parameter is zero and the diFlags parameter is DI_DEFAULTSIZE, the function uses the SM_CYICON system metric value to set the width. If this parameter is zero and DI_DEFAULTSIZE is not used, the function uses the actual resource height.Read more on docs.microsoft.com.Type: UINT The index of the frame to draw, if hIcon identifies an animated cursor. This parameter is ignored if hIcon does not identify an animated cursor.Read more on docs.microsoft.com.Type: HBRUSH A handle to a brush that the system uses for flicker-free drawing. If hbrFlickerFreeDraw is a valid brush handle, the system creates an offscreen bitmap using the specified brush for the background color, draws the icon or cursor into the bitmap, and then copies the bitmap into the device context identified by hdc. If hbrFlickerFreeDraw is NULL, the system draws the icon or cursor directly into the device context.Read more on docs.microsoft.com.
Type: UINTType: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.The DrawIconEx function places the icon's upper-left corner at the location specified by the xLeft and yTop parameters. The location is subject to the current mapping mode of the device context. If only one of the DI_IMAGE and DI_MASK flags is set, then the corresponding bitmap is drawn with the SRCCOPYraster operation code. If both the DI_IMAGE and DI_MASK flags are set: * If the icon or cursor is a 32-bit alpha-blended icon or cursor, then the image is drawn with AC_SRC_OVERblend function and the mask is ignored. * For all other icons or cursors, the mask is drawn with the SRCANDraster operation code, and the image is drawn with the SRCINVERTraster operation code To duplicate DrawIcon (hDC, X, Y, hIcon), call DrawIconEx as follows: This doc was truncated.Read more on docs.microsoft.com.Retrieves the coordinates of a window's client area.Type: HWND A handle to the window whose client coordinates are to be retrieved.Read more on docs.microsoft.com.Type: LPRECT A pointer to a RECT structure that receives the client coordinates. The left and top members are zero. The right and bottom members contain the width and height of the window.Read more on docs.microsoft.com.Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.In conformance with conventions for the RECT structure, the bottom-right coordinates of the returned rectangle are exclusive. In other words, the pixel at (right, bottom) lies immediately outside the rectangle.The GetDC function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen.
A handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen.
If the function succeeds, the return value is a handle to the DC for the specified window's client area. If the function fails, the return value is NULL.The GetDC function retrieves a common, class, or private DC depending on the class style of the specified window. For class and private DCs, GetDC leaves the previously assigned attributes unchanged. However, for common DCs, GetDC assigns default attributes to the DC each time it is retrieved. For example, the default font is System, which is a bitmap font. Because of this, the handle to a common DC returned by GetDC does not tell you what font, color, or brush was used when the window was drawn. To determine the font, call GetTextFace. Note that the handle to the DC can only be used by a single thread at any one time. After painting with a common DC, the ReleaseDC function must be called to release the DC. Class and private DCs do not have to be released. ReleaseDC must be called from the same thread that called GetDC. The number of DCs is limited only by available memory.Read more on docs.microsoft.com.The GetDCEx function retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen.
A handle to the window whose DC is to be retrieved. If this value is NULL, GetDCEx retrieves the DC for the entire screen.
A clipping region that may be combined with the visible region of the DC. If the value of flags is DCX_INTERSECTRGN or DCX_EXCLUDERGN, then the operating system assumes ownership of the region and will automatically delete it when it is no longer needed. In this case, the application should not use or delete the region after a successful call to GetDCEx.
If the function succeeds, the return value is the handle to the DC for the specified window. If the function fails, the return value is NULL. An invalid value for the hWnd parameter will cause the function to fail.Unless the display DC belongs to a window class, the ReleaseDC function must be called to release the DC after painting. Also, ReleaseDC must be called from the same thread that called GetDCEx. The number of DCs is limited only by available memory. The function returns a handle to a DC that belongs to the window's class if CS_CLASSDC, CS_OWNDC or CS_PARENTDC was specified as a style in the WNDCLASS structure when the class was registered.Read more on docs.microsoft.com.Retrieves a handle to the desktop window. The desktop window covers the entire screen. The desktop window is the area on top of which other windows are painted.Type: HWND The return value is a handle to the desktop window.Learn more about this API from docs.microsoft.com.Retrieves a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.Type: HWND The return value is a handle to the foreground window. The foreground window can be NULL in certain circumstances, such as when a window is losing activation.Learn more about this API from docs.microsoft.com.Retrieves the count of handles to graphical user interface (GUI) objects in use by the specified process.A handle to the process. The handle must refer to a process in the current session, and must have the **PROCESS_QUERY_LIMITED_INFORMATION** access right (see [Process security and access rights](/windows/win32/procthread/process-security-and-access-rights)). If this parameter is the special value **GR_GLOBAL**, then the resource usage is reported across all processes in the current session. **Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP:** The **GR_GLOBAL** value is not supported until Windows 7 and Windows Server 2008 R2. **Windows Server 2003 and Windows XP:** The handle must have the **PROCESS_QUERY_INFORMATION** access right.Read more on docs.microsoft.com.If the function succeeds, the return value is the count of handles to GUI objects in use by the process. If no GUI objects are in use, the return value is zero. If the function fails, the return value is zero. To get extended error information, call GetLastError.A process without a graphical user interface does not use GUI resources, therefore, GetGuiResources will return zero.Read more on docs.microsoft.com.Retrieves information about the specified icon or cursor.
Type: HICONType: PICONINFO A pointer to an ICONINFO structure. The function fills in the structure's members.Read more on docs.microsoft.com.Type: BOOL If the function succeeds, the return value is nonzero and the function fills in the members of the specified ICONINFO structure. If the function fails, the return value is zero. To get extended error information, call GetLastError.GetIconInfo creates bitmaps for the hbmMask and hbmColor or members of ICONINFO. The calling application must manage these bitmaps and delete them when they are no longer necessary.
DPI Virtualization
This API does not participate in DPI virtualization. The output returned is not affected by the DPI of the calling thread.Read more on docs.microsoft.com.The GetMonitorInfo function retrieves information about a display monitor. (Unicode)
A handle to the display monitor of interest.
A pointer to a MONITORINFO or MONITORINFOEX structure that receives information about the specified display monitor. You must set the cbSize member of the structure to sizeof(MONITORINFO) or sizeof(MONITORINFOEX) before calling the GetMonitorInfo function. Doing so lets the function determine the type of structure you are passing to it. The MONITORINFOEX structure is a superset of the MONITORINFO structure. It has one additional member: a string that contains a name for the display monitor. Most applications have no use for a display monitor name, and so can save some bytes by using a MONITORINFO structure.Read more on docs.microsoft.com.If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.> [!NOTE] > The winuser.h header defines GetMonitorInfo 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).Read more on docs.microsoft.com.Retrieves the specified system metric or system configuration setting.
Type: intType: int If the function succeeds, the return value is the requested system metric or configuration setting. If the function fails, the return value is 0. GetLastError does not provide extended error information.System metrics can vary from display to display. GetSystemMetrics(SM_CMONITORS) counts only visible display monitors. This is different from EnumDisplayMonitors, which enumerates both visible display monitors and invisible pseudo-monitors that are associated with mirroring drivers. An invisible pseudo-monitor is associated with a pseudo-device used to mirror application drawing for remoting or other purposes. The SM_ARRANGE setting specifies how the system arranges minimized windows, and consists of a starting position and a direction. The starting position can be one of the following values.This doc was truncated.Read more on docs.microsoft.com.Destroys a cursor and frees any memory the cursor occupied. Do not use this function to destroy a shared cursor.Type: HCURSOR A handle to the cursor to be destroyed. The cursor must not be in use.Read more on docs.microsoft.com.Type: BOOL If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.The DestroyCursor function destroys a nonshared cursor. Do not use this function to destroy a shared cursor. A shared cursor is valid as long as the module from which it was loaded remains in memory. The following functions obtain a shared cursor: This doc was truncated.Read more on docs.microsoft.com.Loads the specified icon resource from the executable (.exe) file associated with an application instance. (Unicode)Type: HINSTANCE A handle to an instance of the module whose executable file contains the icon to be loaded. This parameter must be NULL when a standard icon is being loaded.Read more on docs.microsoft.com.Type: LPCTSTR The name of the icon resource to be loaded. Alternatively, this parameter can contain the resource identifier in the low-order word and zero in the high-order word. Use the MAKEINTRESOURCE macro to create this value.Read more on docs.microsoft.com.Type: HICON If the function succeeds, the return value is a handle to the newly loaded icon. If the function fails, the return value is NULL. To get extended error information, call GetLastError.LoadIcon loads the icon resource only if it has not been loaded; otherwise, it retrieves a handle to the existing resource. The function searches the icon resource for the icon most appropriate for the current display. The icon resource can be a color or monochrome bitmap. LoadIcon can only load an icon whose size conforms to the SM_CXICON and SM_CYICON system metric values. Use the LoadImage function to load icons of other sizes.> [!NOTE] > The winuser.h header defines LoadIcon 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).Read more on docs.microsoft.com.The MonitorFromPoint function retrieves a handle to the display monitor that contains a specified point.
A POINT structure that specifies the point of interest in virtual-screen coordinates.
Determines the function's return value if the point is not contained within any display monitor.
If the point is contained by a display monitor, the return value is an HMONITOR handle to that display monitor. If the point is not contained by a display monitor, the return value depends on the value of dwFlags.Learn more about this API from docs.microsoft.com.The MonitorFromRect function retrieves a handle to the display monitor that has the largest area of intersection with a specified rectangle.
A pointer to a RECT structure that specifies the rectangle of interest in virtual-screen coordinates.
Determines the function's return value if the rectangle does not intersect any display monitor.
If the rectangle intersects one or more display monitor rectangles, the return value is an HMONITOR handle to the display monitor that has the largest area of intersection with the rectangle. If the rectangle does not intersect a display monitor, the return value depends on the value of dwFlags.Learn more about this API from docs.microsoft.com.The MonitorFromWindow function retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window.
A handle to the window of interest.
Determines the function's return value if the window does not intersect any display monitor.
If the window intersects one or more display monitor rectangles, the return value is an HMONITOR handle to the display monitor that has the largest area of intersection with the window. If the window does not intersect a display monitor, the return value depends on the value of dwFlags.If the window is currently minimized, MonitorFromWindow uses the rectangle of the window before it was minimized.The ReleaseDC function releases a device context (DC), freeing it for use by other applications. The effect of the ReleaseDC function depends on the type of DC. It frees only common and window DCs. It has no effect on class or private DCs.
A handle to the window whose DC is to be released.
A handle to the DC to be released.
The return value indicates whether the DC was released. If the DC was released, the return value is 1. If the DC was not released, the return value is zero.The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common DC. An application cannot use the ReleaseDC function to release a DC that was created by calling the CreateDC function; instead, it must use the DeleteDC function. ReleaseDC must be called from the same thread that called GetDC.Read more on docs.microsoft.com.Retrieves or sets the value of one of the system-wide parameters. (Unicode)Type: UINT The system-wide parameter to be retrieved or set. The possible values are organized in the following tables of related parameters: This doc was truncated.Read more on docs.microsoft.com.Type: UINT A parameter whose usage and format depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter.Read more on docs.microsoft.com.Type: PVOID A parameter whose usage and format depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify NULL for this parameter. For information on the PVOID datatype, see Windows Data Types.Read more on docs.microsoft.com.Type: UINT If a system parameter is being set, specifies whether the user profile is to be updated, and if so, whether the WM_SETTINGCHANGE message is to be broadcast to all top-level windows to notify them of the change.Read more on docs.microsoft.com.Type: BOOL If the function succeeds, the return value is a nonzero value. If the function fails, the return value is zero. To get extended error information, call GetLastError.This function is intended for use with applications that allow the user to customize the environment. A keyboard layout name should be derived from the hexadecimal value of the language identifier corresponding to the layout. For example, U.S. English has a language identifier of 0x0409, so the primary U.S. English layout is named "00000409". Variants of U.S. English layout, such as the Dvorak layout, are named "00010409", "00020409" and so on. For a list of the primary language identifiers and sublanguage identifiers that make up a language identifier, see the MAKELANGID macro. There is a difference between the High Contrast color scheme and the High Contrast Mode. The High Contrast color scheme changes the system colors to colors that have obvious contrast; you switch to this color scheme by using the Display Options in the control panel. The High Contrast Mode, which uses SPI_GETHIGHCONTRAST and SPI_SETHIGHCONTRAST, advises applications to modify their appearance for visually-impaired users. It involves such things as audible warning to users and customized color scheme (using the Accessibility Options in the control panel). For more information, see HIGHCONTRAST. For more information on general accessibility features, see Accessibility. During the time that the primary button is held down to activate the Mouse ClickLock feature, the user can move the mouse. After the primary button is locked down, releasing the primary button does not result in a WM_LBUTTONUP message. Thus, it will appear to an application that the primary button is still down. Any subsequent button message releases the primary button, sending a WM_LBUTTONUP message to the application, thus the button can be unlocked programmatically or through the user clicking any button. This API is not DPI aware, and should not be used if the calling thread is per-monitor DPI aware. For the DPI-aware version of this API, see SystemParametersInfoForDPI. For more information on DPI awareness, see the Windows High DPI documentation.Read more on docs.microsoft.com.Retrieves the value of one of the system-wide parameters, taking into account the provided DPI value.
The system-wide parameter to be retrieved. This function is only intended for use with SPI_GETICONTITLELOGFONT, SPI_GETICONMETRICS, or SPI_GETNONCLIENTMETRICS. See SystemParametersInfo for more information on these values.
A parameter whose usage and format depends on the system parameter being queried. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter.
A parameter whose usage and format depends on the system parameter being queried. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify NULL for this parameter. For information on the PVOID datatype, see Windows Data Types.
Has no effect for with this API. This parameter only has an effect if you're setting parameter.
The DPI to use for scaling the metric.
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.This function returns a similar result as SystemParametersInfo, but scales it according to an arbitrary DPI you provide (if appropriate). It only scales with the following possible values for uiAction: SPI_GETICONTITLELOGFONT, SPI_GETICONMETRICS, SPI_GETNONCLIENTMETRICS. Other possible uiAction values do not provide ForDPI behavior, and therefore this function returns 0 if called with them. For uiAction values that contain strings within their associated structures, only Unicode (LOGFONTW) strings are supported in this function.Read more on docs.microsoft.com.The WindowFromDC function returns a handle to the window associated with the specified display device context (DC). Output functions that use the specified device context draw into this window.
Handle to the device context from which a handle to the associated window is to be retrieved.
The return value is a handle to the window associated with the specified DC. If no window is associated with the specified DC, the return value is NULL.Learn more about this API from docs.microsoft.com.
Create an interface table for the given interface.
Create an interface table for the given interfaces.
Create an interface table for the given interfaces.
Create an interface table for the given interfaces.
Create an interface table for the given interfaces.
Create an interface table for the given interfaces.
Create an interface table for the given interfaces.
Create an interface table for the given interfaces.
Returns HRESULT.STG_E_INVALIDFUNCTION as a documented way to say we don't support locking
Returns HRESULT.STG_E_INVALIDFUNCTION as a documented way to say we don't support locking
The CY structure is useful for calculations involving money, or for any fixed-point calculation where accuracy is particularly important.
Used to flag that the COM object is a generated object.
Get the specified property.
Get the specified property.
Get the specified property.
Get the specified property.
Retrieves the number of type information interfaces that an object provides (either 0 or 1).
The number of type information interfaces provided by the object. If the object provides type information, this number is 1; otherwise the number is 0.
This method can return one of these values. This doc was truncated.The method may return zero, which indicates that the object does not provide any type information. In this case, the object may still be programmable through IDispatch or a VTBL, but does not provide run-time type information for browsers, compilers, or other programming tools that access type information. This can be useful for hiding an object from browsers.Retrieves the type information for an object, which can then be used to get the type information for an interface.
The type information to return. Pass 0 to retrieve type information for the IDispatch implementation.
The locale identifier for the type information. An object may be able to return different type information for different languages. This is important for classes that support localized member names. For classes that do not support localized member names, this parameter can be ignored.
The requested type information object.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Maps a single member and an optional set of argument names to a corresponding set of integer DISPIDs, which can be used on subsequent calls to Invoke.
Reserved for future use. Must be IID_NULL.
The array of names to be mapped.
The count of the names to be mapped.
The locale context in which to interpret the names.
Caller-allocated array, each element of which contains an identifier (ID) corresponding to one of the names passed in the rgszNames array. The first element represents the member name. The subsequent elements represent each of the member's parameters.
This method can return one of these values. This doc was truncated.An IDispatch implementation can associate any positive integer ID value with a given name. Zero is reserved for the default, or Value property; –1 is reserved to indicate an unknown name; and other negative values are defined for other purposes. For example, if GetIDsOfNames is called, and the implementation does not recognize one or more of the names, it returns DISP_E_UNKNOWNNAME, and the rgDispId array contains DISPID_UNKNOWN for the entries that correspond to the unknown names. The member and parameter DISPIDs must remain constant for the lifetime of the object. This allows a client to obtain the DISPIDs once, and cache them for later use. When GetIDsOfNames is called with more than one name, the first name (rgszNames[0]) corresponds to the member name, and subsequent names correspond to the names of the member's parameters. The same name may map to different DISPIDs, depending on context. For example, a name may have a DISPID when it is used as a member name with a particular interface, a different ID as a member of a different interface, and different mapping for each time it appears as a parameter. GetIDsOfNames is used when an IDispatch client binds to names at run time. To bind at compile time instead, an IDispatch client can map names to DISPIDs by using the type information interfaces described in Type Description Interfaces. This allows a client to bind to members at compile time and avoid calling GetIDsOfNames at run time. For a description of binding at compile time, see Type Description Interfaces. The implementation of GetIDsOfNames is case insensitive. Users that need case-sensitive name mapping should use type information interfaces to map names to DISPIDs, rather than call GetIDsOfNames.
Caution You cannot use this method to access values that have been added dynamically, such as values added through JavaScript. Instead, use the GetDispID of the IDispatchEx interface. For more information, see the IDispatchEx interface.
Read more on docs.microsoft.com.Provides access to properties and methods exposed by an object.
Identifies the member. Use GetIDsOfNames or the object's documentation to obtain the dispatch identifier.
Reserved for future use. Must be IID_NULL.
The locale context in which to interpret arguments. The lcid is used by the GetIDsOfNames function, and is also passed to Invoke to allow the object to interpret its arguments specific to a locale. Applications that do not support multiple national languages can ignore this parameter. For more information, refer to Supporting Multiple National Languages and Exposing ActiveX Objects.Read more on docs.microsoft.com.Flags describing the context of the Invoke call. This doc was truncated.Read more on docs.microsoft.com.
Pointer to a DISPPARAMS structure containing an array of arguments, an array of argument DISPIDs for named arguments, and counts for the number of elements in the arrays.
Pointer to the location where the result is to be stored, or NULL if the caller expects no result. This argument is ignored if DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF is specified.
Pointer to a structure that contains exception information. This structure should be filled in if DISP_E_EXCEPTION is returned. Can be NULL.
The index within rgvarg of the first argument that has an error. Arguments are stored in pDispParams->rgvarg in reverse order, so the first argument is the one with the highest index in the array. This parameter is returned only when the resulting return value is DISP_E_TYPEMISMATCH or DISP_E_PARAMNOTFOUND. This argument can be set to null. For details, see Returning Errors.
This method can return one of these values. This doc was truncated.Generally, you should not implement Invoke directly. Instead, use the dispatch interface to create functions CreateStdDispatch and DispInvoke. For details, refer to CreateStdDispatch, DispInvoke, Creating the IDispatch Interface and Exposing ActiveX Objects. If some application-specific processing needs to be performed before calling a member, the code should perform the necessary actions, and then call ITypeInfo::Invoke to invoke the member. ITypeInfo::Invoke acts exactly like Invoke. The standard implementations of Invoke created by CreateStdDispatch and DispInvoke defer to ITypeInfo::Invoke. In an ActiveX client, Invoke should be used to get and set the values of properties, or to call a method of an ActiveX object. The dispIdMember argument identifies the member to invoke. The DISPIDs that identify members are defined by the implementer of the object and can be determined by using the object's documentation, the IDispatch::GetIDsOfNames function, or the ITypeInfo interface. When you use IDispatch::Invoke() with DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF, you have to specially initialize the cNamedArgs and rgdispidNamedArgs elements of your DISPPARAMS structure with the following:This doc was truncated.Read more on docs.microsoft.com.The IID guid for this interface.{00020400-0000-0000-c000-000000000046}
An interface that provides a COM callable wrapper for the implementing class. The implementing class should not
be public and unsealed as it can be derived from and COM interfaces can be added. This is meant to be a fixed
set of interfaces.
NET CCWs generated by built-in COM interop always support IMarshal, ISupportErrorInfo, IDispatchEx,
IProvideClassInfo, and IConnectionPointContainer. They also usually expose IAgileObject. On Exception objects
the CCW also supports IErrorInfo. These must explicitly be provided with this mechanism.
.NET Framework also supported the following interfaces, which are not implemented on .NET Core:
IManagedObject - used .NET Remoting (not available on .NET Core)IObjectSafety - for Code Access Security (not available on .NET Core)IWeakReferenceSource - for WinRTICustomPropertyProvider - for WinRT XAML (Jupiter)IReferenceTrackerTarget - for WinRTIStringable - for WinRT
Apply to a class to apply a COM callable wrapper of the given . The class
must also derive from the given COM wrapper struct's nested Interface.
Apply to a class to apply a COM callable wrapper of the given and .
The class must also derive from both of the given COM wrapper struct's nested Interface.
Apply to a class to apply a COM callable wrapper of the given interfaces. The class must also derive from the
given COM wrapper structs' nested Interfaces.
Apply to a class to apply a COM callable wrapper of the given interfaces. The class must also derive from the
given COM wrapper structs' nested Interfaces.
Apply to a class to apply a COM callable wrapper of the given interfaces. The class must also derive from the
given COM wrapper structs' nested Interfaces.
Apply to a class to apply a COM callable wrapper of the given interfaces. The class must also derive from the
given COM wrapper structs' nested Interfaces.
Apply to a class to apply a COM callable wrapper of the given interfaces. The class must also derive from the
given COM wrapper structs' nested Interfaces.
Apply to a class to apply a COM callable wrapper of the given interfaces. The class must also derive from the
given COM wrapper structs' nested Interfaces.
Retrieves a TYPEATTR structure that contains the attributes of the type description.
The attributes of this type description.
This method can return one of these values. This doc was truncated.To free the TYPEATTR structure, use ITypeInfo::ReleaseTypeAttr.Retrieves the ITypeComp interface for the type description, which enables a client compiler to bind to the type description's members.
The ITypeComp of the containing type library.
This method can return one of these values. This doc was truncated.A client compiler can use the ITypeComp interface to bind to members of the type.Retrieves the FUNCDESC structure that contains information about a specified function.
The index of the function whose description is to be returned. The index should be in the range of 0 to 1 less than the number of functions in this type.
A FUNCDESC structure that describes the specified function.
This method can return one of these values. This doc was truncated.The function ITypeInfo::GetFuncDesc provides access to a FUNCDESC structure that describes the function with the specified index. The FUNCDESC structure should be freed with ITypeInfo::ReleaseFuncDesc. The number of functions in the type is one of the attributes contained in the TYPEATTR structure.Retrieves a VARDESC structure that describes the specified variable.
The index of the variable whose description is to be returned. The index should be in the range of 0 to 1 less than the number of variables in this type.
A VARDESC that describes the specified variable.
This method can return one of these values. This doc was truncated.To free the VARDESC structure, use ReleaseVarDesc.Retrieves the variable with the specified member ID or the name of the property or method and the parameters that correspond to the specified function ID.
The ID of the member whose name (or names) is to be returned.
The caller-allocated array. On return, each of the elements contains the name (or names) associated with the member.
The length of the passed-in rgBstrNames array.
The number of names in the rgBstrNames array.
This method can return one of these values. This doc was truncated.The caller must release the returned BSTR array.If the member ID identifies a property that is implemented with property functions, the property name is returned. For property get functions, the names of the function and its parameters are always returned.For property put and put reference functions, the right side of the assignment is unnamed. If cMaxNames is less than is required to return all of the names of the parameters of a function, then only the names of the first cMaxNames - 1 parameters are returned. The names of the parameters are returned in the array in the same order that they appear elsewhere in the interface (for example, the same order in the parameter array associated with the FUNCDESC enumeration).If the type description inherits from another type description, this function is recursive to the base type description, if necessary, to find the item with the requested member ID.Read more on docs.microsoft.com.If a type description describes a COM class, it retrieves the type description of the implemented interface types.
The index of the implemented type whose handle is returned. The valid range is 0 to the cImplTypes field in the TYPEATTR structure.
A handle for the implemented interface (if any). This handle can be passed to ITypeInfo::GetRefTypeInfo to get the type description.
This method can return one of these values. This doc was truncated.If the TKIND_DISPATCH type description is for a dual interface, the TKIND_INTERFACE type description can be obtained by calling GetRefTypeOfImplType with an index of –1, and by passing the returned pRefTypehandle to GetRefTypeInfo to retrieve the type information.Retrieves the IMPLTYPEFLAGS enumeration for one implemented interface or base interface in a type description.
The index of the implemented interface or base interface for which to get the flags.
The IMPLTYPEFLAGS enumeration value.
This method can return one of these values. This doc was truncated.The flags are associated with the act of inheritance, and not with the inherited interface.Maps between member names and member IDs, and parameter names and parameter IDs.
An array of names to be mapped.
The count of the names to be mapped.
Caller-allocated array in which name mappings are placed.
This method can return one of these values. This doc was truncated.The function GetIDsOfNames maps the name of a member (rgszNames[0]) and its parameters (rgszNames[1] ...rgszNames[cNames- 1]) to the ID of the member (pMemId[0]), and to the IDs of the specified parameters (pMemId[1] ... pMemId[cNames- 1]). The IDs of parameters are 0 for the first parameter in the member function's argument list, 1 for the second, and so on.If the type description inherits from another type description, this function is recursive to the base type description, if necessary, to find the item with the requested member ID.Read more on docs.microsoft.com.Invokes a method, or accesses a property of an object, that implements the interface described by the type description.
An instance of the interface described by this type description.
The interface member.
Flags describing the context of the invoke call. This doc was truncated.Read more on docs.microsoft.com.
An array of arguments, an array of DISPIDs for named arguments, and counts of the number of elements in each array.
The result. Should be null if the caller does not expect any result. If wFlags specifies DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF, pVarResultis is ignored.
An exception information structure, which is filled in only if DISP_E_EXCEPTION is returned. If pExcepInfo is null on input, only an HRESULT error will be returned.
If Invoke returns DISP_E_TYPEMISMATCH, puArgErr indicates the index (within rgvarg) of the argument with incorrect type. If more than one argument returns an error, puArgErr indicates only the first argument with an error. Arguments in pDispParams->rgvarg appear in reverse order, so the first argument is the one having the highest index in the array. This parameter cannot be null.
This doc was truncated.Use the function ITypeInfo::Invoke to access a member of an object or invoke a method that implements the interface described by this type description. For objects that support the IDispatch interface, you can use Invoke to implement IDispatch::Invoke.ITypeInfo::Invoke takes a pointer to an instance of the class. Otherwise, its parameters are the same as IDispatch::Invoke, except that ITypeInfo::Invoke omits the refiid and lcid parameters. When called, ITypeInfo::Invoke performs the actions described by the IDispatch::Invoke parameters on the specified instance.For VTBL interface members, ITypeInfo::Invoke passes the LCID of the type information into parameters tagged with the lcid attribute, and the returned value into the retval attribute.If the type description inherits from another type description, this function recurses on the base type description to find the item with the requested member ID.Read more on docs.microsoft.com.Retrieves the documentation string, the complete Help file name and path, and the context ID for the Help topic for a specified type description.
The ID of the member whose documentation is to be returned.
The name of the specified item. If the caller does not need the item name, pBstrName can be null.
The documentation string for the specified item. If the caller does not need the documentation string, pBstrDocString can be null.
The Help localization context. If the caller does not need the Help context, it can be null.
The fully qualified name of the file containing the DLL used for Help file. If the caller does not need the file name, it can be null.
This method can return one of these values. This doc was truncated.The function GetDocumentation provides access to the documentation for the member specified by the memid parameter. If the passed-in memid is MEMBERID_NIL, then the documentation for the type description is returned.If the type description inherits from another type description, this function is recursive to the base type description, if necessary, to find the item with the requested member ID.The caller should use SysFreeString to free the BSTRs referenced by pBstrName, pBstrDocString, and pBstrHelpFile.Read more on docs.microsoft.com.Retrieves a description or specification of an entry point for a function in a DLL.
The ID of the member function whose DLL entry description is to be returned.
The kind of member identified by memid. This is important for properties, because one memid can identify up to three separate functions.
If not null, the function sets pBstrDllName to the name of the DLL.
If not null, the function sets pBstrName to the name of the entry point. If the entry point is specified by an ordinal, this argument is null.
If not null, and if the function is defined by an ordinal, the function sets pwOrdinal to the ordinal.
This method can return one of these values. This doc was truncated.The caller passes in a member ID, which represents the member function whose entry description is desired. If the function has a DLL entry point, the name of the DLL that contains the function, as well as its name or ordinal identifier, are placed in the passed-in pointers allocated by the caller. If there is no DLL entry point for the function, an error is returned.If the type description inherits from another type description, this function is recursive to the base type description, if necessary, to find the item with the requested member ID.The caller should use SysFreeString to free the BSTRs referenced by pBstrName and pBstrDllName.Read more on docs.microsoft.com.If a type description references other type descriptions, it retrieves the referenced type descriptions.
A handle to the referenced type description to return.
The referenced type description.
This method can return one of these values. This doc was truncated.On return, the second parameter contains a pointer to a pointer to a type description that is referenced by this type description. A type description must have a reference to each type description that occurs as the type of any of its variables, function parameters, or function return types. For example, if the type of a data member is a record type, the type description for that data member contains the hRefType of a referenced type description. To get a pointer to the type description, the reference is passed to GetRefTypeInfo.Retrieves the addresses of static functions or variables, such as those defined in a DLL.
The member ID of the static member whose address is to be retrieved. The member ID is defined by the DISPID.
Indicates whether the member is a property, and if so, what kind.
The static member.
This method can return one of these values. This doc was truncated.The addresses are valid until the caller releases its reference to the type description. The invKind parameter can be ignored unless the address of a property function is being requested. If the type description inherits from another type description, this function is recursive to the base type description, if necessary, to find the item with the requested member ID.Read more on docs.microsoft.com.Creates a new instance of a type that describes a component object class (coclass).
The controlling IUnknown. If Null, then a stand-alone instance is created. If valid, then an aggregate object is created.
An ID for the interface that the caller will use to communicate with the resulting object.
An instance of the created object.
This doc was truncated.For types that describe a component object class (coclass), CreateInstance creates a new instance of the class. Normally, CreateInstance calls CoCreateInstance with the type description's GUID. For an Application object, it first calls GetActiveObject. If the application is active, GetActiveObject returns the active object; otherwise, if GetActiveObject fails, CreateInstance calls CoCreateInstance.Retrieves marshaling information.
The member ID that indicates which marshaling information is needed.
The opcode string used in marshaling the fields of the structure described by the referenced type description, or null if there is no information to return.
This method can return one of these values. This doc was truncated.If the passed-in member ID is MEMBERID_NIL, the function returns the opcode string for marshaling the fields of the structure described by the type description. Otherwise, it returns the opcode string for marshaling the function specified by the index.If the type description inherits from another type description, this function recurses on the base type description, if necessary, to find the item with the requested member ID.Read more on docs.microsoft.com.Retrieves the containing type library and the index of the type description within that type library.
The containing type library.
The index of the type description within the containing type library.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Releases a TYPEATTR previously returned by ITypeInfo::GetTypeAttr.
The TYPEATTR to be freed.
Learn more about this API from docs.microsoft.com.Releases a FUNCDESC previously returned by ITypeInfo::GetFuncDesc.
The FUNCDESC to be freed.
Learn more about this API from docs.microsoft.com.Releases a VARDESC previously returned by ITypeInfo::GetVarDesc.
The VARDESC to be freed.
Learn more about this API from docs.microsoft.com.The IID guid for this interface.{00020401-0000-0000-c000-000000000046}Increments the reference count for an interface pointer to a COM object. You should call this method whenever you make a copy of an interface pointer.The method returns the new reference count. This value is intended to be used only for test purposes.A COM object uses a per-interface reference-counting mechanism to ensure that the object doesn't outlive references to it. You use **AddRef** to stabilize a copy of an interface pointer. It can also be called when the life of a cloned pointer must extend beyond the lifetime of the original pointer. The cloned pointer must be released by calling [IUnknown::Release](/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(refiid_void)) on it. The internal reference counter that **AddRef** maintains should be a 32-bit unsigned integer.Read more on docs.microsoft.com.Decrements the reference count for an interface on a COM object.The method returns the new reference count. This value is intended to be used only for test purposes.When the reference count on an object reaches zero, **Release** must cause the interface pointer to free itself. When the released pointer is the only (formerly) outstanding reference to an object (whether the object supports single or multiple interfaces), the implementation must free the object. Note that aggregation of objects restricts the ability to recover interface pointers.Read more on docs.microsoft.com.The IID guid for this interface.{00000000-0000-0000-c000-000000000046}Represents a safe array.The array rgsabound is stored with the left-most dimension in rgsabound[0] and the right-most dimension in rgsabound[cDims - 1]. If an array was specified in a C-like syntax as a [2][5], it would have two elements in the rgsabound vector. Element 0 has an lLbound of 0 and a cElements of 2. Element 1 has an lLbound of 0 and a cElements of 5.The fFeatures flags describe attributes of an array that can affect how the array is released. The fFeatures field describes what type of data is stored in the SAFEARRAY and how the array is allocated. This allows freeing the array without referencing its containing variant.Read more on docs.microsoft.com.
Gets the of the .
Creates an empty one-dimensional SAFEARRAY of type .
The number of dimensions.Flags. This doc was truncated.Read more on docs.microsoft.com.The size of an array element.The number of times the array has been locked without a corresponding unlock.The data.One bound for each dimension.Computes the amount of memory that must be allocated to store this struct, including the specified number of elements in the variable length inline array at the end.
Helper to scope lifetime of a created via
Destroys the (if any) when disposed. Note that this scope currently only works for a one dimensional .
Use in a statement to ensure the gets disposed.
If the you are intending to scope the lifetime of has type ,
use for better usability.
A copy will be made of anything that is put into the
and anything the gives out is a copy and has been add ref appropriately if applicable.
Be sure to dispose of items that are given to the if necessary. All
items given out by the should be disposed.
Untyped representation of CA* typed arrays in Windows. , etc.
Retrieves a specified number of STATSTG structures, that follow in the enumeration sequence.
The number of STATSTG structures requested.
An array of STATSTG structures returned.
The number of STATSTG structures retrieved in the rgelt parameter.
This method supports the following return values: This doc was truncated.Learn more about this API from docs.microsoft.com.Skips a specified number of STATSTG structures in the enumeration sequence.
The number of STATSTG structures to skip.
This method supports the following return values: | Return code | Description | |----------------|---------------| | S_OK | The specified number of **STATSTG** structures that were successfully skipped. | | S_FALSE | The number of **STATSTG** structures skipped is less than the *celt* parameter. |Learn more about this API from docs.microsoft.com.Resets the enumeration sequence to the beginning of the STATSTG structure array.This method supports the S_OK return value. This doc was truncated.Learn more about this API from docs.microsoft.com.Creates a new enumerator that contains the same enumeration state as the current STATSTG structure enumerator.A pointer to the variable that receives the IEnumSTATSTG interface pointer. If the method is unsuccessful, the value of the ppenum parameter is undefined.Read more on docs.microsoft.com.This method supports the following return values. This doc was truncated.Learn more about this API from docs.microsoft.com.The IID guid for this interface.{0000000d-0000-0000-c000-000000000046}Creates and opens a stream object with the specified name contained in this storage object.
A pointer to a wide character null-terminated Unicode string that contains the name of the newly created stream. The name can be used later to open or reopen the stream. The name must not exceed 31 characters in length, not including the string terminator. The 000 through 01f characters, serving as the first character of the stream/storage name, are reserved for use by OLE. This is a compound file restriction, not a structured storage restriction.
Specifies the access mode to use when opening the newly created stream. For more information and descriptions of the possible values, see STGM Constants.
Reserved for future use; must be zero.
Reserved for future use; must be zero.
On return, pointer to the location of the new IStream interface pointer. This is only valid if the operation is successful. When an error occurs, this parameter is set to NULL.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The new stream was successfully created.| |E_PENDING | Asynchronous Storage only: Part or all of the necessary data is currently unavailable. | |STG_E_ACCESSDENIED | Not enough permissions to create stream.| |STG_E_FILEALREADYEXISTS | The name specified for the stream already exists in the storage object and the *grfMode* parameter includes the value STGM_FAILIFTHERE.| |STG_E_INSUFFICIENTMEMORY | The stream was not created due to a lack of memory.| |STG_E_INVALIDFLAG | The value specified for the *grfMode* parameter is not a valid **STGM** constants value.| |STG_E_INVALIDFUNCTION | The specified combination of flags in the *grfMode* parameter is not supported; for example, when this method is called without the STGM_SHARE_EXCLUSIVE flag.| |STG_E_INVALIDNAME | Invalid value for *pwcsName*.| |STG_E_INVALIDPOINTER | The pointer specified for the stream object was invalid.| |STG_E_INVALIDPARAMETER | One of the parameters was invalid.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.| |STG_E_TOOMANYOPENFILES | The stream was not created because there are too many open files.|If a stream with the name specified in the pwcsName parameter already exists and the grfMode parameter includes the STGM_CREATE flag, the existing stream is replaced by a newly created one. Both the destruction of the old stream and the creation of the new stream object are subject to the transaction mode on the parent storage object. The COM-provided compound file implementation of the IStorage::CreateStream method does not support the following behaviors: This doc was truncated.Read more on docs.microsoft.com.Opens an existing stream object within this storage object in the specified access mode.
A pointer to a wide character null-terminated Unicode string that contains the name of the stream to open. The 000 through 01f characters, serving as the first character of the stream/storage name, are reserved for use by OLE. This is a compound file restriction, not a structured storage restriction.
Reserved for future use; must be NULL.
Specifies the access mode to be assigned to the open stream. For more information and descriptions of possible values, see STGM Constants. Other modes you choose must at least specify STGM_SHARE_EXCLUSIVE when calling this method in the compound file implementation.
Reserved for future use; must be zero.
A pointer to IStream pointer variable that receives the interface pointer to the newly opened stream object. If an error occurs, *ppstm must be set to NULL.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The stream was successfully opened.| |E_PENDING | Asynchronous Storage only: Part or all of the stream data is currently unavailable. | |STG_E_ACCESSDENIED | Not enough permissions to open stream.| |STG_E_FILENOTFOUND | The stream with specified name does not exist.| |STG_E_INSUFFICIENTMEMORY | The stream was not opened due to a lack of memory.| |STG_E_INVALIDFLAG | The value specified for the *grfMode* parameter is not a valid **STGM** constants value.| |STG_E_INVALIDFUNCTION | The specified combination of flags in the *grfMode* parameter is not supported; for example, when this method is called without the STGM_SHARE_EXCLUSIVE flag.| |STG_E_INVALIDNAME | Invalid value for *pwcsName*.| |STG_E_INVALIDPOINTER | The pointer specified for the stream object was not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.| |STG_E_TOOMANYOPENFILES | The stream was not opened because there are too many open files.|IStorage::OpenStream opens an existing stream object within this storage object in the access mode specified in grfMode. There are restrictions on the permissions that can be given in grfMode. For example, the permissions on this storage object restrict the permissions on its streams. In general, access restrictions on streams need to be stricter than those on their parent storages. Compound-file streams must be opened with STGM_SHARE_EXCLUSIVE.Opens an existing storage object with the specified name in the specified access mode.
A pointer to a wide character null-terminated Unicode string that contains the name of the storage object to open. The 000 through 01f characters, serving as the first character of the stream/storage name, are reserved for use by OLE. This is a compound file restriction, not a structured storage restriction. It is ignored if pstgPriority is non-NULL.
Must be NULL. A non-NULL value will return STG_E_INVALIDPARAMETER.
Specifies the access mode to use when opening the storage object. For descriptions of the possible values, see STGM Constants. Other modes you choose must at least specify STGM_SHARE_EXCLUSIVE when calling this method.
Must be NULL. A non-NULL value will return STG_E_INVALIDPARAMETER.
Reserved for future use; must be zero.
When successful, pointer to the location of an IStorage pointer to the opened storage object. This parameter is set to NULL if an error occurs.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The storage object was opened successfully.| |E_PENDING | Asynchronous Storage only: Part or all of the storage's data is currently unavailable. | |STG_E_ACCESSDENIED | Not enough permissions to open storage object.| |STG_E_FILENOTFOUND | The storage object with the specified name does not exist.| |STG_E_INSUFFICIENTMEMORY | The storage object was not opened due to a lack of memory.| |STG_E_INVALIDFLAG | The value specified for the *grfMode* parameter is not a valid **STGM** constants value.| |STG_E_INVALIDFUNCTION | The specified combination of flags in the *grfMode* parameter is not supported.| |STG_E_INVALIDNAME | Not a valid value for *pwcsName*.| |STG_E_INVALIDPOINTER | The pointer specified for the storage object was not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.| |STG_E_TOOMANYOPENFILES | The storage object was not created because there are too many open files.| |STG_S_CONVERTED | The existing stream with the specified name was replaced with a new storage object containing a single stream called CONTENTS. In direct mode, the new storage is immediately written to disk. In transacted mode, the new storage is written to a temporary storage in memory and later written to disk when it is committed.|If the pstgPriority parameter is NULL, it is ignored. If the pstgPriority parameter is not NULL, it is an IStorage pointer to a previous opening of an element of the storage object, usually one that was opened in priority mode. The storage object should be closed and reopened according to grfMode. When the IStorage::OpenStorage method returns, pstgPriority is no longer valid. Use the value supplied in the ppstg parameter. Storage objects can be opened with STGM_DELETEONRELEASE, in which case the object is destroyed when it receives its final release. This is useful for creating temporary storage objects.Read more on docs.microsoft.com.Copies the entire contents of an open storage object to another storage object.
The number of elements in the array pointed to by rgiidExclude. If rgiidExclude is NULL, then ciidExclude is ignored.
An array of interface identifiers (IIDs) that either the caller knows about and does not want copied or that the storage object does not support, but whose state the caller will later explicitly copy. The array can include IStorage, indicating that only stream objects are to be copied, and IStream, indicating that only storage objects are to be copied. An array length of zero indicates that only the state exposed by the IStorage object is to be copied; all other interfaces on the object are to be ignored. Passing NULL indicates that all interfaces on the object are to be copied.Read more on docs.microsoft.com.A string name block (refer to SNB) that specifies a block of storage or stream objects that are not to be copied to the destination. These elements are not created at the destination. If IID_IStorage is in the rgiidExclude array, this parameter is ignored. This parameter may be NULL.Read more on docs.microsoft.com.A pointer to the open storage object into which this storage object is to be copied. The destination storage object can be a different implementation of the IStorage interface from the source storage object. Thus, IStorage::CopyTo can use only publicly available methods of the destination storage object. If pstgDest is open in transacted mode, it can be reverted by calling its IStorage::Revert method.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The storage object was successfully copied.| |E_PENDING | Asynchronous Storage only: Part or all of the data to be copied is currently unavailable. | |STG_E_ACCESSDENIED | The destination storage object is a child of the source storage object.| |STG_E_INSUFFICIENTMEMORY | The copy was not completed due to a lack of memory.| |STG_E_INVALIDPOINTER | The pointer specified for the storage object was not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.| |STG_E_TOOMANYOPENFILES | The copy was not completed because there are too many open files.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.| |STG_E_MEDIUMFULL | The copy was not completed because the storage medium is full.|This method merges elements contained in the source storage object with those already present in the destination. The layout of the destination storage object may differ from the source storage object. The copy process is recursive, invoking IStorage::CopyTo and IStream::CopyTo on the elements nested inside the source. When copying a stream on top of an existing stream with the same name, the existing stream is first removed and then replaced with the source stream. When copying a storage on top of an existing storage with the same name, the existing storage is not removed. As a result, after the copy operation, the destination IStorage contains older elements, unless they were replaced by newer ones with the same names. A storage object may expose interfaces other than IStorage, including IRootStorage, IPropertyStorage, or IPropertySetStorage. The rgiidExclude parameter permits the exclusion of any or all of these additional interfaces from the copy operation. A caller with a newer or more efficient copy of an existing substorage or stream object may want to exclude the current versions of these objects from the copy operation. The snbExclude and rgiidExclude parameters provide two ways of excluding a storage objects existing storages or streams.
Note to Callers
The most common way to use the IStorage::CopyTo method is to copy everything from the source to the destination, as in most full-save and save-as operations. The following example code shows how to copy everything from the source storage object to the destination storage object.This doc was truncated.Read more on docs.microsoft.com.The MoveElementTo method copies or moves a substorage or stream from this storage object to another storage object.
Pointer to a wide character null-terminated Unicode string that contains the name of the element in this storage object to be moved or copied.
IStorage pointer to the destination storage object.
Pointer to a wide character null-terminated unicode string that contains the new name for the element in its new storage object.
Specifies whether the operation should be a move (STGMOVE_MOVE) or a copy (STGMOVE_COPY). See the STGMOVE enumeration.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The storage object was successfully copied or moved.| |E_PENDING | Asynchronous Storage only: Part or all of the element's data is currently unavailable. | |STG_E_ACCESSDENIED | The destination storage object is a child of the source storage object. Or, the destination object and element name are the same as the source object and element name. In other words, you cannot move an element to itself.| |STG_E_FILENOTFOUND | The element with the specified name does not exist.| |STG_E_FILEALREADYEXISTS | The specified file already exists.| |STG_E_INSUFFICIENTMEMORY | The copy or move was not completed due to a lack of memory.| |STG_E_INVALIDFLAG | The value for the *grfFlags* parameter is not valid.| |STG_E_INVALIDNAME | Not a valid value for *pwcsName*.| |STG_E_INVALIDPOINTER | The pointer specified for the storage object was not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.| |STG_E_TOOMANYOPENFILES | The copy or move was not completed because there are too many open files.|The IStorage::MoveElementTo method is typically the same as invoking the IStorage::CopyTo method on the indicated element and then removing the source element. In this case, the MoveElementTo method uses only the publicly available functions of the destination storage object to carry out the move. If the source and destination storage objects have special knowledge about each other's implementation (they could, for example, be different instances of the same implementation), this method can be implemented more efficiently. Before calling this method, the element to be moved must be closed, and the destination storage must be open. Also, the destination object and element cannot be the same storage object/element name as the source of the move. That is, you cannot move an element to itself.Read more on docs.microsoft.com.The Commit method ensures that any changes made to a storage object open in transacted mode are reflected in the parent storage.Controls how the changes are committed to the storage object. See the STGC enumeration for a definition of these values.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | Changes to the storage object were successfully committed to the parent level. If STGC_CONSOLIDATE was specified, the storage was successfully consolidated, or the storage was already too compact to consolidate further.| |STG_S_MULTIPLEOPENS | The commit operation succeeded, but the storage could not be consolidated because it had been opened multiple times using the STGM_NOSNAPSHOT flag.| |STG_S_CANNOTCONSOLIDATE | The commit operation succeeded, but the storage could not be consolidated due to an incorrect storage mode. For compound files, the storage may have been opened using the STGM_NOSCRATCH flag, or the storage may not be the outermost transacted level.| |STG_S_CONSOLIDATIONFAILED | The commit operation succeeded, but the storage could not be consolidated due to an internal error (for example, a memory allocation failure).| |E_PENDING | Asynchronous storage only: Part or all of the data to be committed is currently unavailable.| |STG_E_INVALIDFLAG | The value for the *grfCommitFlags* parameter is not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.| |STG_E_NOTCURRENT | Another open instance of the storage object has committed changes. As a result, the current commit operation may overwrite previous changes.| |STG_E_MEDIUMFULL | No space left on device to commit.| |STG_E_TOOMANYOPENFILES | The commit operation could not be completed because there are too many open files.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.|IStorage::Commit makes permanent changes to a storage object that is in transacted mode, in which changes are accumulated in a buffer, and not reflected in the storage object until there is a call to this method. The alternative is to open an object in direct mode, in which changes are immediately reflected in the storage object. An object opened in the direct mode does not require calling IStorage::Commit to make permanent changes in the storage object. Calling the IStorage::Commit method on a nonroot storage opened in direct mode has no effect. Opening a root storage object in direct mode ensures that changes in memory buffers are written to the underlying storage device. The commit operation publishes the current changes in this storage object and its children to the next level up in the storage hierarchy. To undo current changes before committing them, call IStorage::Revert to roll back to the last-committed version. Calling IStorage::Commit has no effect on currently opened nested elements of this storage object. They remain valid and can be used. However, the IStorage::Commit method does not automatically commit changes to these nested elements. The commit operation publishes only known changes to the next higher level in the storage hierarchy. Thus, transactions to nested levels must be committed to this storage object before they can be committed to higher levels. In commit operations, you need to take steps to ensure that data is protected during the commit process: This doc was truncated.Read more on docs.microsoft.com.The Revert method discards all changes that have been made to the storage object since the last commit operation.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The revert operation was successful.| |E_PENDING | Asynchronous Storage only: Part or all of the storage's data is currently unavailable. | |STG_E_INSUFFICIENTMEMORY | The revert operation could not be completed due to a lack of memory.| |STG_E_TOOMANYOPENFILES | The revert operation could not be completed because there are too many open files.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.|For storage objects opened in transacted mode, the IStorage::Revert method discards any uncommitted changes to this storage object or changes that have been committed to this storage object from nested elements. After this method returns, any existing elements (substorages or streams) that were opened from the reverted storage object are invalid and can no longer be used. Specifying these reverted elements in any call except IUnknown::Release returns the error STG_E_REVERTED This method has no effect on storage objects opened in direct mode.Read more on docs.microsoft.com.The EnumElements method retrieves a pointer to an enumerator object that can be used to enumerate the storage and stream objects contained within this storage object.
Reserved for future use; must be zero.
Reserved for future use; must be NULL.
Reserved for future use; must be zero.
Pointer to IEnumSTATSTG* pointer variable that receives the interface pointer to the new enumerator object.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The enumerator object was successfully returned.| |E_PENDING | Asynchronous Storage only: Part or all of the element's data is currently unavailable.| |STG_E_INSUFFICIENTMEMORY | The enumerator object could not be created due to lack of memory.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.|The enumerator object returned by this method implements the IEnumSTATSTG interface, one of the standard enumerator interfaces that contain the Next, Reset, Clone, and Skip methods. IEnumSTATSTG enumerates the data stored in an array of STATSTG structures. The storage object must be open in read mode to allow the enumeration of its elements. The enumerator object is permitted to enumerate the elements in any order. The enumerator object is also permitted to treat the enumeration as a snapshot or to have the enumeration reflect the current state of the storage object.Read more on docs.microsoft.com.The RenameElement method renames the specified substorage or stream in this storage object.Pointer to a wide character null-terminated Unicode string that contains the name of the substorage or stream to be changed.
Note The pwcsName, created in CreateStorage or CreateStream must not exceed 31 characters in length, not including the string terminator.
Read more on docs.microsoft.com.Pointer to a wide character null-terminated unicode string that contains the new name for the specified substorage or stream.
Note The pwcsName, created in CreateStorage or CreateStream must not exceed 31 characters in length, not including the string terminator.
Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The element was successfully renamed.| |E_PENDING | Asynchronous Storage only: Part or all of the element's data is currently unavailable.| |STG_E_ACCESSDENIED | The caller does not have enough permissions for renaming the element.| |STG_E_FILENOTFOUND | The element with the specified old name does not exist.| |STG_E_FILEALREADYEXISTS | The element specified by the new name already exists.| |STG_E_INSUFFICIENTMEMORY | The element was not renamed due to a lack of memory.| |STG_E_INVALIDNAME | Invalid value for one of the names.| |STG_E_INVALIDPOINTER | The pointer specified for the element was not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.| |STG_E_TOOMANYOPENFILES | The element was not renamed because there are too many open files.|IStorage::RenameElement renames the specified substorage or stream in this storage object. An element in a storage object cannot be renamed while it is open. The rename operation is subject to committing the changes if the storage is open in transacted mode. The IStorage::RenameElement method is not guaranteed to work in low memory with storage objects open in transacted mode. It may work in direct mode.Read more on docs.microsoft.com.The SetElementTimes method sets the modification, access, and creation times of the specified storage element, if the underlying file system supports this method.
The name of the storage object element whose times are to be modified. If NULL, the time is set on the root storage rather than one of its elements.
Either the new creation time for the element or NULL if the creation time is not to be modified.
Either the new access time for the element or NULL if the access time is not to be modified.
Either the new modification time for the element or NULL if the modification time is not to be modified.
This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The time values were successfully set.| |E_PENDING | Asynchronous Storage only: Part or all of the element's data is currently unavailable.| |STG_E_ACCESSDENIED | The caller does not have enough permissions for changing the element.| |STG_E_FILENOTFOUND | The element with the specified name does not exist.| |STG_E_INSUFFICIENTMEMORY | The element was not changed due to a lack of memory.| |STG_E_INVALIDNAME | Not a valid value for the element name.| |STG_E_INVALIDPOINTER | The pointer specified for the element was not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.| |STG_E_TOOMANYOPENFILES | The element was not changed because there are too many open files.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.|SetElementTimes sets time statistics for the specified storage element within this storage object. Not all file systems support all the time values. This method sets those times that are supported and ignores the rest. Each time-value parameter can be NULL; indicating that no modification should occur. Call the IStorage::Stat method to retrieve these time values.Read more on docs.microsoft.com.The SetClass method assigns the specified class identifier (CLSID) to this storage object.
The CLSID that is to be associated with the storage object.
This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The CLSID was successfully assigned.| |E_PENDING | Asynchronous Storage only: Part or all of the storage's data is currently unavailable.| |STG_E_ACCESSDENIED | The caller does not have enough permissions for assigning a CLSID to the storage object.| |STG_E_MEDIUMFULL | Not enough space was left on device to complete the operation.| |STG_E_REVERTED | The storage object has been invalidated by a revert operation above it in the transaction tree.|When first created, a storage object has an associated CLSID of CLSID_NULL. Call SetClass to assign a CLSID to the storage object. Call the IStorage::Stat method to retrieve the current CLSID of a storage object.Read more on docs.microsoft.com.The SetStateBits method stores up to 32 bits of state information in this storage object.
Specifies the new values of the bits to set. No legal values are defined for these bits; they are all reserved for future use and must not be used by applications.
A binary mask indicating which bits in grfStateBits are significant in this call.
This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The state information was successfully set.| |E_PENDING | Asynchronous Storage only: Part or all of the storage's data is currently unavailable. | |STG_E_ACCESSDENIED | The caller does not have enough permissions for changing this storage object.| |STG_E_INVALIDFLAG | The value for the grfStateBits or *grfMask* parameter is not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.|The values for the state bits are not currently defined.The Stat method retrieves the STATSTG structure for this open storage object.On return, pointer to a STATSTG structure where this method places information about the open storage object. This parameter is NULL if an error occurs.Read more on docs.microsoft.com.Specifies that some of the members in the STATSTG structure are not returned, thus saving a memory allocation operation. Values are taken from the STATFLAG enumeration.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The STATSTG structure was successfully returned at the specified location.| |E_PENDING | Asynchronous Storage only: Part or all of the storage's data is currently unavailable.| |STG_E_ACCESSDENIED | The caller does not have enough permissions for accessing statistics for this storage object.| |STG_E_INSUFFICIENTMEMORY | The STATSTG structure was not returned due to a lack of memory.| |STG_E_INVALIDFLAG | The value for the *grfStateFlag* parameter is not valid.| |STG_E_INVALIDPARAMETER | One of the parameters was not valid.|IStorage::Stat retrieves the STATSTG structure for the current storage object. The STATSTG structure contains statistical information about the storage object. IStorage::EnumElements returns a pointer to an enumerator object. The enumerator object returned by this method implements the IEnumSTATSTG interface, through which the data stored in the array of the STATSTG structures is enumerated.Read more on docs.microsoft.com.The IID guid for this interface.{0000000b-0000-0000-c000-000000000046}The PROPVARIANT structure is used in the ReadMultiple and WriteMultiple methods of IPropertyStorage to define the type tag and the value of a property in a property set.The PROPVARIANT structure can also hold a value of VT_DECIMAL:This doc was truncated.Read more on docs.microsoft.com.Describes a pointer.Learn more about this API from docs.microsoft.com.Pointer to a function.Pointer to a variable, constant, or data member.The ITypeComp that binds the pointer.The BLOB structure (nspapi.h), which is derived from Binary Large Object, contains information about a block of data.The structure name BLOB comes from the acronym BLOB, which stands for Binary Large Object. This structure does not describe the nature of the data pointed to by pBlobData.
Note Windows Sockets defines a similar BLOB structure in Wtypes.h. Using both header files in the same source code file creates redefinition–compile time errors.
Read more on docs.microsoft.com.Size of the block of data pointed to by pBlobData, in bytes.Pointer to a block of data.Identifies the calling convention used by a member function described in the METHODDATA structure.Learn more about this API from docs.microsoft.com.Values that are used in activation calls to indicate the execution contexts in which an object is to be run.Values from the CLSCTX enumeration are used in activation calls (CoCreateInstance, CoCreateInstanceEx, CoGetClassObject, and so on) to indicate the preferred execution contexts (in-process, local, or remote) in which an object is to be run. They are also used in calls to CoRegisterClassObject to indicate the set of execution contexts in which a class object is to be made available for requests to construct instances (IClassFactory::CreateInstance). To indicate that more than one context is acceptable, you can combine multiple values with Boolean ORs. The contexts are tried in the order in which they are listed.Given a set of CLSCTX flags, the execution context to be used depends on the availability of registered class codes and other parameters according to the following algorithm.This doc was truncated.Read more on docs.microsoft.com.The code that creates and manages objects of this class is a DLL that runs in the same process as the caller of the function specifying the class context.The code that manages objects of this class is an in-process handler. This is a DLL that runs in the client process and implements client-side structures of this class when instances of the class are accessed remotely.The EXE code that creates and manages objects of this class runs on same machine but is loaded in a separate process space.Obsolete.A remote context. The LocalServer32 or LocalService code that creates and manages objects of this class is run on a different computer.Obsolete.Reserved.Reserved.Reserved.Reserved.Disables the downloading of code from the directory service or the Internet. This flag cannot be set at the same time as CLSCTX_ENABLE_CODE_DOWNLOAD.Reserved.Specify if you want the activation to fail if it uses custom marshalling.Enables the downloading of code from the directory service or the Internet. This flag cannot be set at the same time as CLSCTX_NO_CODE_DOWNLOAD.The CLSCTX_NO_FAILURE_LOG can be used to override the logging of failures in CoCreateInstanceEx. If the ActivationFailureLoggingLevel is created, the following values can determine the status of event logging: This doc was truncated.Read more on docs.microsoft.com.Disables activate-as-activator (AAA) activations for this activation only. This flag overrides the setting of the EOAC_DISABLE_AAA flag from the EOLE_AUTHENTICATION_CAPABILITIES enumeration. This flag cannot be set at the same time as CLSCTX_ENABLE_AAA. Any activation where a server process would be launched under the caller's identity is known as an activate-as-activator (AAA) activation. Disabling AAA activations allows an application that runs under a privileged account (such as LocalSystem) to help prevent its identity from being used to launch untrusted components. Library applications that use activation calls should always set this flag during those calls. This helps prevent the library application from being used in an escalation-of-privilege security attack. This is the only way to disable AAA activations in a library application because the EOAC_DISABLE_AAA flag from the EOLE_AUTHENTICATION_CAPABILITIES enumeration is applied only to the server process and not to the library application. Windows 2000: This flag is not supported.Read more on docs.microsoft.com.Enables activate-as-activator (AAA) activations for this activation only. This flag overrides the setting of the EOAC_DISABLE_AAA flag from the EOLE_AUTHENTICATION_CAPABILITIES enumeration. This flag cannot be set at the same time as CLSCTX_DISABLE_AAA. Any activation where a server process would be launched under the caller's identity is known as an activate-as-activator (AAA) activation. Enabling this flag allows an application to transfer its identity to an activated component. Windows 2000: This flag is not supported.Read more on docs.microsoft.com.Begin this activation from the default context of the current apartment.Activate or connect to a 32-bit version of the server; fail if one is not registered.Activate or connect to a 64 bit version of the server; fail if one is not registered.When this flag is specified, COM uses the impersonation token of the thread, if one is present, for the activation request made by the thread. When this flag is not specified or if the thread does not have an impersonation token, COM uses the process token of the thread's process for the activation request made by the thread.Windows Vista or later: This flag is supported.Read more on docs.microsoft.com.Indicates activation is for an app container.
Note This flag is reserved for internal use and is not intended to be used directly from your code.
Read more on docs.microsoft.com.Specify this flag for Interactive User activation behavior for As-Activator servers. A strongly named Medium IL Windows Store app can use this flag to launch an "As Activator" COM server without a strong name. Also, you can use this flag to bind to a running instance of the COM server that's launched by a desktop application. The client must be Medium IL, it must be strongly named, which means that it has a SysAppID in the client token, it can't be in session 0, and it must have the same user as the session ID's user in the client token. If the server is out-of-process and "As Activator", it launches the server with the token of the client token's session user. This token won't be strongly named. If the server is out-of-process and RunAs "Interactive User", this flag has no effect. If the server is out-of-process and is any other RunAs type, the activation fails. This flag has no effect for in-process servers. Off-machine activations fail when they use this flag.Read more on docs.microsoft.com.Used for loading Proxy/Stub DLLs.
Note This flag is reserved for internal use and is not intended to be used directly from your code.
Read more on docs.microsoft.com.Identifies the type description being bound to.Learn more about this API from docs.microsoft.com.No match was found.A FUNCDESC was returned.A VARDESC was returned.A TYPECOMP was returned.An IMPLICITAPPOBJ was returned.The end of the enum.Contains the arguments passed to a method or property.Learn more about this API from docs.microsoft.com.An array of arguments. **Note**: these arguments appear in reverse orderRead more on docs.microsoft.com.The dispatch IDs of the named arguments.The number of arguments.The number of named arguments.The ELEMDESC structure contains the type description and process-transfer information for a variable, a function, or a function parameter. (ELEMDESC)The type of the element.Describes an exception that occurred during IDispatch::Invoke.Use the pfnDeferredFillIn field to enable an object to defer filling in the bstrDescription, bstrHelpFile, and dwHelpContext fields until they are needed. This field might be used, for example, if loading the string for the error is a time-consuming operation. To use deferred fill-in, the object puts a function pointer in this slot and does not fill any of the other fields except wCode, which is required. To get additional information, the caller passes the EXCEPINFO structure back to the pexcepinfo callback function, which fills in the additional information. When the ActiveX object and the ActiveX client are in different processes, the ActiveX object calls pfnDeferredFillIn before returning to the controller.Read more on docs.microsoft.com.The error code. Error codes should be greater than 1000. Either this field or the scode field must be filled in; the other must be set to 0.Reserved. Should be 0.The name of the exception source. Typically, this is an application name. This field should be filled in by the implementer of IDispatch.The exception description to display. If no description is available, use null.The fully qualified help file path. If no Help is available, use null.The help context ID.Reserved. Must be null.Provides deferred fill-in. If deferred fill-in is not desired, this field should be set to null.A return value that describes the error. Either this field or wCode (but not both) must be filled in; the other must be set to 0. (16-bit Windows versions only.)Describes a function. (FUNCDESC)The cParams field specifies the total number of required and optional parameters.The cParamsOpt field specifies the form of optional parameters accepted by the function, as follows: This doc was truncated.Read more on docs.microsoft.com.The function member ID.The status code.Description of the element.Indicates the type of function (virtual, static, or dispatch-only).The invocation type. Indicates whether this is a property function, and if so, which type.The calling convention.The total number of parameters.The number of optional parameters.For FUNC_VIRTUAL, specifies the offset in the VTBL.The number of possible return values.The function return type.The function flags. See FUNCFLAGS.Specifies function flags.FUNCFLAG_FHIDDEN means that the property should never be shown in object browsers, property browsers, and so on. This function is useful for removing items from an object model. Code can bind to the member, but the user will never know that the member exists. FUNCFLAG_FNONBROWSABLE means that the property should not be displayed in a properties browser. It is used in circumstances in which an error would occur if the property were shown in a properties browser. FUNCFLAG_FRESRICTED means that macro-oriented programmers should not be allowed to access this member. These members are usually treated as _FHIDDEN by tools such as Visual Basic, with the main difference being that code cannot bind to those members.Read more on docs.microsoft.com.The function should not be accessible from macro languages. This flag is intended for system-level functions or functions that type browsers should not display.The function returns an object that is a source of events.The function that supports data binding.When set, any call to a method that sets the property results first in a call to IPropertyNotifySink::OnRequestEdit. The implementation of OnRequestEdit determines if the call is allowed to set the property.The function that is displayed to the user as bindable. FUNC_FBINDABLE must also be set.The function that best represents the object. Only one function in a type information can have this attribute.The function should not be displayed to the user, although it exists and is bindable.The function supports GetLastError. If an error occurs during the function, the caller can call GetLastError to retrieve the error code.Permits an optimization in which the compiler looks for a member named xyz on the type of abc. If such a member is found and is flagged as an accessor function for an element of the default collection, then a call is generated to that member function. Permitted on members in dispinterfaces and interfaces; not permitted on modules. For more information, refer to defaultcollelem in Type Libraries and the Object Description Language.The type information member is the default member for display in the user interface.The property appears in an object browser, but not in a properties browser.Tags the interface as having default behaviors.Mapped as individual bindable properties.Specifies the function type.Learn more about this API from docs.microsoft.com.The function is accessed the same as PUREVIRTUAL, except the function has an implementation.The function is accessed through the virtual function table (VTBL), and takes an implicit this pointer.The function is accessed by static address and takes an implicit this pointer.The function is accessed by static address and does not take an implicit this pointer.The function can be accessed only through IDispatch.The IEnumUnknown::Next (objidlbase.h) method retrieves the specified number of items in the enumeration sequence.
The number of items to be retrieved. If there are fewer than the requested number of items left in the sequence, this method retrieves the remaining elements.
An array of enumerated items. The enumerator is responsible for calling AddRef, and the caller is responsible for calling Release through each pointer enumerated. If celt is greater than 1, the caller must also pass a non-NULL pointer passed to pceltFetched to know how many pointers to release.Read more on docs.microsoft.com.
The number of items that were retrieved. This parameter is always less than or equal to the number of items requested.
If the method retrieves the number of items requested, the return value is S_OK. Otherwise, it is S_FALSE.Learn more about this API from docs.microsoft.com.The IEnumUnknown::Skip (objidlbase.h) method skips over the specified number of items in the enumeration sequence.
The number of items to be skipped.
If the method skips the number of items requested, the return value is S_OK. Otherwise, it is S_FALSE.Learn more about this API from docs.microsoft.com.The IEnumUnknown::Reset (objidlbase.h) method resets the enumeration sequence to the beginning.The return value is S_OK.There is no guarantee that the same set of objects will be enumerated after the reset operation has completed. A static collection is reset to the beginning, but it can be too expensive for some collections, such as files in a directory, to guarantee this condition.The IEnumUnknown::Clone (objidlbase.h) method creates a new enumerator that contains the same enumeration state as the current one.
A pointer to the cloned enumerator object.
This method can return the standard return values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and S_OK.Learn more about this API from docs.microsoft.com.The IID guid for this interface.{00000100-0000-0000-c000-000000000046}Registers the specified interface on an object residing in one apartment of a process as a global interface, enabling other apartments access to that interface.
An interface pointer of type riid on the object on which the interface to be registered as global is implemented.
The IID of the interface to be registered as global.
An identifier that can be used by another apartment to get access to a pointer to the interface being registered. The value of an invalid cookie is 0.
This method can return the following values. This doc was truncated.Called in the apartment in which an object resides to register one of the object's interfaces as a global interface. This method supplies a pointer to a cookie that other apartments can use in a call to the GetInterfaceFromGlobal method to get a pointer to that interface. The interface pointer may be a pointer to an in-process object, or it may be a pointer to a proxy for an object residing in another apartment, in another process, or on another computer. The apartment that calls this method must remain alive until the corresponding call to RevokeInterfaceFromGlobal.Read more on docs.microsoft.com.Revokes the registration of an interface in the global interface table.
Identifies the interface whose global registration is to be revoked.
This method can return the following values. This doc was truncated.Call this method when an interface registered in the global interface table object no longer needs to be accessed by other apartments in the same process. This method can be called by any apartment in the process, including apartments other than the one that registered the interface in the global interface table.Retrieves a pointer to an interface on an object that is usable by the calling apartment. This interface must be currently registered in the global interface table.
Identifies the interface (and its object), and is retrieved through a call to IGlobalInterfaceTable::RegisterInterfaceInGlobal.
The IID of the interface.
A pointer to the pointer for the requested interface.
This method can return the following values. This doc was truncated.After an interface has been registered in the global interface table, an apartment can get a pointer to this interface by calling the GetInterfaceFromGlobal method with the supplied cookie. This pointer to the interface can be used in the calling apartment but not by other apartments in the process. The application is responsible for coordinating access to the global variable during calls to IGlobalInterfaceTable::RevokeInterfaceFromGlobal. That is, the application should ensure that one thread does not call RevokeInterfaceFromGlobal while another thread is calling GetInterfaceFromGlobal with the same cookie. Multiple calls to GetInterfaceFromGlobal for the same cookie are permitted. The GetInterfaceFromGlobal method calls AddRef on the pointer obtained in the ppv parameter. It is the caller's responsibility to call Release on this pointer.Read more on docs.microsoft.com.The IID guid for this interface.{00000146-0000-0000-c000-000000000046}Specifies the way a function is invoked.In C, value assignment is written as *pobj1 = *pobj2, while reference assignment is written as pobj1 = pobj2. Other languages have other syntactic conventions. A property or data member can support only a value assignment, a reference assignment, or both. The INVOKEKIND enumeration constants are the same constants that are passed to IDispatch::Invoke to specify the way in which a function is invoked.The member is called using a normal function invocation syntax.The function is invoked using a normal property-access syntax.The function is invoked using a property value assignment syntax. Syntactically, a typical programming language might represent changing a property in the same way as assignment. For example: object.property : = value.The function is invoked using a property reference assignment syntax.Reads a specified number of bytes from the stream object into memory, starting at the current seek pointer.
A pointer to the buffer which the stream data is read into.
The number of bytes of data to read from the stream object.
A pointer to a ULONG variable that receives the actual number of bytes read from the stream object.
Note The number of bytes read may be zero.
Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | All of the requested data was successfully read from the stream object; the number of bytes requested in *cb* is the same as the number of bytes returned in *pcbRead*.| |S_FALSE | The value returned in *pcbRead* is less than the number of bytes requested in *cb*. This indicates the end of the stream has been reached. The number of bytes read indicates how much of the *pv* buffer has been filled.| |E_PENDING | Asynchronous storage only: Part or all of the data to be read is currently unavailable. | |STG_E_ACCESSDENIED | The caller does not have permissions required to read this stream object.| |STG_E_INVALIDPOINTER | One of the pointer values is invalid.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|This method reads bytes from this stream object into memory. The stream object must be opened in STGM_READ mode. This method adjusts the seek pointer by the actual number of bytes read. The number of bytes actually read is also returned in the pcbRead parameter.
Notes to Callers
The actual number of bytes read can be less than the number of bytes requested if an error occurs or if the end of the stream is reached during the read operation. The number of bytes returned should always be compared to the number of bytes requested. If the number of bytes returned is less than the number of bytes requested, it usually means the Read method attempted to read past the end of the stream. The application should handle both a returned error and S_OK return values on end-of-stream read operations.Read more on docs.microsoft.com.Writes a specified number of bytes into the stream object starting at the current seek pointer.
A pointer to the buffer that contains the data that is to be written to the stream. A valid pointer must be provided for this parameter even when cb is zero.
The number of bytes of data to attempt to write into the stream. This value can be zero.
A pointer to a ULONG variable where this method writes the actual number of bytes written to the stream object. The caller can set this pointer to NULL, in which case this method does not provide the actual number of bytes written.
This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The data was successfully written to the stream object.| |E_PENDING | Asynchronous Storage only: Part or all of the data to be written is currently unavailable.| |STG_E_MEDIUMFULL | The write operation failed because there is no space left on the storage device.| |STG_E_ACCESSDENIED | The caller does not have the required permissions for writing to this stream object.| |STG_E_CANTSAVE | Data cannot be written for reasons other than improper access or insufficient space.| |STG_E_INVALIDPOINTER | One of the pointer values is not valid. The *pv* parameter must contain a valid pointer even if *cb* is zero.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.| |STG_E_WRITEFAULT | The write operation failed due to a disk error. This value is also returned when this method attempts to write to a stream that was opened in simple mode (using the STGM_SIMPLE flag).|ISequentialStream::Write writes the specified data to a stream object. The seek pointer is adjusted for the number of bytes actually written. The number of bytes actually written is returned in the pcbWritten parameter. If the byte count is zero bytes, the write operation has no effect. If the seek pointer is currently past the end of the stream and the byte count is nonzero, this method increases the size of the stream to the seek pointer and writes the specified bytes starting at the seek pointer. The fill bytes written to the stream are not initialized to any particular value. This is the same as the end-of-file behavior in the MS-DOS FAT file system. With a zero byte count and a seek pointer past the end of the stream, this method does not create the fill bytes to increase the stream to the seek pointer. In this case, you must call the IStream::SetSize method to increase the size of the stream and write the fill bytes. The pcbWritten parameter can have a value even if an error occurs. In the COM-provided implementation, stream objects are not sparse. Any fill bytes are eventually allocated on the disk and assigned to the stream.Read more on docs.microsoft.com.The IID guid for this interface.{0c733a30-2a1c-11ce-ade5-00aa0044773d}Changes the seek pointer to a new location. The new location is relative to either the beginning of the stream, the end of the stream, or the current seek pointer.
The displacement to be added to the location indicated by the dwOrigin parameter. If dwOrigin is STREAM_SEEK_SET, this is interpreted as an unsigned value rather than a signed value.
The origin for the displacement specified in dlibMove. The origin can be the beginning of the file (STREAM_SEEK_SET), the current seek pointer (STREAM_SEEK_CUR), or the end of the file (STREAM_SEEK_END). For more information about values, see the STREAM_SEEK enumeration.
A pointer to the location where this method writes the value of the new seek pointer from the beginning of the stream. You can set this pointer to NULL. In this case, this method does not provide the new seek pointer.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The seek pointer was successfully adjusted.| |E_PENDING | Asynchronous Storage only: Part or all of the stream data is currently unavailable. | |STG_E_INVALIDPOINTER | Indicates that *plibNewPosition* points to invalid memory, because *plibNewPosition* is not read.| |STG_E_INVALIDFUNCTION | The *dwOrigin* parameter contains an invalid value, or the *dlibMove* parameter contains a bad offset value. For example, the result of the seek pointer is a negative offset value.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|IStream::Seek changes the seek pointer so that subsequent read and write operations can be performed at a different location in the stream object. It is an error to seek before the beginning of the stream. It is not, however, an error to seek past the end of the stream. Seeking past the end of the stream is useful for subsequent write operations, as the stream byte range will be extended to the new seek position immediately before the write is complete. You can also use this method to obtain the current value of the seek pointer by calling this method with the dwOrigin parameter set to STREAM_SEEK_CUR and the dlibMove parameter set to 0 so that the seek pointer is not changed. The current seek pointer is returned in the plibNewPosition parameter.Read more on docs.microsoft.com.Changes the size of the stream object.
Specifies the new size, in bytes, of the stream.
This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The size of the stream object was successfully changed.| |E_PENDING | Asynchronous Storage only: Part or all of the stream's data is currently unavailable.| |STG_E_MEDIUMFULL | The stream size is not changed because there is no space left on the storage device.| |STG_E_INVALIDFUNCTION | The value of the *libNewSize* parameter is not supported by the implementation. Not all streams support greater than 232 bytes. If a stream does not support more than 232 bytes, the high DWORD data type of *libNewSize* must be zero. If it is nonzero, the implementation may return STG_E_INVALIDFUNCTION. In general, COM-based implementations of the IStream interface do not support streams larger than 232 bytes.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|IStream::SetSize changes the size of the stream object. Call this method to preallocate space for the stream. If the libNewSize parameter is larger than the current stream size, the stream is extended to the indicated size by filling the intervening space with bytes of undefined value. This operation is similar to the ISequentialStream::Write method if the seek pointer is past the current end of the stream. If the libNewSize parameter is smaller than the current stream, the stream is truncated to the indicated size. The seek pointer is not affected by the change in stream size. Calling IStream::SetSize can be an effective way to obtain a large chunk of contiguous space.Read more on docs.microsoft.com.Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.
A pointer to the destination stream. The stream pointed to by pstm can be a new stream or a clone of the source stream.
The number of bytes to copy from the source stream.
A pointer to the location where this method writes the actual number of bytes read from the source. You can set this pointer to NULL. In this case, this method does not provide the actual number of bytes read.
A pointer to the location where this method writes the actual number of bytes written to the destination. You can set this pointer to NULL. In this case, this method does not provide the actual number of bytes written.
This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The stream object was successfully copied.| |E_PENDING | Asynchronous Storage only: Part or all of the data to be copied is currently unavailable. | |STG_E_INVALIDPOINTER | The value of one of the pointer parameters is invalid.| |STG_E_MEDIUMFULL | The stream is not copied because there is no space left on the storage device.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|The CopyTo method copies the specified bytes from one stream to another. It can also be used to copy a stream to itself. The seek pointer in each stream instance is adjusted for the number of bytes read or written. This method is equivalent to reading cb bytes into memory using ISequentialStream::Read and then immediately writing them to the destination stream using ISequentialStream::Write, although IStream::CopyTo will be more efficient. The destination stream can be a clone of the source stream created by calling the IStream::Clone method. If IStream::CopyTo returns an error, you cannot assume that the seek pointers are valid for either the source or destination. Additionally, the values of pcbRead and pcbWritten are not meaningful even though they are returned. If IStream::CopyTo returns successfully, the actual number of bytes read and written are the same. To copy the remainder of the source from the current seek pointer, specify the maximum large integer value for the cb parameter. If the seek pointer is the beginning of the stream, this operation copies the entire stream.Read more on docs.microsoft.com.The Commit method ensures that any changes made to a stream object open in transacted mode are reflected in the parent storage.Controls how the changes for the stream object are committed. See the STGC enumeration for a definition of these values.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | Changes to the stream object were successfully committed to the parent level.| |E_PENDING | Asynchronous Storage only: Part or all of the stream's data is currently unavailable. | |STG_E_MEDIUMFULL | The commit operation failed due to lack of space on the storage device.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|The Commit method ensures that changes to a stream object opened in transacted mode are reflected in the parent storage. Changes that have been made to the stream since it was opened or last committed are reflected to the parent storage object. If the parent is opened in transacted mode, the parent may revert at a later time, rolling back the changes to this stream object. The compound file implementation does not support the opening of streams in transacted mode, so this method has very little effect other than to flush memory buffers. For more information, see IStream - Compound File Implementation. If the stream is open in direct mode, this method ensures that any memory buffers have been flushed out to the underlying storage object. This is much like a flush in traditional file systems. The IStream::Commit method is useful on a direct mode stream when the implementation of the IStream interface is a wrapper for underlying file system APIs. In this case, IStream::Commit would be connected to the file system's flush call.Read more on docs.microsoft.com.The Revert method discards all changes that have been made to a transacted stream since the last IStream::Commit call. On streams open in direct mode and streams using the COM compound file implementation of IStream::Revert, this method has no effect.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The stream was successfully reverted to its previous version.| |E_PENDING | Asynchronous Storage only: Part or all of the stream's data is currently unavailable. |The Revert method discards changes made to a transacted stream since the last commit operation.The LockRegion method restricts access to a specified range of bytes in the stream.
Integer that specifies the byte offset for the beginning of the range.
Integer that specifies the length of the range, in bytes, to be restricted.
Specifies the restrictions being requested on accessing the range.
This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The specified range of bytes was locked.| |E_PENDING | Asynchronous Storage only: Part or all of the stream's data is currently unavailable. | |STG_E_INVALIDFUNCTION | Locking is not supported at all or the specific type of lock requested is not supported.| |STG_E_LOCKVIOLATION | Requested lock is supported, but cannot be granted because of an existing lock.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|The byte range of the stream can be extended. Locking an extended range for the stream is useful as a method of communication between different instances of the stream without changing data that is actually part of the stream. Three types of locking can be supported: locking to exclude other writers, locking to exclude other readers or writers, and locking that allows only one requester to obtain a lock on the given range, which is usually an alias for one of the other two lock types. A given stream instance might support either of the first two types, or both. The lock type is specified by dwLockType, using a value from the LOCKTYPE enumeration. Any region locked with IStream::LockRegion must later be explicitly unlocked by calling IStream::UnlockRegion with exactly the same values for the libOffset, cb, and dwLockType parameters. The region must be unlocked before the stream is released. Two adjacent regions cannot be locked separately and then unlocked with a single unlock call.
Notes to Callers
Since the type of locking supported is optional and can vary in different implementations of IStream, you must provide code to deal with the STG_E_INVALIDFUNCTION error. The LockRegion method has no effect in the compound file implementation, because the implementation does not support range locking.
Notes to Implementers
Support for this method is optional for implementations of stream objects since it may not be supported by the underlying file system. The type of locking supported is also optional. The STG_E_INVALIDFUNCTION error is returned if the requested type of locking is not supported.Read more on docs.microsoft.com.The UnlockRegion method removes the access restriction on a range of bytes previously restricted with IStream::LockRegion.
Specifies the byte offset for the beginning of the range.
Specifies, in bytes, the length of the range to be restricted.
Specifies the access restrictions previously placed on the range.
This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The byte range was unlocked.| |E_PENDING | Asynchronous Storage only: Part or all of the stream's data is currently unavailable.| |STG_E_INVALIDFUNCTION | Locking is not supported at all or the specific type of lock requested is not supported.| |STG_E_LOCKVIOLATION | The requested unlock operation cannot be granted.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|IStream::UnlockRegion unlocks a region previously locked with the IStream::LockRegion method. Locked regions must later be explicitly unlocked by calling IStream::UnlockRegion with exactly the same values for the libOffset, cb, and dwLockType parameters. The region must be unlocked before the stream is released. Two adjacent regions cannot be locked separately and then unlocked with a single unlock call.Read more on docs.microsoft.com.The Stat method retrieves the STATSTG structure for this stream.Pointer to a STATSTG structure where this method places information about this stream object.Read more on docs.microsoft.com.Specifies that this method does not return some of the members in the STATSTG structure, thus saving a memory allocation operation. Values are taken from the STATFLAG enumeration.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The STATSTG structure was successfully returned at the specified location.| |E_PENDING | Asynchronous Storage only: Part or all of the stream's data is currently unavailable. | |STG_E_ACCESSDENIED | The caller does not have enough permissions for accessing statistics for this storage object.| |STG_E_INSUFFICIENTMEMORY | The STATSTG structure was not returned due to a lack of memory.| |STG_E_INVALIDFLAG | The value for the *grfStateFlag* parameter is not valid.| |STG_E_INVALIDPOINTER | The *pStatStg* pointer is not valid.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|IStream::Stat retrieves a pointer to the STATSTG structure that contains information about this open stream. When this stream is within a structured storage and IStorage::EnumElements is called, it creates an enumerator object with the IEnumSTATSTG interface on it, which can be called to enumerate the storages and streams through the STATSTG structures associated with each of them.Read more on docs.microsoft.com.The Clone method creates a new stream object with its own seek pointer that references the same bytes as the original stream.When successful, pointer to the location of an IStream pointer to the new stream object. If an error occurs, this parameter is NULL.Read more on docs.microsoft.com.This method can return one of these values. | Return code | Description | |----------------|---------------| |S_OK | The stream was successfully cloned.| |E_PENDING | Asynchronous Storage only: Part or all of the stream's data is currently unavailable. | |STG_E_INSUFFICIENTMEMORY | The stream was not cloned due to a lack of memory.| |STG_E_INVALIDPOINTER | The ppStm pointer is not valid.| |STG_E_REVERTED | The object has been invalidated by a revert operation above it in the transaction tree.|The Clone method creates a new stream object for accessing the same bytes but using a separate seek pointer. The new stream object sees the same data as the source-stream object. Changes written to one object are immediately visible in the other. Range locking is shared between the stream objects. The initial setting of the seek pointer in the cloned stream instance is the same as the current setting of the seek pointer in the original stream at the time of the clone operation.Read more on docs.microsoft.com.The IID guid for this interface.{0000000c-0000-0000-c000-000000000046}Maps a name to a member of a type, or binds global variables and functions contained in a type library.
The name to be bound.
The hash value for the name computed by LHashValOfNameSys.
One or more of the flags defined in the INVOKEKIND enumeration. Specifies whether the name was referenced as a method or a property. When binding to a variable, specify the flag INVOKE_PROPERTYGET. Specify zero to bind to any type of member.
If a FUNCDESC or VARDESC was returned, then ppTInfo points to a pointer to the type description that contains the item to which it is bound.
Indicates whether the name bound to is a VARDESC, FUNCDESC, or TYPECOMP. If there was no match, DESCKIND_NONE.
The bound-to VARDESC, FUNCDESC, or ITypeComp interface.
This method can return one of these values. This doc was truncated.Use Bind for binding to the variables and methods of a type, or for binding to the global variables and methods in a type library. The returned DESCKIND pointer pDescKind indicates whether the name was bound to a VARDESC, a FUNCDESC, or to an ITypeComp instance. The returned pBindPtr points to the VARDESC, FUNCDESC, or ITypeComp. If a data member or method is bound to, then ppTInfopoints to the type description that contains the method or data member.If Bind binds the name to a nested binding context, it returns a pointer to an ITypeComp instance in pBindPtr and a null type description pointer in ppTInfo. For example, if the name of a type description is passed for a module (TKIND_MODULE), enumeration (TKIND_ENUM), or coclass (TKIND_COCLASS), Bind returns the ITypeComp instance of the type description for the module, enumeration, or coclass. This feature supports languages such as Visual Basic that allow references to members of a type description to be qualified by the name of the type description. For example, a function in a module can be referenced by modulename.functionname. The members of TKIND_ENUM, TKIND_MODULE, and TKIND_COCLASS types marked as Application objects can be bound to directly from ITypeComp, without specifying the name of the module. The ITypeComp of a coclass defers to the ITypeComp of its default interface.As with other methods of ITypeComp, ITypeInfo, and ITypeInfo, the calling code is responsible for releasing the returned object instances or structures. If a VARDESC or FUNCDESC is returned, the caller is responsible for deleting it with the returned type description and releasing the type description instance itself. Otherwise, if an ITypeComp instance is returned, the caller must release it.Special rules apply if you call a type library's Bind method, passing it the name of a member of an Application object class (a class that has the TYPEFLAG_FAPPOBJECT flag set). In this case, Bind returns DESCKIND_IMPLICITAPPOBJ in pDescKind, a VARDESC that describes the Application object in pBindPtr, and the ITypeInfo of the Application object class in ppTInfo. To bind to the object, ITypeInfo::GetTypeComp must make a call to get the ITypeComp of the Application object class, and then reinvoke its Bind method with the name initially passed to the type library's ITypeComp.The caller should use the returned ITypeInfo pointer (ppTInfo) to get the address of the member.
Note The wflags parameter is the same as the wflags parameter in IDispatch::Invoke.
Read more on docs.microsoft.com.Binds to the type descriptions contained within a type library.
The name to be bound.
The hash value for the name computed by LHashValOfName.
An ITypeInfo of the type to which the name was bound.
Passes a valid pointer, such as the address of an ITypeComp variable.
This method can return one of these values. This doc was truncated.Use the function BindType for binding a type name to the ITypeInfo that describes the type. This function is invoked on the ITypeComp that is returned by ITypeLib::GetTypeComp to bind to types defined within that library. It can also be used in the future for binding to nested types.The IID guid for this interface.{00020403-0000-0000-c000-000000000046}Provides the number of type descriptions that are in a type library.The number of type descriptions in the type library.Learn more about this API from docs.microsoft.com.Retrieves the specified type description in the library.
The index of the interface to be returned.
If successful, returns a pointer to the pointer to the ITypeInfo interface.
This method can return one of these values. This doc was truncated.For dual interfaces, GetTypeInfo returns only the TKIND_DISPATCH type information. To get the TKIND_INTERFACE type information, GetRefTypeOfImplType can be called on the TKIND_DISPATCH type information, passing an index of –1. Then, the returned type information handle can be passed to GetRefTypeInfo.Retrieves the type of a type description.
The index of the type description within the type library.
The TYPEKIND enumeration value for the type description.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Retrieves the type description that corresponds to the specified GUID.
The GUID of the type description.
The ITypeInfo interface.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Retrieves the structure that contains the library's attributes.
The library's attributes.
This method can return one of these values. This doc was truncated.Use ITypeLib::ReleaseTLibAttr to free the memory occupied by the TLIBATTR structure.Enables a client compiler to bind to the types, variables, constants, and global functions for a library.
The ITypeComp instance for this ITypeLib. A client compiler uses the methods in the ITypeComp interface to bind to types in ITypeLib, as well as to the global functions, variables, and constants defined in ITypeLibThis method can return one of these values. This doc was truncated.The Bind function of the returned TypeComp binds to global functions, variables, constants, enumerated values, and coclass members. The Bind function also binds the names of the TYPEKIND enumerations of TKIND_MODULE, TKIND_ENUM, and TKIND_COCLASS. These names shadow any global names defined within the type information. The members of TKIND_ENUM, TKIND_MODULE, and TKIND_COCLASS types marked as Application objects can be directly bound to from ITypeComp without specifying the name of the module.ITypeComp::Bind and ITypeComp::BindType accept only unqualified names. ITypeLib::GetTypeComp returns a pointer to the ITypeComp interface, which is then used to bind to global elements in the library. The names of some types (TKIND_ENUM, TKIND_MODULE, and TKIND_COCLASS) share the name space with variables, functions, constants, and enumerators. If a member requires qualification to differentiate it from other items in the name space, GetTypeComp can be called successively for each qualifier in order to bind to the desired member. This allows programming language compilers to access members of modules, enumerations, and coclasses, even though the member can't be bound to with a qualified name.Read more on docs.microsoft.com.Retrieves the documentation string for the library, the complete Help file name and path, and the context identifier for the library Help topic in the Help file.
The index of the type description whose documentation is to be returned. If index is -1, then the documentation for the library itself is returned.
The name of the specified item. If the caller does not need the item name, then pBstrName can be null.
The documentation string for the specified item. If the caller does not need the documentation string, then pBstrDocString can be null..
The Help context identifier (ID) associated with the specified item. If the caller does not need the Help context ID, then pdwHelpContext can be null.
The fully qualified name of the Help file. If the caller does not need the Help file name, then pBstrHelpFile can be null.
This method can return one of these values. This doc was truncated.The caller should free the parameters pBstrName, pBstrDocString, and pBstrHelpFile.Indicates whether a passed-in string contains the name of a type or member described in the library.
The string to test. If this method is successful, szNameBuf is modified to match the case (capitalization) found in the type library.
The hash value of szNameBuf.
True if szNameBuf was found in the type library; otherwise false.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Finds occurrences of a type description in a type library. This may be used to quickly verify that a name exists in a type library.
The name to search for.
A hash value to speed up the search, computed by the LHashValOfNameSys function. If lHashVal = 0, a value is computed.
An array of pointers to the type descriptions that contain the name specified in szNameBuf. This parameter cannot be null.
An array of the found items; rgMemId[i] is the MEMBERID that indexes into the type description specified by ppTInfo[i]. This parameter cannot be null.
On entry, indicates how many instances to look for. For example, *pcFound = 1 can be called to find the first occurrence. The search stops when one is found. On exit, indicates the number of instances that were found. If the in and out values of *pcFound are identical, there may be more type descriptions that contain the name.Read more on docs.microsoft.com.This method can return one of these values. This doc was truncated.Passing *pcFound = n indicates that there is enough room in the ppTInfo and rgMemId arrays for n (ptinfo, memid) pairs. The function returns MEMBERID_NIL in rgMemId[i], if the name in szNameBuf is the name of the type information in ppTInfo[i].Releases the TLIBATTR originally obtained from GetLibAttr.
The TLIBATTR to be freed.
Learn more about this API from docs.microsoft.com.The IID guid for this interface.{00020402-0000-0000-c000-000000000046}The LOCKTYPE enumeration values indicate the type of locking requested for the specified range of bytes. The values are used in the ILockBytes::LockRegion and IStream::LockRegion methods.Learn more about this API from docs.microsoft.com.If this lock is granted, the specified range of bytes can be opened and read any number of times, but writing to the locked range is prohibited except for the owner that was granted this lock.If this lock is granted, writing to the specified range of bytes is prohibited except by the owner that was granted this lock.If this lock is granted, no other LOCK_ONLYONCE lock can be obtained on the range. Usually this lock type is an alias for some other lock type. Thus, specific implementations can have additional behavior associated with this lock type.Represents the bounds of one dimension of the array.Learn more about this API from docs.microsoft.com.The number of elements in the dimension.The lower bound of the dimension.Indicate whether the method should try to return a name in the pwcsName member of the STATSTG structure.Learn more about this API from docs.microsoft.com.Requests that the statistics include the pwcsName member of the STATSTG structure.Read more on docs.microsoft.com.Requests that the statistics not include the pwcsName member of the STATSTG structure. If the name is omitted, there is no need for the ILockBytes::Stat, IStorage::Stat, and IStream::Stat methods methods to allocate and free memory for the string value of the name, therefore the method reduces time and resources used in an allocation and free operation.Read more on docs.microsoft.com.Not implemented.Contains statistical data about an open storage, stream, or byte-array object.Learn more about this API from docs.microsoft.com.A pointer to a NULL-terminated Unicode string that contains the name. Space for this string is allocated by the method called and freed by the caller (for more information, see CoTaskMemFree). To not return this member, specify the STATFLAG_NONAME value when you call a method that returns a STATSTG structure, except for calls to IEnumSTATSTG::Next, which provides no way to specify this value.Read more on docs.microsoft.com.Indicates the type of storage object. This is one of the values from the STGTY enumeration.Read more on docs.microsoft.com.Specifies the size, in bytes, of the stream or byte array.Indicates the last modification time for this storage, stream, or byte array.Indicates the creation time for this storage, stream, or byte array.Indicates the last access time for this storage, stream, or byte array.Indicates the access mode specified when the object was opened. This member is only valid in calls to Stat methods.Read more on docs.microsoft.com.Indicates the class identifier for the storage object; set to CLSID_NULL for new storage objects. This member is not used for streams or byte arrays.Indicates the current state bits of the storage object; that is, the value most recently set by the IStorage::SetStateBits method. This member is not valid for streams or byte arrays.Read more on docs.microsoft.com.Reserved for future use.Flags that indicate conditions for creating and deleting the object and access modes for the object.You can combine these flags, but you can only choose one flag from each group of related flags. Typically one flag from each of the access and sharing groups must be specified for all functions and methods which use these constants. Flags from other groups are optional.The STGTY enumeration values are used in the type member of the STATSTG structure to indicate the type of the storage element. A storage element is a storage object, a stream object, or a byte-array object (LOCKBYTES).Learn more about this API from docs.microsoft.com.Indicates that the storage element is a storage object.Indicates that the storage element is a stream object.Indicates that the storage element is a byte-array object.Indicates that the storage element is a property storage object.Identifies the target operating system platform.Learn more about this API from docs.microsoft.com.The target operating system for the type library is 16-bit Windows. By default, data members are packed.The target operating system for the type library is 32-bit Windows. By default, data members are naturally aligned (for example, 2-byte integers are aligned on even-byte boundaries; 4-byte integers are aligned on quad-word boundaries, and so on).The target operating system for the type library is Apple Macintosh. By default, all data members are aligned on even-byte boundaries.The target operating system for the type library is 64-bit Windows.Contains information about a type library. Information from this structure is used to identify the type library and to provide national language support for member names.Learn more about this API from docs.microsoft.com.The globally unique identifier.The locale identifier.The target hardware platform.The major version number.The minor version number.The library flags.Contains attributes of a type.Learn more about this API from docs.microsoft.com.The GUID of the type information.The locale of member names and documentation strings.Reserved.The constructor ID, or MEMBERID_NIL if none.The destructor ID, or MEMBERID_NIL if none.Reserved.The size of an instance of this type.The kind of type.The number of functions.The number of variables or data members.The number of implemented interfaces.The size of this type's VTBL.The byte alignment for an instance of this type. A value of 0 indicates alignment on the 64K boundary; 1 indicates no special alignment. For other values, n indicates aligned on byte n.The type flags. See TYPEFLAGS.The major version number.The minor version number.If typekind is TKIND_ALIAS, specifies the type for which this type is an alias.The IDL attributes of the described type.Describes the type of a variable, the return type of a function, or the type of a function parameter.If the variable is VT_SAFEARRAY or VT_PTR, the union portion of the TYPEDESC contains a pointer to a TYPEDESC that specifies the element type.The variant type.Specifies a type.Learn more about this API from docs.microsoft.com.A set of enumerators.A structure with no methods.A module that can only have static functions and data (for example, a DLL).A type that has virtual and pure functions.A set of methods and properties that are accessible through IDispatch::Invoke. By default, dual interfaces return TKIND_DISPATCH.A set of implemented component object interfaces.A type that is an alias for another type.A union, all of whose members have an offset of zero.End of enum marker.Describes a variable, constant, or data member.Learn more about this API from docs.microsoft.com.The member ID.Reserved.The variable type.The variable flags. See VARFLAGS.The variable type.Specifies variable flags.Learn more about this API from docs.microsoft.com.Assignment to the variable should not be allowed.The variable returns an object that is a source of events.The variable supports data binding.When set, any attempt to directly change the property results in a call to IPropertyNotifySink::OnRequestEdit. The implementation of OnRequestEdit determines if the change is accepted.The variable is displayed to the user as bindable. VARFLAG_FBINDABLE must also be set.The variable is the single property that best represents the object. Only one variable in type information can have this attribute.The variable should not be displayed to the user in a browser, although it exists and is bindable.The variable should not be accessible from macro languages. This flag is intended for system-level variables or variables that you do not want type browsers to display.Permits an optimization in which the compiler looks for a member named "xyz" on the type of abc. If such a member is found and is flagged as an accessor function for an element of the default collection, then a call is generated to that member function. Permitted on members in dispinterfaces and interfaces; not permitted on modules.The variable is the default display in the user interface.The variable appears in an object browser, but not in a properties browser.Tags the interface as having default behaviors.The variable is mapped as individual bindable properties.Specifies the variable type.Learn more about this API from docs.microsoft.com.The variable is a field or member of the type. It exists at a fixed offset within each instance of the type.There is only one instance of the variable.The VARDESC describes a symbolic constant. There is no memory associated with it.The variable can only be accessed through IDispatch::Invoke.Retrieves the handle to the picture managed within this picture object to a specified location.
A pointer to a variable that receives the handle. The caller is responsible for this handle upon successful return. The variable is set to NULL on failure.
This method supports the standard return values E_FAIL and E_OUTOFMEMORY, as well as the following values. This doc was truncated.
Notes to Callers
The picture object may retain ownership of the picture. However, the caller can be assured that the picture will remain valid until either the caller specifically destroys the picture or the picture object is itself destroyed. The fOwn parameter to OleCreatePictureIndirect determines ownership when the picture object is created. OleLoadPicture forces fOwn to TRUE.Read more on docs.microsoft.com.Retrieves a copy of the palette currently used by the picture object.
A pointer to a variable that receives the palette handle. The variable is set to NULL on failure.
This method supports the standard return values E_FAIL and E_OUTOFMEMORY, as well as the following values. This doc was truncated.
Notes to Callers
If the picture object has ownership of the picture, it also has ownership of the palette and will destroy it when the object is itself destroyed. Otherwise the caller owns the palette. The fOwn parameter to OleCreatePictureIndirect determines ownership. OleLoadPicture sets fOwn to TRUE to indicate that the picture object owns the palette.Read more on docs.microsoft.com.Retrieves the current type of the picture contained in the picture object.
Pointer to a variable that receives the picture type. The Type property can have any one of the values contained in the PICTYPE enumeration.
This method supports the standard return value E_FAIL, as well as the following values. This doc was truncated.Learn more about this API from docs.microsoft.com.Retrieves the current width of the picture in the picture object.
A pointer to a variable that receives the width.
This method supports the standard return value E_FAIL, as well as the following values. This doc was truncated.Learn more about this API from docs.microsoft.com.Retrieves the current height of the picture in the picture object.
A pointer to a variable that receives the height.
This method supports the standard return value E_FAIL, as well as the following values. This doc was truncated.Learn more about this API from docs.microsoft.com.Renders (draws) a specified portion of the picture defined by the offset (xSrc,ySrc) of the source picture and the dimensions to copy (cxSrc,xySrc).
A handle of the device context on which to render the image.
The horizontal coordinate in hdc at which to place the rendered image.
The vertical coordinate in hdc at which to place the rendered image.
The horizontal dimension (width) of the destination rectangle.
The vertical dimension (height) of the destination rectangle
The horizontal offset in the source picture from which to start copying.
The vertical offset in the source picture from which to start copying.
The horizontal extent to copy from the source picture.
The vertical extent to copy from the source picture.
A pointer to a rectangle containing the position of the destination within a metafile device context if hdc is a metafile DC. Cannot be NULL in such cases.
This method supports the standard return values E_FAIL, E_INVALIDARG, and E_OUTOFMEMORY, as well as the following: This doc was truncated.Learn more about this API from docs.microsoft.com.Assigns a GDI palette to the picture contained in the picture object.
A handle to the GDI palette assigned to the picture.
This method supports the standard return values E_FAIL, E_INVALIDARG, E_OUTOFMEMORY, and S_OK.
Notes to Implementers
Ownership of the palette passed to this method depends on how the picture object was created, as specified by the fOwn parameter to OleCreatePictureIndirect. OleLoadPicture forces fOwn to TRUE; if the object owns the picture, then it takes over ownership of this palette.Read more on docs.microsoft.com.Retrieves the handle of the current device context. This property is valid only for bitmap pictures.
A pointer a variable that receives the device context.
This method supports the standard return value E_FAIL, as well as the following values. This doc was truncated.The CurDC property and the IPicture::SelectPicture method exist to circumvent restrictions in Windows; specifically, that an object can only be selected into exactly one device context at a time. In some cases, a picture object may be permanently selected into a particular device context (for example, a control may use a certain picture for a background). To use this picture property elsewhere, it must be temporarily deselected from its old device context, selected into the new device context for the operation, then reselected back into the old device context. The IPicture::get_CurDC method returns the device context handle into which the picture is currently selected. The IPicture::SelectPicture method selects the picture into a new device context, returning the old device context and the picture's GDI handle. The caller should select the picture back into the old device context when the caller is done with it, as is normal for Windows code.
Notes to Callers
The caller always owns any device contexts passed between it and the picture object. Because the picture object maintains a copy of the HDC, the caller should use a memory device context (created with the CreateCompatibleDC function) and not a screen device context (from GetDC, CreateDC, or BeginPaint), because the screen device contexts are a limited system resource.Read more on docs.microsoft.com.Selects a bitmap picture into a given device context, and returns the device context in which the picture was previously selected as well as the picture's GDI handle. This method works in conjunction with IPicture::get_CurDC.
A handle for the device context in which to select the picture.
A pointer to a variable that receives the previous device context. This parameter can be NULL if the caller does not need this information. Ownership of the device context is always the responsibility of the caller.
A pointer to a variable that receives the GDI handle of the picture. This parameter can be NULL if the caller does not need the handle. Ownership of this handle is determined by the fOwn parameter passed to OleCreatePictureIndirect. Pictures loaded from a stream always own their resources.
This method supports the standard return values E_FAIL, E_INVALIDARG, E_OUTOFMEMORY, and S_OK.Learn more about this API from docs.microsoft.com.Retrieves the current value of the picture's KeepOriginalFormat property.
A pointer to a variable that receives the value of the property.
This method supports the standard return value E_FAIL, as well as the following value. This doc was truncated.Learn more about this API from docs.microsoft.com.Sets the value of the picture's KeepOriginalFormat property.
Specifies the new value to assign to the property.
This method returns S_OK on success and E_FAIL otherwise.Learn more about this API from docs.microsoft.com.Notifies the picture object that its picture resource has changed. This method only calls IPropertyNotifySink::OnChanged with DISPID_PICT_HANDLE for any connected sinks.This method S_OK if it succeeds and E_FAIL if the picture object is uninitialized.Learn more about this API from docs.microsoft.com.Saves the picture's data into a stream in the same format that it would save itself into a file. Bitmaps use the BMP file format, metafiles the WMF format, and icons the ICO format.
A pointer to the stream into which the picture writes its data.
A flag indicating whether to save a copy of the picture in memory.
Pointer to a variable that receives the number of bytes written into the stream. This value can be NULL, indicating that the caller does not require this information.
This method supports the standard return values E_FAIL, E_INVALIDARG, and S_OK.Learn more about this API from docs.microsoft.com.Retrieves the current set of the picture's bit attributes.A pointer to a variable that receives the value of the Attributes property. The Attributes property can contain any combination of the values from the PICTUREATTRIBUTES enumeration.Read more on docs.microsoft.com.This method supports the standard return value E_FAIL, as well as the following values. This doc was truncated.Learn more about this API from docs.microsoft.com.The IID guid for this interface.{7bf80980-bf32-101a-8bbb-00aa00300cab}The IID guid for this interface.{7bf80981-bf32-101a-8bbb-00aa00300cab}Contains parameters to create a picture object through the OleCreatePictureIndirect function.Learn more about this API from docs.microsoft.com.
Create a struct describing the given .
The image type isn't supported.The size of the structure, in bytes.Describes an array, its element type, and its dimension.Learn more about this API from docs.microsoft.com.The element type.The dimension count.A variable-length array containing one element for each dimension.Computes the amount of memory that must be allocated to store this struct, including the specified number of elements in the variable length inline array at the end.Initializes a new instance of a record.
An instance of a record.
This method can return one of these values. This doc was truncated.The caller must allocate the memory of the record by its appropriate size using the GetSize method. RecordInit sets all contents of the record to 0 and the record should hold no resources.Read more on docs.microsoft.com.Releases object references and other values of a record without deallocating the record.
The record to be cleared.
This method can return one of these values. This doc was truncated.RecordClear releases memory blocks held by VT_PTR or VT_SAFEARRAY instance fields. The caller needs to free the instance fields memory, RecordClear will do nothing if there are no resources held.Copies an existing record into the passed in buffer.
The current record instance.
The destination where the record will be copied.
This method can return one of these values. This doc was truncated.RecordCopy will release the resources in the destination first. The caller is responsible for allocating sufficient memory in the destination by calling GetSize or RecordCreate. If RecordCopy fails to copy any of the fields then all fields will be cleared, as though RecordClear had been called.Gets the GUID of the record type.
The class GUID of the TypeInfo that describes the UDT.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Gets the name of the record type.
The name.
This method can return one of these values. This doc was truncated.The caller must free the BSTR by calling SysFreeString.Gets the number of bytes of memory necessary to hold the record instance.
The size of a record instance, in bytes.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Retrieves the type information that describes a UDT or safearray of UDTs.
The information type of the record.
This method can return one of these values. This doc was truncated.AddRef is called on the pointer ppTypeInfo.Returns a pointer to the VARIANT containing the value of a given field name.
The instance of a record.
The field name.
The VARIANT that you want to hold the value of the field name, szFieldName. On return, places a copy of the field's value in the variant.
This method can return one of these values. This doc was truncated.The VARIANT that you pass in contains a copy of the field's value upon return. If you modify the VARIANT then the underlying record field does not change. The caller allocates memory of the VARIANT. The method VariantClear is called for pvarField before copying.Read more on docs.microsoft.com.Returns a pointer to the value of a given field name without copying the value and allocating resources.
The instance of a record.
The name of the field.
The VARIANT that will contain the UDT upon return.
Receives the value of the field upon return.
This method can return one of these values. This doc was truncated.Upon return, the VARIANT you pass contains a direct pointer to the record's field, ppvDataCArray. If you modify the VARIANT, then the underlying record field will change. The caller allocates memory of the VARIANT, but does not own the memory so cannot free pvarField. This method calls VariantClear for pvarField before filling in the requested field.Read more on docs.microsoft.com.Puts a variant into a field.The only legal values for the wFlags parameter is INVOKE_PROPERTYPUT or INVOKE_PROPERTYPUTREF. If INVOKE_PROPERTYPUTREF is passed in then PutField just assigns the value of the variant that is passed in to the field using normal coercion rules. If INVOKE_PROPERTYPUT is passed in then specific rules apply. If the field is declared as a class that derives from IDispatch and the field's value is NULL then an error will be returned. If the field's value is not NULL then the variant will be passed to the default property supported by the object referenced by the field. If the field is not declared as a class derived from IDispatch then an error will be returned. If the field is declared as a variant of type VT_Dispatch then the default value of the object is assigned to the field. Otherwise, the variant's value is assigned to the field.Read more on docs.microsoft.com.
The pointer to an instance of the record.
The name of the field of the record.
The pointer to the variant.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Passes ownership of the data to the assigned field by placing the actual data into the field.
The only legal values for the wFlags parameter is INVOKE_PROPERTYPUT or INVOKE_PROPERTYPUTREF.
An instance of the record described by IRecordInfo.
The name of the field of the record.
The variant to be put into the field.
This method can return one of these values. This doc was truncated.Learn more about this API from docs.microsoft.com.Gets the names of the fields of the record.
The number of names to return.
The name of the array of type BSTR. If the rgBstrNames parameter is NULL, then pcNames is returned with the number of field names. It the rgBstrNames parameter is not NULL, then the string names contained in rgBstrNames are returned. If the number of names in pcNames and rgBstrNames are not equal then the lesser number of the two is the number of returned field names. The caller needs to free the BSTRs inside the array returned in rgBstrNames.Read more on docs.microsoft.com.This method can return one of these values. This doc was truncated.The caller should allocate memory for the array of BSTRs. If the array is larger than needed, set the unused portion to 0. On return, the caller will need to free each contained BSTR using SysFreeString. In case of out of memory, pcNames points to error code.Read more on docs.microsoft.com.Determines whether the record that is passed in matches that of the current record information.
The information of the record.
This doc was truncated.Learn more about this API from docs.microsoft.com.Allocates memory for a new record, initializes the instance and returns a pointer to the record.This method returns a pointer to the created record.The memory is set to zeros before it is returned. The records created must be freed by calling RecordDestroy.Read more on docs.microsoft.com.Creates a copy of an instance of a record to the specified location.
An instance of the record to be copied.
The new record with data copied from pvSource.
This method can return one of these values. This doc was truncated.The records created must be freed by calling RecordDestroy.Releases the resources and deallocates the memory of the record.
An instance of the record to be destroyed.
This method can return one of these values. This doc was truncated.RecordClear is called to release the resources held by the instance of a record without deallocating memory.
Note This method can only be called on records allocated through RecordCreate and RecordCreateCopy. If you allocate the record yourself, you cannot call this method.
Read more on docs.microsoft.com.The IID guid for this interface.{0000002f-0000-0000-c000-000000000046}Contains information needed for transferring a structure element, parameter, or function return value between processes.Learn more about this API from docs.microsoft.com.The default value for the parameter, if PARAMFLAG_FHASDEFAULT is specified in wParamFlags.The parameter flags. See PARAMFLAG Constants.Contains information about the default value of a parameter.Learn more about this API from docs.microsoft.com.The size of the structure.The default value of the parameter.Describe the type of a picture object as returned by IPicture get\_Type, as well as to describe the type of picture in the picType member of the PICTDESC structure that is passed to OleCreatePictureIndirect.Learn more about this API from docs.microsoft.com.VARIANTARG describes arguments passed within DISPPARAMS, and VARIANT to specify variant data that cannot be passed by reference.Learn more about this API from docs.microsoft.com.
Converts the given object to .
Specifies the variant types.The following table shows where these values can be used. This doc was truncated.Read more on docs.microsoft.com.Not specified.Null.A 2-byte integer.A 4-byte integer.A 4-byte real.An 8-byte real.Currency.A date.A string.An IDispatch pointer.An SCODE value.A Boolean value. True is -1 and false is 0.A variant pointer.An IUnknown pointer.A 16-byte fixed-pointer value.A character.An unsigned character.An unsigned short.An unsigned long.A 64-bit integer.A 64-bit unsigned integer.An integer.An unsigned integer.A C-style void.An HRESULT value.A pointer type.A safe array. Use VT_ARRAY in VARIANT.A C-style array.A user-defined type.A null-terminated string.A wide null-terminated string.A user-defined type.A signed machine register size width.An unsigned machine register size width.A FILETIME value.Length-prefixed bytes.The name of the stream follows.The name of the storage follows.The stream contains an object.The storage contains an object.The blob contains an object.A clipboard format.A class ID.A stream with a GUID version.Reserved.A simple counted array.A SAFEARRAY pointer.A void pointer for local use.
Returns if built-in COM interop is supported. When using AOT or trimming this will
return .
Gets a pointer for the specified for the given . Throws if
the desired pointer can not be obtained.
Attempts to get a pointer for the specified for the given .
Attempts to get a pointer for the specified for the given .
Gets the specified interface for the given . Throws if
the desired pointer can not be obtained.
Attempts to get the specified interface for the given .
The requested pointer or if unsuccessful.
Queries for the given interface and releases it.
Note that this method should only be used for the purposes of checking if the object supports a given interface.
If that interface is needed, it is best try to get the ComScope directly to avoid querying twice.
Attempts to get the specified interface for the given .
Typically either or . Check for success, not
specific results.
The requested pointer or if unsuccessful.
Attempts to unwrap a ComWrapper CCW as a particular managed object.
Attempts to get a managed wrapper of the specified type for the given COM interface.
When , releases the original whether successful or not.
Returns if the given is projected as the given .
capable wrapper for .
is .
Find the given interface's from the specified type library.
vtable population hook for CsWin32's generated implementation.
Contains strings that identify the driver, device, and output port names for a printer.
Learn more about this API from learn.microsoft.com.
Manually copied from a 64 bit project CsWin32 generated wrapper. We can't directly use CsWin32 for this as it
technically isn't compatible with AnyCPU. For our usages this works fine on both 32 bit and 64 bit.
This is defined with single byte packing on 32 bit, but there are no gaps as everything naturally packs with no
gaps on 32 bit. Issues would arise if this was contained in another native struct where it wouldn't start 32 bit
aligned due to the single byte packing.
https://github.com/microsoft/CsWin32/issues/882
Type: WORD The offset, in characters, from the beginning of this structure to a null-terminated string that contains the file name (without the extension) of the device driver. On input, this string is used to determine the printer to display initially in the dialog box.Read more on learn.microsoft.com.Type: WORD The offset, in characters, from the beginning of this structure to the null-terminated string that contains the name of the device.Read more on learn.microsoft.com.Type: WORD The offset, in characters, from the beginning of this structure to the null-terminated string that contains the device name for the physical output medium (output port).Read more on learn.microsoft.com.Type: WORD Indicates whether the strings contained in the DEVNAMES structure identify the default printer. This string is used to verify that the default printer has not changed since the last print operation. If any of the strings do not match, a warning message is displayed informing the user that the document may need to be reformatted. On output, the wDefault member is changed only if the Print Setup dialog box was displayed and the user chose the OK button. The DN_DEFAULTPRN flag is used if the default printer was selected. If a specific printer is selected, the flag is not used. All other flags in this member are reserved for internal use by the dialog box procedure for the Print property sheet or Print dialog box.Read more on learn.microsoft.com.
Contains information that the PrintDlgEx function uses to initialize the Print property sheet. After the user
closes the property sheet, the system uses this structure to return information about the user's selections.
Read more on learn.microsoft.com.
Manually copied from a 64 bit project CsWin32 generated wrapper. We can't directly use CsWin32 for this as it
technically isn't compatible with AnyCPU. For our usages this works fine on both 32 bit and 64 bit.
This is defined with single byte packing on 32 bit, but there are no gaps as everything naturally packs with no
gaps on 32 bit. Issues would arise if this was contained in another native struct where it wouldn't start 32 bit
aligned due to the single byte packing.
https://github.com/microsoft/CsWin32/issues/882
Type: DWORD The structure size, in bytes.Read more on learn.microsoft.com.Type: HWND A handle to the window that owns the property sheet. This member must be a valid window handle; it cannot be NULL.Read more on learn.microsoft.com.Type: HGLOBAL A handle to a movable global memory object that contains a DEVMODE structure. If hDevMode is not NULL on input, you must allocate a movable block of memory for the DEVMODE structure and initialize its members. The PrintDlgEx function uses the input data to initialize the controls in the property sheet. When PrintDlgEx returns, the DEVMODE members indicate the user's input. If hDevMode is NULL on input, PrintDlgEx allocates memory for the DEVMODE structure, initializes its members to indicate the user's input, and returns a handle that identifies it. For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic.Read more on learn.microsoft.com.Type: HGLOBAL A handle to a movable global memory object that contains a DEVNAMES structure. If hDevNames is not NULL on input, you must allocate a movable block of memory for the DEVNAMES structure and initialize its members. The PrintDlgEx function uses the input data to initialize the controls in the property sheet. When PrintDlgEx returns, the DEVNAMES members contain information for the printer chosen by the user. You can use this information to create a device context or an information context. The hDevNames member can be NULL, in which case, PrintDlgEx allocates memory for the DEVNAMES structure, initializes its members to indicate the user's input, and returns a handle that identifies it. For more information about the hDevMode and hDevNames members, see the Remarks section at the end of this topic.Read more on learn.microsoft.com.Type: HDC A handle to a device context or an information context, depending on whether the Flags member specifies the PD_RETURNDC or PC_RETURNIC flag. If neither flag is specified, the value of this member is undefined. If both flags are specified, PD_RETURNDC has priority.Read more on learn.microsoft.com.Type: DWORDType: DWORDType: DWORD A set of bit flags that can exclude items from the printer driver property pages in the Print property sheet. This value is used only if the PD_EXCLUSIONFLAGS flag is set in the Flags member. Exclusion flags should be used only if the item to be excluded will be included on either the General page or on an application-defined page in the Print property sheet. This member can specify the following flag.Read more on learn.microsoft.com.Type: DWORD On input, set this member to the initial number of page ranges specified in the lpPageRanges array. When the PrintDlgEx function returns, nPageRanges indicates the number of user-specified page ranges stored in the lpPageRanges array. If the PD_NOPAGENUMS flag is specified, this value is not valid.Read more on learn.microsoft.com.Type: DWORD The size, in array elements, of the lpPageRanges buffer. This value indicates the maximum number of page ranges that can be stored in the array. If the PD_NOPAGENUMS flag is specified, this value is not valid. If the PD_NOPAGENUMS flag is not specified, this value must be greater than zero.Read more on learn.microsoft.com.Type: LPPRINTPAGERANGE Pointer to a buffer containing an array of PRINTPAGERANGE structures. On input, the array contains the initial page ranges to display in the Pages edit control. When the PrintDlgEx function returns, the array contains the page ranges specified by the user. If the PD_NOPAGENUMS flag is specified, this value is not valid. If the PD_NOPAGENUMS flag is not specified, lpPageRanges must be non-NULL.Read more on learn.microsoft.com.Type: DWORD The minimum value for the page ranges specified in the Pages edit control. If the PD_NOPAGENUMS flag is specified, this value is not valid.Read more on learn.microsoft.com.Type: DWORD The maximum value for the page ranges specified in the Pages edit control. If the PD_NOPAGENUMS flag is specified, this value is not valid.Read more on learn.microsoft.com.Type: DWORD Contains the initial number of copies for the Copies edit control if hDevMode is NULL; otherwise, the dmCopies member of the DEVMODE structure contains the initial value. When PrintDlgEx returns, nCopies contains the actual number of copies the application must print. This value depends on whether the application or the printer driver is responsible for printing multiple copies. If the PD_USEDEVMODECOPIESANDCOLLATE flag is set in the Flags member, nCopies is always 1 on return, and the printer driver is responsible for printing multiple copies. If the flag is not set, the application is responsible for printing the number of copies specified by nCopies. For more information, see the description of the PD_USEDEVMODECOPIESANDCOLLATE flag.Read more on learn.microsoft.com.Type: HINSTANCE If the PD_ENABLEPRINTTEMPLATE flag is set in the Flags member, hInstance is a handle to the application or module instance that contains the dialog box template named by the lpPrintTemplateName member. If the PD_ENABLEPRINTTEMPLATEHANDLE flag is set in the Flags member, hInstance is a handle to a memory object containing a dialog box template. If neither of the template flags is set in the Flags member, hInstance should be NULL.Read more on learn.microsoft.com.Type: LPCTSTR The name of the dialog box template resource in the module identified by the hInstance member. This template replaces the default dialog box template in the lower portion of the General page. The default template contains controls similar to those of the Print dialog box. This member is ignored unless the PD_ENABLEPRINTTEMPLATE flag is set in the Flags member.Read more on learn.microsoft.com.Type: LPUNKNOWN A pointer to an application-defined callback object. The object should contain the IPrintDialogCallback class to receive messages for the child dialog box in the lower portion of the General page. The callback object should also contain the IObjectWithSite class to receive a pointer to the IPrintDialogServices interface. The PrintDlgEx function calls IUnknown::QueryInterface on the callback object for both IID_IPrintDialogCallback and IID_IObjectWithSite to determine which interfaces are supported. If you do not want to retrieve any of the callback information, set lpCallback to NULL.Read more on learn.microsoft.com.Type: DWORD The number of property page handles in the lphPropertyPages array.Read more on learn.microsoft.com.Type: HPROPSHEETPAGE* Contains an array of property page handles to add to the Print property sheet. The additional property pages follow the General page. Use the CreatePropertySheetPage function to create these additional pages. When the PrintDlgEx function returns, all the HPROPSHEETPAGE handles in the lphPropertyPages array have been destroyed. If nPropertyPages is zero, lphPropertyPages should be NULL.Read more on learn.microsoft.com.Type: DWORD The property page that is initially displayed. To display the General page, specify START_PAGE_GENERAL. Otherwise, specify the zero-based index of a property page in the array specified in the lphPropertyPages member. For consistency, it is recommended that the property sheet always be started on the General page.Read more on learn.microsoft.com.Type: DWORD
Represents a range of pages in a print job. A print job can have more than one page range. This information is
supplied in the structure when calling the function.Learn more about this API from learn.microsoft.com.
Manually copied from a 64 bit project CsWin32 generated wrapper. We can't directly use CsWin32 for this as it
technically isn't compatible with AnyCPU. For our usages this works fine on both 32 bit and 64 bit.
This is defined with single byte packing on 32 bit, but there are no gaps as everything naturally packs with no
gaps on 32 bit. Issues would arise if this was contained in another native struct where it wouldn't start 32 bit
aligned due to the single byte packing.
https://github.com/microsoft/CsWin32/issues/882
Type: DWORD The first page of the range.Read more on learn.microsoft.com.Type: DWORD The last page of the range.Read more on learn.microsoft.com.Contains information about an icon or a cursor.For monochrome icons, the hbmMask is twice the height of the icon (with the AND mask on top and the XOR mask on the bottom), and hbmColor is NULL. Also, in this case the height should be an even multiple of two. For color icons, the hbmMask and hbmColor bitmaps are the same size, each of which is the size of the icon. You can use a GetObject function to get contents of hbmMask and hbmColor in the BITMAP structure. The bitmap bits can be obtained with call to GetDIBits on the bitmaps in this structure.Read more on docs.microsoft.com.Type: BOOL Specifies whether this structure defines an icon or a cursor. A value of TRUE specifies an icon; FALSE specifies a cursor.Read more on docs.microsoft.com.Type: DWORD The x-coordinate of a cursor's hot spot. If this structure defines an icon, the hot spot is always in the center of the icon, and this member is ignored.Read more on docs.microsoft.com.Type: DWORD The y-coordinate of the cursor's hot spot. If this structure defines an icon, the hot spot is always in the center of the icon, and this member is ignored.Read more on docs.microsoft.com.Type: HBITMAP A handle to the icon monochrome mask bitmap.Read more on docs.microsoft.com.Type: HBITMAP A handle to the icon color bitmap.Read more on docs.microsoft.com.Contains the scalable metrics associated with the nonclient area of a nonminimized window. (Unicode)If the iPaddedBorderWidth member of the NONCLIENTMETRICS structure is present, this structure is 4 bytes larger than for an application that is compiled with _WIN32_WINNT less than or equal to 0x0502. For more information about conditional compilation, see Using the Windows Headers. Windows Server 2003 and Windows XP/2000: If an application that is compiled for Windows Server 2008 or Windows Vista must also run on Windows Server 2003 or Windows XP/2000, use the GetVersionEx function to check the operating system version at run time and, if the application is running on Windows Server 2003 or Windows XP/2000, subtract the size of the iPaddedBorderWidth member from the cbSize member of the NONCLIENTMETRICS structure before calling the SystemParametersInfo function.> [!NOTE] > The winuser.h header defines NONCLIENTMETRICS 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).Read more on docs.microsoft.com.The size of the structure, in bytes. The caller must set this to sizeof(NONCLIENTMETRICS). For information about application compatibility, see Remarks.The thickness of the sizing border, in pixels. The default is 1 pixel.The width of a standard vertical scroll bar, in pixels.The height of a standard horizontal scroll bar, in pixels.The width of caption buttons, in pixels.The height of caption buttons, in pixels.A LOGFONT structure that contains information about the caption font.The width of small caption buttons, in pixels.The height of small captions, in pixels.A LOGFONT structure that contains information about the small caption font.The width of menu-bar buttons, in pixels.The height of a menu bar, in pixels.A LOGFONT structure that contains information about the font used in menu bars.A LOGFONT structure that contains information about the font used in status bars and tooltips.A LOGFONT structure that contains information about the font used in message boxes.The thickness of the padded border, in pixels. The default value is 4 pixels. The iPaddedBorderWidth and iBorderWidth members are combined for both resizable and nonresizable windows in the Windows Aero desktop experience. To compile an application that uses this member, define _WIN32_WINNT as 0x0600 or later. For more information, see Remarks. Windows Server 2003 and Windows XP/2000: This member is not supported.Read more on docs.microsoft.com.Contains information about the high contrast accessibility feature. (Unicode)An application uses this structure when calling the[SystemParametersInfoW function](nf-winuser-systemparametersinfow.md) with the SPI_GETHIGHCONTRAST or SPI_SETHIGHCONTRAST value. When using SPI_GETHIGHCONTRAST, an application must specify the cbSize member of the HIGHCONTRAST structure; the SystemParametersInfo function fills the remaining members. An application must specify all structure members when using the SPI_SETHIGHCONTRAST value.> [!NOTE] > The winuser.h header defines HIGHCONTRAST 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).Read more on docs.microsoft.com.Type: UINT Specifies the size, in bytes, of this structure.Read more on docs.microsoft.com.Type: DWORDType: LPTSTR Points to a string that contains the name of the color scheme that will be set to the default scheme. The system allocates this buffer, free it with LocalFree.Read more on docs.microsoft.com.The length of the inline array.
Gets a ref to an individual element of the inline array.
⚠ Important ⚠: When this struct is on the stack, do not let the returned reference outlive the stack frame that defines it.
Gets this inline array as a span.
⚠ Important ⚠: When this struct is on the stack, do not let the returned span outlive the stack frame that defines it.
Gets this inline array as a span.
⚠ Important ⚠: When this struct is on the stack, do not let the returned span outlive the stack frame that defines it.
Copies the fixed array to a new string up to the specified length regardless of whether there are null terminating characters.
Thrown when is less than 0 or greater than .
Copies the fixed array to a new string, stopping before the first null terminator character or at the end of the fixed array (whichever is shorter).
The IID guid for this interface.The reference that is returned comes from a permanent memory address, and is therefore safe to convert to a pointer and pass around or hold long-term.
Non generic interface that allows constraining against a COM wrapper type directly. COM structs should
implement .
Windows Forms implementation.
Deriving from allows us to leverage the functionality the runtime
has implemented for source generated "RCW"s, including support for adaption
when built-in COM support is available (EnableGeneratedComInterfaceComImportInterop).
It isn't immediately clear how we could merge with this as there is no
strategy for . We rely
on to apply the needed vtable functionality and it doesn't appear that we
can apply without manually implementing (or source generating)
on our exposed classes.
The implementation for WinForm's COM interop usages.
For the given pointer unwrap the associated managed object and use it to
invoke .
Handles exceptions and converts to .
For the given pointer unwrap the associated managed object and use it to
invoke .