7.7.5 Loading the Accelerator Table

Before using the accelerator table, you must load it from the application's resources. Add the following statements to the application's InitInstance function:

hAccTable = LoadAccelerators(hinst, "EditMenu");

This statement loads the accelerator table into memory and assigns the handle identifying the table to the hAccTable variable. The hinst variable identifies the application's resource-definition file, and EditMenu is the name of the accelerator table. After you have loaded the table, you can use it in the TranslateAccelerator function.