BOOL CTimeTipDlg::OnInitDialog()
{
CDialog::OnInitDialog(); char pline[100];
GetModuleFileName(NULL,pline,100);
autorun = 0;
HKEY hAutoRunKey;
DWORD dwIndex = 0;
long lResult;
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"),0,KEY_READ,&hAutoRunKey) == ERROR_SUCCESS)
{
char szName[100];
DWORD cbName = 100;
char szValue[100];
DWORD cbValue = 100;
CString strTemp;
lResult = RegEnumValue(hAutoRunKey,dwIndex,szName,&cbName,0,NULL,(LPBYTE)szValue,&cbValue);
while(lResult == ERROR_SUCCESS && lResult != ERROR_NO_MORE_ITEMS) 
{
if(strcmp("TimeTip",szName)==0)
{
autorun = 1;
break;
}
else
{
dwIndex++;
cbName = 100;
cbValue = 100;
lResult = RegEnumValue(hAutoRunKey,dwIndex,szName,&cbName,0,NULL,(LPBYTE)szValue,&cbValue);
}
}
}
return TRUE;  // return TRUE  unless you set the focus to a control
}想在HKEY_LOCAL_MACHINE,SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run 下查找是否存在“TimeTip”的子键,打开注册表式明明“TimeTip”存在,但此程序就是无法找到,而其他的子键都可以找到,“TimeTip”子键是我启动我的程序开机自动运行时写入注册表的,请各位看看什么原因,这个问题困扰几天了~~