RegistryHelper::createKey

0 0 2025-05-29 本文地址:http://www.pnpon.com/fun/detail-22.html
void RegistryHelper::createKey(wstring key)
{
    HKEY rootKey;
    wstring subKey = splitKey(key, &rootKey);

    HKEY keyHandle;
    LSTATUS status = RegCreateKeyExW(rootKey, subKey.c_str(), 0, NULL, 0, KEY_SET_VALUE | KEY_WOW64_64KEY, NULL, &keyHandle, NULL);
    if (status != ERROR_SUCCESS)
        throw RegistryException(L"Error while creating registry key " + key + L": " + StringHelper::getSystemErrorString(status));

    RegCloseKey(keyHandle);
}
取消
感谢您的支持,我会继续努力的!
扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

您的支持,是我们前进的动力!