コード例 #1
0
        private void AddCaptionFonts(ResourceDictionary newDictionary)
        {
            NONCLIENTMETRICS nONCLIENTMETRICS = default(NONCLIENTMETRICS);

            nONCLIENTMETRICS.cbSize = Marshal.SizeOf(typeof(NONCLIENTMETRICS));
            if (!NativeMethods.SystemParametersInfo(41, nONCLIENTMETRICS.cbSize, ref nONCLIENTMETRICS, 0))
            {
                newDictionary.Add("VsFont.CaptionFontFamily", this["VsFont.EnvironmentFontFamilyKey"]);
                newDictionary.Add("VsFont.CaptionFontSize", this["VsFont.EnvironmentFontSizeKey"]);
                newDictionary.Add("VsFont.CaptionFontWeight", FontWeights.Normal);
                return;
            }
            FontFamily captionFont = new FontFamily(nONCLIENTMETRICS.lfCaptionFont.lfFaceName);
            double     captionSize = FontSizeFromLOGFONTHeight(nONCLIENTMETRICS.lfCaptionFont.lfHeight);
            FontWeight fontWeight  = FontWeight.FromOpenTypeWeight(nONCLIENTMETRICS.lfCaptionFont.lfWeight);

            newDictionary.Add("VsFont.CaptionFontFamily", captionFont);
            newDictionary.Add("VsFont.CaptionFontSize", captionSize);
            newDictionary.Add("VsFont.CaptionFontWeight", fontWeight);
        }
コード例 #2
0
ファイル: NativeMethods.cs プロジェクト: SLaks/VSEmbed
		internal static extern bool SystemParametersInfo(int uiAction, int uiParam, ref NONCLIENTMETRICS pvParam, int fWinIni);
コード例 #3
0
 internal static extern bool SystemParametersInfo(int uiAction, int uiParam, ref NONCLIENTMETRICS pvParam, int fWinIni);