IVsFontAndColorStorage.OpenCategory(Guid, UInt32) 方法

定義

開啟登錄機碼,其中包含在 [顯示設定:] 下拉式清單中找到之 Cateogry 的字型和色彩資訊。Opens the registry key containing font and color information for a Cateogry found in the Show Settings for: drop-down list.

public:
 int OpenCategory(Guid % rguidCategory, System::UInt32 fFlags);
public int OpenCategory (ref Guid rguidCategory, uint fFlags);
abstract member OpenCategory : Guid * uint32 -> int
Public Function OpenCategory (ByRef rguidCategory As Guid, fFlags As UInteger) As Integer

參數

rguidCategory
Guid

在指定要存取其資訊之顯示專案類別目錄的 GUID。[in] Specifies the GUID of the Category of Display Items whose information is to be accessed.

fFlags
UInt32

在指定如何存取類別的資訊。[in] Specifies how a Category's information is to be accessed. 值取自 __FCSTORAGEFLAGS 列舉。Values are taken from the __FCSTORAGEFLAGS enumeration.

傳回

Int32

如果方法成功,它會傳回 S_OKIf the method succeeds, it returns S_OK. 如果方法失敗,則會傳回錯誤碼。If it fails, it returns an error code.

備註

COM 簽章COM Signature

從 vsshell .idl:From vsshell.idl:

HRESULT IVsFontAndColorStorage::OpenCategory(  
   [in] REFGUID rguidCategory,  
   [in] FCSTORAGEFLAGS fFlags  
);  

類別的目前修改狀態及其顯示專案會儲存在 [HKLM\SOFTWARE\Microsoft \Visual Studio \<Visual Studio 版本 > \FontAndColors \<類別 > ]The current modification state of a Category and its Display Items is stored under [HKLM\SOFTWARE\Microsoft \Visual Studio\<Visual Studio version>\FontAndColors\<Category>]

其中 <Category> 是由參數指定 rguidCategoryWhere <Category> is specify by the rguidCategory parameter.

由呼叫開啟的登錄專案 IVsFontAndColorStorage.OpenCategory 會在下列情況自動關閉:A registry entry opened by a call to IVsFontAndColorStorage.OpenCategory closes automatically when:

藉由呼叫明確地關閉專案 CloseCategory 是很好的作法,因為它可確保沒有任何程式碼讀取或寫入不應預期的類別。Explicitly closing entries by calling CloseCategory is good practice as it ensures that no code reads from or writes to a Category that it is not supposed to.

適用於