Error with RegOpenKeyEx
I'm using 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' undeclared (first use in this fu开发者_运维知识库nction)
I had add #include <windows.h>
but it still doesn't work.
You need to define a Windows target version of XP or greater to have access to this. You are probably targeting Windows 2000.
In targetver.h (or wherever you define _WIN32_WINNT
) you need this:
#define _WIN32_WINNT 0x0501 //targets XP or later
精彩评论