This documentation is archived and is not being maintained.

IVsSccManager2.GetSccGlyph Method

This method is called by projects to discover the source control glyphs to use on files and the files' source control status; this is the only way to get status.

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

int GetSccGlyph (
	[InAttribute] int cFiles,
	[InAttribute] string[] rgpszFullPaths,
	[OutAttribute] VsStateIcon[] rgsiGlyphs,
	[OutAttribute] uint[] rgdwSccStatus
int GetSccGlyph (
	/** @attribute InAttribute() */ int cFiles, 
	/** @attribute InAttribute() */ String[] rgpszFullPaths, 
	/** @attribute OutAttribute() */ VsStateIcon[] rgsiGlyphs, 
	/** @attribute OutAttribute() */ UInt32[] rgdwSccStatus
function GetSccGlyph (
	cFiles : int, 
	rgpszFullPaths : String[], 
	rgsiGlyphs : VsStateIcon[], 
	rgdwSccStatus : uint[]
) : int



[in] Count of files. It should be greater than 0 if there are files under source code control. Currently, the environment supports only a count of 1.


[in] Array of paths to files; cannot be a null reference (Nothing in Visual Basic).


[out] Array of icons corresponding to rgpszFullPaths; cannot be a null reference (Nothing in Visual Basic). See VsStateIcon for additional information.


[out] Specifies status for corresponding rgpszFullPaths entry. For a list of possible values, see File Status Code Enumerator. This parameter can be a null reference (Nothing in Visual Basic).

Return Value

The method returns S_OK if at least one of the files is controlled, S_FALSE if none is controlled.

COM Signature

From ivssccmanager2.idl

HRESULT GetSccGlyph(
   [in] int cFiles,
   [in, size_is(cFiles)] const LPCOLESTR rgpszFullPaths[],
   [out, size_is(cFiles)] VsStateIcon rgsiGlyphs[],
   [out, size_is(cFiles)] DWORD rgdwSccStatus[]

This method is called by projects to discover the source control glyphs to use on files. When a project first opens at startup, it calls this method to get the glyphs for the project. After startup, the environment provides glyphs to the project using SccGlyphChanged. The glyphs are denoted by the environment's icon index (VsStateIcon enumeration).

How This Method is Used by Projects

The source control status per file is also optionally returned; however, projects are encouraged to use the glyphs, but not to cache source control status. Call this method each time status is needed, rather than maintaining your own record of status bits.

When the project receives the GetProperty method (VSHPROPID_StateIconIndex) call from the environment, it should call GetSccGlyph for the appropriate file or files for the VSITEMID specified in that call. The project does not need to store the returned state icon—the environment will store it. It is important to note that a project is allowed to call GetSccGlyph when called by the environment with GetProperty, but when it is called by SccGlyphChanged, the project is handed the glyphs and does not need to call GetSccGlyph again. The project can immediately pass the given glyphs to the environment using the SetProperty method, unless the parameters to SccGlyphChanged are a null reference (Nothing in Visual Basic). In this case, the project should call the environment for all of the VSITEMID s in the project.

Be aware of the following:

  • If a file is under source control, the SCC_STATUS_CONTROLLED flag is set.

  • If the current user checks out a file into the designated working directory, the SCC_STATUS_CHECKEDOUT flag is set.