wchar_t ch[MAX_PATH]={' '};ULONG size=MAX_PATH;CRegKey reg;reg.Open(HKEY_LOCAL_MACHINE,_T("Software\\Microsoft\\Windows\\CurrentVersion\\Run")); //在這裏設定鍵名reg.QueryStringValue(_T("aaa"),ch,&size); //在這裏設定鍵名reg.Close();CString str=ch;str.Trim();if (str.IsEmpty())
//不存在
else
//存在