| 58 | } |
| 59 | |
| 60 | BOOL CRegRun::IfAutoRun() |
| 61 | { |
| 62 | CRegKey regRun; |
| 63 | int ret; |
| 64 | |
| 65 | ret = regRun.Open(HKEY_LOCAL_MACHINE, sKey, KEY_READ); |
| 66 | if (ret == ERROR_SUCCESS) { |
| 67 | char buf[256]; |
| 68 | DWORD dwCount, dwType; |
| 69 | |
| 70 | dwCount = sizeof(buf); |
| 71 | ret = regRun.QueryValue(m_sRegName.GetString(), &dwType, buf, &dwCount); |
| 72 | regRun.Close(); |
| 73 | if (ret == ERROR_SUCCESS) { |
| 74 | return TRUE; |
| 75 | } else { |
| 76 | return FALSE; |
| 77 | } |
| 78 | } else { |
| 79 | m_sErrMsg.Format("CRegKey::Open sKey(%s) error(%d)", sKey, ret); |
| 80 | m_nErrno = ret; |
| 81 | return FALSE; |
| 82 | } |
| 83 | } |