Thanks to visit codestin.com
Credit goes to www.codeproject.com

65.9K
CodeProject is changing. Read more.
Home

Extract Windows XP Hotfix

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.39/5 (8 votes)

Jul 27, 2005

viewsIcon

46352

downloadIcon

382

This article gives a class that extracts Windows XP hotfix installed on a computer.

What does the code do

This class extracts Windows XP hot-fix installed on a computer.

Enumerate all entries of the registry key: "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\HotFix" and focalize on the value "Fix Description".

How to use it

It's simple :). Declare an object of the CXP_Hotfix class, named "hf".

CXP_Hotfix hf;

Now we can use it in, here is a little example:

  int nb_hotfix;
  nb_hotfix = hf.m_aHotFix.GetCount();

  if (nb_hotfix > 0) // display only if there is at least 1 Hotfix
  {

      // loop until we find an Hotfix and display it (them).
      for (int a = 0; a < hf.m_aHotFix.GetCount(); a++)
      {
         printf("%s\r\n", hf.m_aHotFix[a]);
      }
     
      printf("\r\n");
    
      // here we show number of Hotfix found.
      printf("Found %i Windows XP Hot-fix installed.\r\n\r\n", 
                                     hf.m_aHotFix.GetCount());
  }

  else // No Hotfix was found.
  {
      printf("No Windows XP Hot-fix installed.\r\n\r\n");
  }

That's all.

Inspirations

I had the idea to write this code when I saw the code of Robert Edward Caldecott's to get the list of installed applications (CinstalledSoftware).

Restrictions

This code runs well on Windows XP SP1; for other Windows versions, I don't know, sorry..