Format:Windows accelerator table resource (RT_ACCELERATOR)
| Platforms | Platform:Windows |
|---|---|
| Extensions | RT_ACCELERATOR (9) resource |
| Endianness | little |
| On this wiki | Facts · Code · Notes · Topics |
RT_ACCELERATOR (type 9) resources: an array of 8-byte entries (flags, key, command id, padding) mapping key combinations to WM_COMMAND ids.
Layout
An RT_ACCELERATOR (9) resource (Format:PE (Portable Executable)/Resource directory) is an array of 8-byte entries: u16 fVirt, u16 key, u16 cmd, u16 pad. The in-memory ACCEL struct of the Win32 headers is 6 bytes (BYTE fVirt; WORD key; WORD cmd), so the resource form is not that struct. The number of entries is the resource size divided by 8 (Wine does exactly this when it loads the table).
fVirt bit flags: FVIRTKEY 0x01 (key is a virtual-key code, otherwise an ASCII character), FNOINVERT 0x02, FSHIFT 0x04, FCONTROL 0x08, FALT 0x10. Unverified: the last entry of a resource carries 0x80 in fVirt as end marker (as emitted by resource compilers); Wine ignores it and uses the size.
key is a VK_* code or a character; cmd is the WM_COMMAND id, the same id as the corresponding menu item (Format:Windows menu resource (RT_MENU)). LoadAccelerators names the table by id or string; a program usually calls TranslateAccelerator in its message loop, and in Library:MFC the table id is the main frame's resource id.
Reversing notes
The table lists hotkeys and their command ids; searching the code for the cmd value finds the handler. Dialogs can have their own tables, loaded by name.
Code & repositories
- Wine
dlls/user32/resource.c(PE_ACCEL,LoadAcceleratorsW) and MinGW-w64winuser.h(tagACCEL, FVIRTKEY..FALT). - https://github.com/mirror/mingw-w64 @
93f3505a758fe70e56678f00e753af3bc4f640bb· license: BSD-2-Clause (read from COPYING; GitHub's detector did not classify it)
MinGW-w64 headers: winuser.h has DLGTEMPLATE, DLGITEMTEMPLATE, ACCEL and the DS_*/FVIRTKEY constants.
Tested on: source read, not run: source reading only · checked 2026-10-18; last activity 2024-09-25 - https://github.com/wine-mirror/wine @
7298a818b79446bae153b8d5aa27235ab3703bf9· license: LGPL-2.1-or-later (declared by the contributor; GitHub's detector did not recognize COPYING.LIB)
Wine (LGPL-2.1+): user32 dialog.c, menu.c, resource.c parse the dialog, menu and accelerator resource formats; include/atlbase.h has the ATL object/interface map structs.
Tested on: source read, not run: source reading only · checked 2026-10-18; last activity 2026-10-16
Evidence & references
- Wine commit 7298a818b7 and MinGW-w64 commit 93f3505a75.