и в правду не найден
| Цитата | The RegQueryValue function retrieves the data associated with the default or unnamed value of a specified registry key. The data must be a null-terminated string. ... lpSubKey [in] Pointer to a null-terminated string containing the name of the subkey of the hKey parameter for which the default value is retrieved. Key names are not case sensitive. |
рабочий код:
| Код | #include <windows.h> #include <stdio.h>
int APIENTRY WinMain(HINSTANCE, HINSTANCE, LPSTR, INT) { char debug[50]; char PlayerPath[260]={0}; DWORD buffsize=sizeof(PlayerPath); DWORD dwErr; DWORD type=REG_SZ; HKEY key;
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"SOFTWARE\\Microsoft\\MediaPlayer\\",0,KEY_READ,&key)==ERROR_SUCCESS) { MessageBox(0,"ok","1",0); dwErr=RegQueryValueExA(key,"Installation Directory", 0, &type, (LPBYTE)PlayerPath, &buffsize); if(dwErr==ERROR_SUCCESS) { MessageBoxA(0,PlayerPath,"2",0); } else { sprintf(debug,"%d", dwErr); MessageBox(0,debug,"error",0); } RegCloseKey(key); } return 0; } |
|