Partager via


IVsFontAndColorEvents.OnFontChanged Method

Called by the Visual Studio environment when the fonts of one Categories of the items listed in the Display Items drop-down list is modified.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Déclaration
Function OnFontChanged ( _
    ByRef rguidCategory As Guid, _
    pInfo As FontInfo(), _
    pLOGFONT As LOGFONTW(), _
    HFONT As UInteger _
) As Integer
'Utilisation
Dim instance As IVsFontAndColorEvents
Dim rguidCategory As Guid
Dim pInfo As FontInfo()
Dim pLOGFONT As LOGFONTW()
Dim HFONT As UInteger
Dim returnValue As Integer

returnValue = instance.OnFontChanged(rguidCategory, _
    pInfo, pLOGFONT, HFONT)
int OnFontChanged(
    ref Guid rguidCategory,
    FontInfo[] pInfo,
    LOGFONTW[] pLOGFONT,
    uint HFONT
)
int OnFontChanged(
    [InAttribute] Guid% rguidCategory, 
    [InAttribute] array<FontInfo>^ pInfo, 
    [InAttribute] array<LOGFONTW>^ pLOGFONT, 
    [InAttribute] unsigned int HFONT
)
abstract OnFontChanged : 
        rguidCategory:Guid byref * 
        pInfo:FontInfo[] * 
        pLOGFONT:LOGFONTW[] * 
        HFONT:uint32 -> int 
function OnFontChanged(
    rguidCategory : Guid, 
    pInfo : FontInfo[], 
    pLOGFONT : LOGFONTW[], 
    HFONT : uint
) : int

Parameters

  • rguidCategory
    Type: System.Guid%
    [in] Specifies the GUID of the affected category. Compare this GUID to the GUID of your category to determine whether the event applies to your VSPackage.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsFontAndColorEvents::OnFontChanged(
   [in] REFGUID rguidCategory,
   [in] const FontInfo *pInfo,
   [in] const LOGFONTW *pLOGFONT,
   [in] HFONT hFont
);

Fonts are defined for on a Category basis, not a Display Items basis: all DisplayItems in a Category share the same font.

The bFaceNameValid, bPointSizeValid, and bCharSetValid, members of the returned FontInfo object (pInfo) indicate whether the corresponding font attributes have changed. Invalid attributes should be ignored. If all attributes are marked as invalid, pLOGFONT is NULL (C++) or nulla null reference (Nothing in Visual Basic) (C#).

The hFont parameter is included so that you need not create two separate HFONT objects, as creating an HFONT object is a resource-intensive activity. The parameter may be nulla null reference (Nothing in Visual Basic), in which case the method creates an HFONT object as needed.

.NET Framework Security

See Also

Reference

IVsFontAndColorEvents Interface

IVsFontAndColorEvents Members

Microsoft.VisualStudio.Shell.Interop Namespace