N
N
NikClik2018-10-05 03:09:44
C++ / C#
NikClik, 2018-10-05 03:09:44

How to create a key in the registry using C++?

LONG openRes = RegOpenKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Classes\\Directory\\background\\shell", &hKey);
LONG openResa = RegCreateKeyExA(hKey, "Qa", 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
    NULL, &hKey, NULL);

Here is the code itself, in it I open the key (I checked, it opens) and then I try to create a partition with it, but nothing happens, can someone tell me what I did wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2018-10-05
@NikClik

What have I done wrong?

Didn't check the return code. Probably not run as administrator.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question