[StructLayout(LayoutKind.Sequential)]
public struct WALLPAPEROPT
{
public static readonly int SizeOf = Marshal.SizeOf(typeof(WALLPAPEROPT));
public int dwSize;
public WallPaperStyle dwStyle;
}
<StructLayout(LayoutKind.Sequential)> _
Public Structure WALLPAPEROPT
Public Shared ReadOnly SizeOf As Integer
Public dwSize As Integer
Public dwStyle As WallPaperStyle
Shared Sub New()
WALLPAPEROPT.SizeOf = Marshal.SizeOf(GetType(WALLPAPEROPT))
End Sub
End Structure
None.
WALLPAPEROPT opts = new WALLPAPEROPT();
opts.dwSize = WALLPAPEROPT.SizeOf;
See WallPaperStyle.