You can use a resource compiler to create accelerator tables for use in your application. A resource compiler creates accelerator-table resources and adds them to your application's executable file. At run time, you can call the LoadAccelerators function to load the accelerator table into memory and retrieve the handle of the accelerator table. You can pass this handle to the TranslateAccelerator function to activate the accelerator table.
You can create an accelerator table at run time by passing an array of ACCEL structures to the CreateAcceleratorTable function. Like the LoadAccelerators function, CreateAcceleratorTable returns an accelerator-table handle that can be passed to TranslateAccelerator to activate the accelerator table. Creating accelerator tables at run time is useful if, for example, you want to support user-defined accelerators in your application.
An accelerator table created by the CreateAcceleratorTable function must be destroyed before your application exits; otherwise, the table continues to exist in memory after your application exits. You can destroy an accelerator table by calling the DestroyAcceleratorTable function. Windows automatically destroys accelerator tables loaded by the LoadAccelerators function.
You can copy an accelerator table by using the CopyAcceleratorTable function. This is useful if you want to create a modified version of an existing accelerator table. For example, you could copy an accelerator table, modify the copy, call CreateAcceleratorTable to get a handle to the new accelerator table, then pass the handle to the TranslateAccelerator function to activate the new table.