Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 3: Windows Resources Visual C++ and MFC Fundamentals


Practical Learning: Creating an Accelerator Table



  1. On the main menu of Visual Studio, click Insert -> Resource... or Project -> Add
    Resource...

  2. In the Add Resource dialog box, double-click Accelerator

  3. In the Properties window, click the arrow of the ID combo box and select
    ID_CATEGORY_PARENT

  4. Click the Key box and type R

  5. Make sure the Ctrl check box is checked or that the Ctrl field is set to True. Also,
    make sure the Type is set to VIRTKEY

  6. In the same way, create an accelerator item for the Child menu:

  7. To use the accelerator, change the program as follows:


class CResFrame : public CFrameWnd
{
public:
HACCEL m_hAccel;

CResFrame()
{
m_hAccel = ::LoadAccelerators(AfxGetInstanceHandle(),
MAKEINTRESOURCE (IDR_ACCELTEST));

Create(NULL, "Resources Fundamentals",
WS_OVERLAPPEDWINDOW,
CRect(200, 120, 640, 400), NULL,
MAKEINTRESOURCE(IDR_TEST));
}
};


  1. Test the application and return to MSVC


3 .6 Version Information........................................................................................


3.6.1 Overview..................................................................................................


The version of a computer program allows to have some information about the product
such as it official name, a release number, the person or company that owns its copyright,
the year of the current release, etc.

3.6.2 The Version Information Editor...........................................................


To create the pieces of information that make up the version information, you can use the
Version Information Editor.
Free download pdf