Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Structures, prefix the name with the module name and a period.
COLORREF (Structures)
.
C# Definition:
[StructLayout(LayoutKind.Sequential)]
struct COLORREF {
public byte R;
public byte G;
public byte B;
}
// Alternate
[StructLayout(LayoutKind.Sequential)]
public struct COLORREF
{
public uint ColorDWORD;
public COLORREF(uint value) {
this.R = 0;
this.G = 0;
this.B = 0;
this.Value = value & 0x00FFFFFF;
}
[FieldOffset(0)]
public byte R;
[FieldOffset(1)]
public byte G;
[FieldOffset(2)]
public byte B;
[FieldOffset(2)]
public byte G;
[FieldOffset(3)]
public byte R;
[FieldOffset(0)]
public uint Value;
}
VB Definition:
Structure COLORREF
Public R As Byte
Public G As Byte
Public B As Byte
Public Overrides Function ToString() As String
Return String.Format("({0},{1},{2})", R, G, B)
End Function
End Structure
User-Defined Field Types:
None.
Notes:
Actually, there's no COLORREF structure in native Win32. It is typedef-ed to DWORD, which means that in the managed world its direct counterpart is System.Int32 (aka int in C#). So, when faced with interop involving COLORREF'S you'd better treat them as int's. Also have in mind that the color components are stored in reverse order, i.e. the Red component is in the lowest-byte. In short, the format is 0x00BBGGRR. You can use a code similar to the following to obtain a COLORREF: