Error with RegOpenKeyEx

I use Code :: blocks to write a program that changes the registry, but when I call

RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce", 0, KEY_ALL_ACCES | KEY_WOW64_64KEY, &key); 

codeblocks return

`KEY_WOW64_64KEY 'uneclared (first use in this function)

I added #include <windows.h> , but it still does not work.
Thanks:)

+2
source share
1 answer

You need to determine the target version of Windows XP or higher in order to have access to this. Perhaps you are targeting Windows 2000.

In targetver.h (or wherever you define _WIN32_WINNT ) you will need the following:

 #define _WIN32_WINNT 0x0501 //targets XP or later 
+5
source

Source: https://habr.com/ru/post/1435472/


All Articles