James Hawkins wrote: >> Sorry, I don't understand what I have done wrong. RegCloseKey() will >> return ERROR_INVALID_HANDLE if called with hkey==NULL. >> > > ...and we don't care what value it returns. > Ah, of course! Thanks, James (and Juan). -- Andy.