Try this, I changed it to use RegOpenKeyEx since RegOpenKey is actually an old function which really shouldn't be used anymore.
void findNick(char *nick, char *url)
char regkey = "Software\\Microsoft\\Internet Explorer\\SearchUrl\\";
*url = 0;
strncat(regkey, nick, 80);
if (RegOpenKeyEx(HKEY_CURRENT_USER, (LPCTSTR)regkey, 0, KEY_