I use Qt with mingw to write a program that changes the registry, but when I call:
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\DefaultProductKey", 0, KEY_ALL_ACCESS|KEY_WOW64_64KEY, &key);
Return Qt:
`KEY_WOW64_64KEY' undeclared (first use in this function)
I added "#include <windows.h>" , but it still does not work.
I found this entry Error with RegOpenKeyEx , this is the same problem as me, and the answer looks good. But I do not use Windows XP, I use 7 (64 bit). So I tried putting in targetver.h:
#ifndef _WIN32_WINNT_WIN7 #define _WIN32_WINNT_WIN7 (0x0601) #endif
And it still does not work ... :(
What can I do?: (
Thanks:)
(sorry for my bad english)
source share