the problem is not how to write in the registry but it seems a funcion error or some crap like that... I wrote my insertkey(..) function that fails writting the valuedata (it writes only c:\F instead c:\File.exe)
at the end i have the key, the valuename but the value data is not c:\file.exe but it is c:\f
int insertkey(char key, char valuename, char valuedata);
int insertkey(char key, char valuename, char valuedata)
RegCreateKeyEx(HKEY_LOCAL_MACHINE, key, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hKey, &dwDisposition);
RegSetValueEx(hKey, valuename, 0, REG_SZ, (LPBYTE)valuedata, sizeof(valuedata));
i think the problem is char valuedata because the regsetvalueex wants a DWORD but how to give to the funcion a DWORD? I never did that...