HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
\HotFix
是不是只对XP有效?
找到一个类专门实现这个功能:

class CXP_Hotfix
{
public:
        CAtlArray<CString> m_aHotFix;

public:
        CXP_Hotfix()
        {
        ShowList();
        }


void ShowList()
{
        CRegKey key; // an object of CRegKey's class

if (key.Open(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows NT\
\CurrentVersion\\HotFix"), KEY_READ) != ERROR_SUCCESS)
        return; // stop if we can't open the key.

// Initialize
DWORD cpt = 0;
DWORD size = 256;
TCHAR SubKeyName[256];
LONG a;
// Initialize


// Enumeration while we find an item....
        while ((a = key.EnumKey(cpt, SubKeyName, &size)) !=
ERROR_NO_MORE_ITEMS)
                {
                        if (a==ERROR_SUCCESS) // an item was found...
                        {
                                CRegKey SubKey; // an object of CRegKey's class.

                                if (SubKey.Open(key, SubKeyName, 
KEY_READ)==ERROR_SUCCESS)
                                {
                                   // "The doors are open"....get the "Fix 
Description".
                    ULONG ulong;
                                        if (SubKey.QueryStringValue(_T("Fix 
Description"), NULL,
&ulong)==ERROR_SUCCESS)
                                        {
                                                // We can retrieve a value now.
                                                CString name;
                                                SubKey.QueryStringValue(_T("Fix 
Description"),
name.GetBuffer(ulong), &ulong);
                                                name.ReleaseBuffer(); // Clean 
the string.
                                                m_aHotFix.Add(name); // add the 
string to the array.
                                        }
                                }
                        }
                        cpt++;
                        size=256;
                }
                key.Close(); // close the registry key.
        }
};




On 9月18日, 上午11时42分, __def <[EMAIL PROTECTED]> wrote:
> 应该和下面两个项有关系
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix
> HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Updates

--~--~---------~--~----~------------~-------~--~----~
 要向邮件组发送邮件,请发到 [email protected]
 要退订此邮件,请发邮件至 [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

回复