Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

DTTOPTS (Structures)
 
.
Summary

C# Definition:

delegate int DTT_CALLBACK_PROC(IntPtr hdc, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLen, ref RECT rc, int flags, IntPtr lParam);

[StructLayout(LayoutKind.Sequential)]
struct DTTOPTS
{
    public int dwSize;
    public DTT dwFlags;
    public int crText;
    public int crBorder;
    public int crShadow;
    public TEXTSHADOWTYPE iTextShadowType;
    public System.Drawing.Point ptShadowOffset;
    public uint dwFlags;
    public COLORREF crText;
    public COLORREF crBorder;
    public COLORREF crShadow;
    public int iTextShadowType;
    public POINT ptShadowOffset;
    public int iBorderSize;
    public int iFontPropId;
    public int iColorPropId;
    public int iStateId;
    [MarshalAs(UnmanagedType.Bool)]
    public bool fApplyOverlay;
    public int iGlowSize;
    [MarshalAs(UnmanagedType.FunctionPtr)]
    public DTT_CALLBACK_PROC pfnDrawTextCallback;
    public IntPtr lParam;
}

VB Definition:

Structure DTTOPTS
   Public TODO
End Structure

User-Defined Field Types:

DTT, TEXTSHADOWTYPE

Alternate C# Definition

public delegate int DrawThemeTextCallback(IntPtr hdc, [MarshalAs(UnmanagedType.LPWStr)] string text, int textLen, ref RECT rc, int flags, IntPtr lParam);

[StructLayout(LayoutKind.Sequential)]
public struct DrawThemeTextOptions
{
   private int dwSize;
   private DrawThemeTextOptionsFlags dwFlags;
   private int crText;
   private int crBorder;
   private int crShadow;
   private TextShadowType iTextShadowType;
   private System.Drawing.Point ptShadowOffset;
   private int iBorderSize;
   private int iFontPropId;
   private int iColorPropId;
   private int iStateId;
   [MarshalAs(UnmanagedType.Bool)]
   private bool fApplyOverlay;
   private int iGlowSize;
   [MarshalAs(UnmanagedType.FunctionPtr)]
   private DrawThemeTextCallback pfnDrawTextCallback;
   private IntPtr lParam;

   public DrawThemeTextOptions(bool init) : this()
   {
     dwSize = Marshal.SizeOf(typeof(DrawThemeTextOptions));
   }

   public Color AlternateColor
   {
     get { return ColorTranslator.FromWin32(iColorPropId); }
     set
     {
       iColorPropId = ColorTranslator.ToWin32(value);
       dwFlags |= DrawThemeTextOptionsFlags.ColorProp;
     }
   }

   public DrawThemeTextSystemFonts AlternateFont
   {
     get { return (DrawThemeTextSystemFonts)iFontPropId; }
     set
     {
       iFontPropId = (int)value;
       dwFlags |= DrawThemeTextOptionsFlags.FontProp;
     }
   }

   public bool AntiAliasedAlpha
   {
     get { return (dwFlags & DrawThemeTextOptionsFlags.Composited) == DrawThemeTextOptionsFlags.Composited; }
     set { SetFlag(DrawThemeTextOptionsFlags.Composited, value); }
   }

   public bool ApplyOverlay
   {
     get { return fApplyOverlay; }
     set
     {
       fApplyOverlay = value;
       dwFlags |= DrawThemeTextOptionsFlags.ApplyOverlay;
     }
   }

   public Color BorderColor
   {
     get { return ColorTranslator.FromWin32(crBorder); }
     set
     {
       crBorder = ColorTranslator.ToWin32(value);
       dwFlags |= DrawThemeTextOptionsFlags.BorderColor;
     }
   }

   public int BorderSize
   {
     get { return iBorderSize; }
     set
     {
       iBorderSize = value;
       dwFlags |= DrawThemeTextOptionsFlags.BorderSize;
     }
   }

   public DrawThemeTextCallback Callback
   {
     get { return pfnDrawTextCallback; }
     set
     {
       pfnDrawTextCallback = value;
       dwFlags |= DrawThemeTextOptionsFlags.Callback;
     }
   }

   public int GlowSize
   {
     get { return iGlowSize; }
     set
     {
       iGlowSize = value;
       dwFlags |= DrawThemeTextOptionsFlags.GlowSize;
     }
   }

   public IntPtr LParam
   {
     get { return lParam; }
     set { lParam = value; }
   }

   public bool ReturnCalculatedRectangle
   {
     get { return (dwFlags & DrawThemeTextOptionsFlags.CalcRect) == DrawThemeTextOptionsFlags.CalcRect; }
     set { SetFlag(DrawThemeTextOptionsFlags.CalcRect, value); }
   }

   public Color ShadowColor
   {
     get { return ColorTranslator.FromWin32(crShadow); }
     set
     {
       crShadow = ColorTranslator.ToWin32(value);
       dwFlags |= DrawThemeTextOptionsFlags.ShadowColor;
     }
   }

   public Point ShadowOffset
   {
     get { return new Point(ptShadowOffset.X, ptShadowOffset.Y); }
     set
     {
       ptShadowOffset = value;
       dwFlags |= DrawThemeTextOptionsFlags.ShadowOffset;
     }
   }

   public TextShadowType ShadowType
   {
     get { return iTextShadowType; }
     set
     {
       iTextShadowType = value;
       dwFlags |= DrawThemeTextOptionsFlags.ShadowType;
     }
   }

   public Color TextColor
   {
     get { return ColorTranslator.FromWin32(crText); }
     set
     {
       crText = ColorTranslator.ToWin32(value);
       dwFlags |= DrawThemeTextOptionsFlags.TextColor;
     }
   }

   private void SetFlag(DrawThemeTextOptionsFlags f, bool value)
   {
     if (value)
       dwFlags |= f;
     else
       dwFlags &= ~f;
   }
}

Notes:

None.

VB Definition:

Structure DTTOPTS
   Public TODO
End Structure

User-Defined Field Types:

COLORREF, POINT, DTT_CALLBACK_PROC

Notes:

None.

Documentation
DTTOPTS on MSDN

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions