#define MM_SUB_KEY     "asfa;slfj"
#define VALUE_STRING   "asdf;asfjas;"HKEY  hKey;
DWORD dwDisp;
if(RegCreateKeyEx(HKEY_CURRENT_USER,SUB_KEY,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL, &hKey,&dwDisp) == ERROR_SUCCESS)
{
         char *tempstr = new char[100];
         strcpy(tempstr,"as;kfk;als);
         int templen = strlen(tempstr);
RegSetValueEx(hKey,VALUE_STRING,0,REG_SZ,(LPBYTE)tempstr,templen);
         delete tempstr;
RegCloseKey(hKey);
}
结束线程的方法有很多:
  温柔法:设置一门槛,将线程自行了断,(如事件,某全局变量)
  粗暴法:TerminateThread(hThread)