Load 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 hInstance variable identifies the application's resource file, and EditMenu is the name of the accelerator table. Once the table is loaded, it can be used in the TranslateAccelerator function.