using System.Runtime.InteropServices; namespace Vanara.PInvoke { public static partial class UxTheme { /// Retrieves the value of a font property. /// Handle to a window's specified theme data. Use OpenThemeData to create an HTHEME. /// HDC. This parameter may be set to NULL. /// Value of type int that specifies the part that contains the font property. See Parts and States. /// Value of type int that specifies the state of the part. See Parts and States. /// /// Value of type int that specifies the property to retrieve. For a list of possible values, see Property Identifiers. /// /// Pointer to a LOGFONT structure that receives the font property value. /// If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. // https://msdn.microsoft.com/en-us/library/windows/desktop/bb759745(v=vs.85).aspx [DllImport(Lib.UxTheme, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)] [PInvokeData("uxtheme.h", MSDNShortId = "bb759745")] public static extern HRESULT GetThemeFont(SafeHTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, out LOGFONT pFont); /// Retrieves the LOGFONT of a system font. /// Handle to theme data. /// Value of type int that specifies a system font. /// Pointer to a LOGFONT structure that receives the font information from this function. /// If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. // https://msdn.microsoft.com/en-us/library/windows/desktop/bb759783(v=vs.85).aspx [DllImport(Lib.UxTheme, SetLastError = false, ExactSpelling = true, CharSet = CharSet.Unicode)] [PInvokeData("uxtheme.h", MSDNShortId = "bb759783")] public static extern HRESULT GetThemeSysFont(SafeHTHEME hTheme, int iFontId, out LOGFONT pFont); } }