Partager via


IVsFontAndColorEvents.OnFontChanged Method

Definition

Overloads

OnFontChanged(Guid, FontInfo[], LOGFONTW[], IntPtr)
OnFontChanged(Guid, FontInfo[], LOGFONTW[], UInt32)

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.

OnFontChanged(Guid, FontInfo[], LOGFONTW[], IntPtr)

public:
 int OnFontChanged(Guid % rguidCategory, cli::array <Microsoft::VisualStudio::Shell::Interop::FontInfo> ^ pInfo, cli::array <Microsoft::VisualStudio::Shell::Interop::LOGFONTW> ^ pLOGFONT, IntPtr HFONT);
public int OnFontChanged (ref Guid rguidCategory, Microsoft.VisualStudio.Shell.Interop.FontInfo[] pInfo, Microsoft.VisualStudio.Shell.Interop.LOGFONTW[] pLOGFONT, IntPtr HFONT);
abstract member OnFontChanged : Guid * Microsoft.VisualStudio.Shell.Interop.FontInfo[] * Microsoft.VisualStudio.Shell.Interop.LOGFONTW[] * nativeint -> int
Public Function OnFontChanged (ByRef rguidCategory As Guid, pInfo As FontInfo(), pLOGFONT As LOGFONTW(), HFONT As IntPtr) As Integer

Parameters

rguidCategory
Guid
pInfo
FontInfo[]
pLOGFONT
LOGFONTW[]
HFONT
IntPtr

nativeint

Returns

Applies to

OnFontChanged(Guid, FontInfo[], LOGFONTW[], UInt32)

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.

public:
 int OnFontChanged(Guid % rguidCategory, cli::array <Microsoft::VisualStudio::Shell::Interop::FontInfo> ^ pInfo, cli::array <Microsoft::VisualStudio::Shell::Interop::LOGFONTW> ^ pLOGFONT, System::UInt32 HFONT);
public int OnFontChanged (ref Guid rguidCategory, Microsoft.VisualStudio.Shell.Interop.FontInfo[] pInfo, Microsoft.VisualStudio.Shell.Interop.LOGFONTW[] pLOGFONT, uint HFONT);
abstract member OnFontChanged : Guid * Microsoft.VisualStudio.Shell.Interop.FontInfo[] * Microsoft.VisualStudio.Shell.Interop.LOGFONTW[] * uint32 -> int
Public Function OnFontChanged (ByRef rguidCategory As Guid, pInfo As FontInfo(), pLOGFONT As LOGFONTW(), HFONT As UInteger) As Integer

Parameters

rguidCategory
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.

pInfo
FontInfo[]

[in] Pointer to a FontInfo structure that contains font identification information.

pLOGFONT
LOGFONTW[]

[in] Pointer to a LOGFONTW structure containing the attributes of the font.

HFONT
UInt32

[in] Pointer to a font object.

Returns

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 null (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 null, in which case the method creates an HFONT object as needed.

Applies to