本文整理汇总了C++中DeleteKey函数的典型用法代码示例。如果您正苦于以下问题:C++ DeleteKey函数的具体用法?C++ DeleteKey怎么用?C++ DeleteKey使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DeleteKey函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sprintf
/* static public */
HRESULT REGUTIL::UnregisterCOMClass( REFCLSID rclsid,
const char *szProgIDPrefix,
int iVersion,
const char *szClassProgID )
{
char szID[64]; // the class ID to unregister.
char rcCLSID[64]; // CLSID\\szID.
OLECHAR szWID[64]; // helper for the class ID to unregister.
char rcProgID[128]; // szProgIDPrefix.szClassProgID
char rcIndProgID[128]; // rcProgID.iVersion
// format the prog ID values.
sprintf( rcProgID, "%s.%s", szProgIDPrefix, szClassProgID );
sprintf( rcIndProgID, "%s.%d", rcProgID, iVersion );
REGUTIL::_UnregisterClassBase( rclsid, rcProgID, rcIndProgID, rcCLSID );
DeleteKey( rcCLSID, "InprocServer32" );
StringFromGUID2(rclsid, szWID, NumItems( szWID ) );
WideCharToMultiByte( CP_ACP,
0,
szWID,
-1,
szID,
sizeof( szID ),
NULL,
NULL );
DeleteKey( "CLSID", rcCLSID );
return S_OK;
} // REGUTIL::UnregisterCOMClass
示例2: DeleteKey
BOOL CRegKey::DeleteKey(HKEY hKey,LPCWSTR szKey)
{
if (!IsUnicodeSystem())
return DeleteKey(hKey,W2A(szKey));
HKEY hSubKey;
FILETIME ft;
DWORD cb;
WCHAR szSubKey[200];
if (RegOpenKeyExW(hKey,szKey,0,
KEY_ENUMERATE_SUB_KEYS|KEY_SET_VALUE,&hSubKey)!=ERROR_SUCCESS)
return TRUE;
DebugOpenHandle(dhtRegKey,hSubKey,szKey);
for(;;)
{
cb=400;
if (RegEnumKeyExW(hSubKey,0,szSubKey,&cb,NULL,
NULL,NULL,&ft)==ERROR_NO_MORE_ITEMS)
break;
DeleteKey(hSubKey,szSubKey);
}
RegCloseKey(hSubKey);
DebugCloseHandle(dhtRegKey,hSubKey,szKey);
RegDeleteKeyW(hKey,szKey);
return TRUE;
}
示例3: UnregisterServer
//
// Remove the component from the registry.
//
HRESULT UnregisterServer(const CLSID& clsid, // Class ID
const char* szProgID, // IDs
const char* szVerIndProgID) // Programmatic
{
// Convert the CLSID into a char.
char szCLSID[CLSID_STRING_SIZE] ;
CLSIDtoString(clsid, szCLSID, sizeof(szCLSID)) ;
// Build the key CLSID\\{...}
char szKey[64] ;
strcpy(szKey, "CLSID\\") ;
strcat(szKey, szCLSID) ;
// Delete the CLSID Key - CLSID\{...}
LONG lResult = DeleteKey(HKEY_CLASSES_ROOT, szKey) ;
// Delete the version-independent ProgID Key.
if (szVerIndProgID != NULL)
lResult = DeleteKey(HKEY_CLASSES_ROOT, szVerIndProgID) ;
// Delete the ProgID key.
if (szProgID != NULL)
lResult = DeleteKey(HKEY_CLASSES_ROOT, szProgID) ;
return S_OK ;
}
示例4: swprintf
void IniFile::DeleteSection ( wchar_t *section)
{
// deletes a whole INI section in the dictionary
int length;
int i;
wchar_t key[256];
if (section == NULL)
section = INIFile_default_section; // if no section was provided, use empty section name
swprintf (key, 256, L"%s%c", section, INI_SECTION_SEPARATOR); // compose the key
length = (int) wcslen (key); // get the key string length
// for each entry in the dictionary...
for (i = 0; i < Dictionary->entry_count; i++)
{
if (Dictionary->entries[i].key[0] == 0)
continue; // skip empty slots
// does this entry belong to the section we want ?
if (wcsncmp (Dictionary->entries[i].key, key, length) == 0)
DeleteKey ( Dictionary->entries[i].key); // yes, delete it
}
DeleteKey ( section); // and finally delete the section name itself
return;
}
示例5: DelProp
/*
===============
DelProp
===============
*/
void DelProp(void)
{
char sz[4096];
if (edit_entity == NULL)
return;
// Get current selection text
SendMessage(hwndEnt[EntKeyField], WM_GETTEXT, sizeof(sz)-1, (LPARAM)sz);
if (multiple_entities)
{
brush_t *b;
for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
DeleteKey(b->owner, sz);
}
else
DeleteKey(edit_entity, sz);
// refresh the prop listbox
SetKeyValuePairs();
}
示例6: while
/*
subKey を指定した場合は subkey を含むキー以下を削除
subkey が NULL の場合、カレント の配下を削除
*/
BOOL TRegistry::DeleteChildTree(LPSTR subKey)
{
char buf[100];
BOOL ret = TRUE;
if (subKey != NULL && OpenKey(subKey) != TRUE)
return FALSE;
while (EnumKey(0, buf, sizeof(buf)))
{
if ((ret = DeleteChildTree(buf)) != TRUE)
break;
}
if (subKey != NULL)
{
CloseKey();
ret = DeleteKey(subKey) ? ret : FALSE;
}
else {
while (EnumValue(0, buf, sizeof(buf)))
{
if (DeleteValue(buf) != TRUE)
{
ret = FALSE;
break;
}
}
}
return ret;
}
示例7: Select_ClearAllRecursionProtection
void Select_ClearAllRecursionProtection(void)
{
for (entity_t* pEnt=entities.next ; pEnt != &entities ; pEnt=pEnt->next)
{
DeleteKey(pEnt, sKEY_WAYPOINTHIDE_RECURSION_PROTECT);
}
}
示例8: RegEnumKeyEx
void CRegistry::DeleteKey(HKEY hParent, LPCTSTR pszKey)
{
HKEY hKey;
if ( RegOpenKeyEx( hParent, pszKey, 0, KEY_ALL_ACCESS, &hKey ) ) return;
CArray< CString > pList;
for ( DWORD nIndex = 0 ; ; nIndex++ )
{
DWORD dwName = 64; // Input parameter in TCHARs
TCHAR szName[64];
LRESULT lResult = RegEnumKeyEx( hKey, nIndex, szName, &dwName, NULL, NULL, 0, NULL );
if ( lResult != ERROR_SUCCESS ) break;
szName[ dwName ] = 0;
pList.Add( szName );
DeleteKey( hKey, szName );
}
for ( int nItem = pList.GetSize() - 1 ; nItem >= 0 ; nItem-- )
{
RegDeleteKey( hKey, pList.GetAt( nItem ) );
}
if ( lstrlen( pszKey ) > 25 ) // Handle likely initial non-recursive value
RegDeleteKey( HKEY_CURRENT_USER, pszKey );
RegCloseKey( hKey );
}
示例9: DeleteKey
void KeyedArchive::SetMatrix4(const String & key, const Matrix4 &value)
{
DeleteKey(key);
VariantType *variantValue = new VariantType();
variantValue->SetMatrix4(value);
objectMap[key] = variantValue;
}
示例10: main
int main (void)
{
printf ("Hello World\n");
OpenIniFile ("Test.Ini");
#ifdef INIFILE_TEST_READ_AND_WRITE
WriteString ("Test", "Name", "Value");
WriteString ("Test", "Name", "OverWrittenValue");
WriteString ("Test", "Port", "COM1");
WriteString ("Test", "User", "James Brown jr.");
WriteString ("Configuration", "eDriver", "MBM2.VXD");
WriteString ("Configuration", "Wrap", "LPT.VXD");
WriteInt ("IO-Port", "Com", 2);
WriteBool ("IO-Port", "IsValid", 0);
WriteDouble ("TheMoney", "TheMoney", 67892.00241);
WriteInt ("Test" , "ToDelete", 1234);
WriteIniFile ("Test.Ini");
printf ("Key ToDelete created. Check ini file. Any key to continue");
while (!kbhit());
OpenIniFile ("Test.Ini");
DeleteKey ("Test" , "ToDelete");
WriteIniFile ("Test.Ini");
#endif
printf ("[Test] Name = %s\n", ReadString ("Test", "Name", "NotFound"));
printf ("[Test] Port = %s\n", ReadString ("Test", "Port", "NotFound"));
printf ("[Test] User = %s\n", ReadString ("Test", "User", "NotFound"));
printf ("[Configuration] eDriver = %s\n", ReadString ("Configuration", "eDriver", "NotFound"));
printf ("[Configuration] Wrap = %s\n", ReadString ("Configuration", "Wrap", "NotFound"));
printf ("[IO-Port] Com = %d\n", ReadInt ("IO-Port", "Com", 0));
printf ("[IO-Port] IsValid = %d\n", ReadBool ("IO-Port", "IsValid", 0));
printf ("[TheMoney] TheMoney = %1.10lf\n", ReadDouble ("TheMoney", "TheMoney", 111));
CloseIniFile ();
return 0;
}
示例11: main
int main ()
{
DictHndl testHash;
ListHndl testLookUp;
testHash = NewDictionary (10);
InsertKey (testHash, "cat", 123);
InsertKey (testHash, "dog", 234);
InsertKey (testHash, "fog", 2345);
InsertKey (testHash, "fog", 245);
testLookUp = LookUp (testHash, "fog");
MoveFirst (testLookUp);
while (!OffEnd (testLookUp))
{
int temp = *(int*) GetCurrent (testLookUp);
printf ("%d ", temp);
MoveNext (testLookUp);
}
printf ("\n");
if (IsIn (testHash, "dog"))
{
printf ("dog is in the table\n");
}
DeleteKey (testHash, "cat");
DeleteKey (testHash, "dog");
if (IsIn (testHash, "dog"))
{
printf ("dog is still in the table\n");
}
testLookUp = LookUp (testHash, "dog");
FreeDictionary (testHash);
return (0);
}
示例12: Select_UnHideAllWaypoints
void Select_UnHideAllWaypoints(void)
{
for (entity_t* pEnt=entities.next ; pEnt != &entities ; pEnt=pEnt->next)
{
DeleteKey(pEnt, sKEY_HIDDENWAYPOINT);
}
Sys_UpdateWindows (W_XY|W_CAMERA);
}
示例13: R_Entity_UpdateAllTargetWaypoints
void R_Entity_UpdateAllTargetWaypoints(entity_t *pEnt, entity_t *pOriginalEnt, bool bHide)
{
if (pEnt)
{
if (strlen(ValueForKey(pEnt, sKEY_WAYPOINTHIDE_RECURSION_PROTECT))==0)
{
SetKeyValue(pEnt, sKEY_WAYPOINTHIDE_RECURSION_PROTECT, "1"); // note: actual value irrelevant, just so long as strlen()!=0
CString str;
entity_t *pDestEnt;
str = ValueForKey(pEnt, "target");
if (str.GetLength() > 0)
{
pDestEnt = FindEntity("targetname", str.GetBuffer(0));
R_Entity_UpdateAllTargetWaypoints(pDestEnt, pOriginalEnt, bHide);
}
str = ValueForKey(pEnt, "target2");
if (str.GetLength() > 0)
{
pDestEnt = FindEntity("targetname", str.GetBuffer(0));
R_Entity_UpdateAllTargetWaypoints(pDestEnt, pOriginalEnt, bHide);
}
str = ValueForKey(pEnt, "target3");
if (str.GetLength() > 0)
{
pDestEnt = FindEntity("targetname", str.GetBuffer(0));
R_Entity_UpdateAllTargetWaypoints(pDestEnt, pOriginalEnt, bHide);
}
str = ValueForKey(pEnt, "target4");
if (str.GetLength() > 0)
{
pDestEnt = FindEntity("targetname", str.GetBuffer(0));
R_Entity_UpdateAllTargetWaypoints(pDestEnt, pOriginalEnt, bHide);
}
if (pEnt != pOriginalEnt) // because we don't want to hide/unhide ourselves, just the children
{
if (bHide)
{
SetKeyValue(pEnt, sKEY_HIDDENWAYPOINT, "1"); // note: actual value irrelevant, just so long as strlen()!=0
}
else
{
DeleteKey(pEnt, sKEY_HIDDENWAYPOINT);
}
}
}
}
}
示例14: DeleteKey
void CEntityDlg::DelProp() {
CString key;
if( editEntity == NULL ) {
return;
}
editKey.GetWindowText( key );
if( multipleEntities ) {
for( brush_t *b = selected_brushes.next; b != &selected_brushes; b = b->next ) {
DeleteKey( b->owner, key );
Entity_UpdateCurveData( b->owner );
}
} else {
DeleteKey( editEntity, key );
Entity_UpdateCurveData( editEntity );
}
// refresh the prop listbox
SetKeyValPairs();
Sys_UpdateWindows( W_ENTITY | W_XY | W_CAMERA );
}
示例15: CK_DEFINE_FUNCTION
/* {{{ CI_SetConfigString */
CK_DEFINE_FUNCTION(CK_RV, CI_SetConfigString)(
CK_CHAR_PTR pSectionName,
CK_CHAR_PTR pFieldname,
CK_CHAR_PTR pValue
)
{
CK_RV rv = CKR_OK;
bool ret;
pSectionName=((pSectionName!=NULL_PTR)?pSectionName:(CK_CHAR_PTR)"PKCS11-DLL");
if(CK_I_config_fname == NULL_PTR)
{
rv = CKR_GENERAL_ERROR;
CI_VarLogEntry("CI_GetConfigString", "Reading config field failed: config file not set",
rv, 0,
pFieldname,
pSectionName,
CK_I_config_fname,
CK_I_init_fail_reasons[rv]);
return rv;
}
do
{
ret = OpenIniFile(CK_I_config_fname);
if (ret != TRUE)
break;
ret = DeleteKey(pSectionName, pFieldname);
if (ret != TRUE)
{
CloseIniFile();
break;
}
WriteString(pSectionName, pFieldname, pValue);
WriteIniFile(CK_I_config_fname);
}while (false);
if(ret != TRUE)
{
CI_VarLogEntry("CI_SetConfigString", "Setting config field '%s' from section [%s] in file '%s' failed: %s",
CKR_GENERAL_ERROR, 0,
pFieldname,
pSectionName,
CK_I_config_fname,
CK_I_init_fail_reasons[rv]);
return CKR_GENERAL_ERROR;
}
return CKR_OK;
}