LoadAcceleratorsA function (winuser.h)

Loads the specified accelerator table.

Syntax

HACCEL LoadAcceleratorsA(
  [in, optional] HINSTANCE hInstance,
  [in]           LPCSTR    lpTableName
);

Parameters

[in, optional] hInstance

Type: HINSTANCE

A handle to the module whose executable file contains the accelerator table to be loaded.

[in] lpTableName

Type: LPCTSTR

The name of the accelerator table to be loaded. Alternatively, this parameter can specify the resource identifier of an accelerator-table resource in the low-order word and zero in the high-order word. To create this value, use the MAKEINTRESOURCE macro.

Return value

Type: HACCEL

If the function succeeds, the return value is a handle to the loaded accelerator table.

If the function fails, the return value is NULL. To get extended error information, call GetLastError.

Remarks

If the accelerator table has not yet been loaded, the function loads it from the specified executable file.

Accelerator tables loaded from resources are freed automatically when the application terminates.

Examples

For an example, see Creating Accelerators for Font Attributes.

Note

The winuser.h header defines LoadAccelerators as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See also

Conceptual

CopyAcceleratorTable

CreateAcceleratorTable

DestroyAcceleratorTable

Keyboard Accelerators

MAKEINTRESOURCE

Reference