( Index )
Month

Brief Information about the Dec '04 CSIG Meeting

Programs Utility - Non-GUI

B. Arnold

Programs List Programs List

Welcome to the CSIG, a Special Interest Group of the ACGNJ. The subject for this month is a discussion about the MFC Non-Windows Programming using Microsoft Visual C++ version 6.0. By "Non-Windows or Non-GUI" I mean a program that uses the Command Box (Sometimes called DOS Box) instead of the Windows Graphical Interface. This is the simplist of programming ventures because the Graphical User Interface, GUI, does not have to be programmed.

The program presented is designed provide a list of installed programs. Here's a typical situation: When you go to Control Panel, Add-Remove Programs, you will see a list of installed programs. How do you get a hard copy? Why do you need it? Here are several reasons that I use: a) If you are about to reinstall your operating system from scratch because of a bad virus, crash, upgrade, etc., you would like to have a complete list of your installed programs so that you can reinstall each of them. b) I have a computer with several plug in hard drives. I often have to "power down, remove drive, insert drive, reboot, check, repeat" in order to find an application. A hard copy would solve this problem.

The program helps solve the problem by looking in the Registry and listing all of the installed programs.

The beginning of the evening (starting at 7:30pm) will be a RANDOM ACCESS discussion. The main presentation will present the program.

As always, the ftp site has code and programs from our meetings.

Sample Code

Typical output:

                    Installed Programs - 12/13/04

              1     ATI Display Driver
              2     Access ThinkPad
              3     Ad-aware 6 Professional
              4     Adobe Acrobat - Reader 6.0.2 Update
              5     Adobe Reader 6.0.1
              6     Agere Systems AC'97 Modem
              7     Applix iEnterprise 8.2.4
              8     Belarc Advisor 6.1
              9     CD/DVD Diagnostic
             10     Citrix ICA Client
            ...
            104     Windows Media Player Hotfix [See Q828026 for more information]
            105     Windows Media Player system update (9 Series)
            106     Windows Media Services SDK (3790.0)
            107     WinPatrol 8.0
            108     WinRAR archiver
            109     WinZip

                    Drive C:\ has 29 GB free. ( 32,037,126,144 bytes free)

Sample Code
					
        cerr << _T("Programs.exe ver 1.02 by Bruce Arnold, Dec. 2004") << endl;
        cerr << _T("================================================") << endl;

        CString target, *prgstr;

        m_Category.RemoveAll();
        Categories(WINXPSTARTPATH);     // Fill m_Category array

        for (int i=0;i < m_Category.GetSize();i++)
            {
            char *p;
            target = WINXPSTARTPATH;
            target += "\\";
            target += m_Category[i];
            p = GetDisplayName(target.GetBuffer(150), "DisplayName");
            if (p) m_Program.Add(p);
            }

        prgstr = m_Program.GetData();
        qsort(prgstr, m_Program.GetSize(), sizeof(CString), Compare);

        printf("	Installed Programs - %s\n\n", _strdate(buff));

        for (i=0;i < m_Program.GetSize();i++)
            {
            printf("%3d\t%s\n", i+1, m_Program[i].GetBuffer(150));
            }
        }

    // Get and display the Windows disk size.
 
    GetWindowsDirectory(buff, 50);          // Typ: C:\Windows or C:\WinNT
    puts(DoGetFreeSpace(buff));
    Sleep(2000);
    return nRetCode;
    }

"Random Access" questions start at 7:30 Tuesday night.

SOURCE CODE

Source Code Files

For help, email me at b a r n o l d @ i e e e . o r g
Back to C++ Main Page