You have to include "windows.h". And you have to add the prototypes by yourself.

I don't really know how to WRITE into the Registry. But here's an example how to READ the registry (got it ages ago on the forums). Maybe this helps you:

Code:
#include <windows.h>

long __stdcall RegOpenKey(long hKey, char* lpSubKey, long phkResult);
#define PRAGMA_API RegOpenKey;advapi32!RegOpenKeyA
long __stdcall RegQueryValueEx(long hKey, char* lpValueName, long lpReserved, long lpType, long  lpData, long lpcbData);
#define PRAGMA_API RegQueryValueEx;advapi32!RegQueryValueExA
long __stdcall RegCloseKey(long hKey);
#define PRAGMA_API RegCloseKey;advapi32!RegCloseKey

var reg_get_STRING(long HKEY, char* KEY, char* VALUE, STRING* *DATA);

var reg_get_STRING(long HKEY, char* KEY, char* VALUE, STRING* *DATA)
{	long regPtr=0, DataType=0, DataLen=999;
	char* dwData = 0;
	dwData = (char*)malloc(sizeof(char*)*DataLen);
	memset(dwData,0,DataLen);
	if(RegOpenKey(HKEY, KEY, &regPtr))	return(false);
	if((RegQueryValueEx(regPtr,VALUE,0,&DataType,NULL,&DataLen))||(DataType!=1))
	{	RegCloseKey(regPtr);	return(false);		}
	STRING* tmpStr = str_create("");
	str_cat_num(tmpStr, "\#%.0f", DataLen);
	if(!*DATA)	*DATA = str_create("");
	str_cpy(*DATA, _chr(tmpStr));		str_remove(tmpStr);
	RegQueryValueEx(regPtr,VALUE,0,0,dwData,&DataLen); 
	str_cpy(*DATA,dwData);
	free(dwData);
	RegCloseKey(regPtr);	return(true);
}

void getRegStr()
{
	STRING* tmpStr = str_create("");
	reg_get_STRING(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", tmpStr);
}