WinSetAccelTable
Appearance
This function sets the window-accelerator, or queue-accelerator table.
Syntax
WinSetAccelTable(hab, haccelAccel, hwndFrame)
Parameters
- hab (HAB) - input
- Anchor-block handle.
- haccelAccel (HACCEL) - input
- Accelerator-table handle.
- NULLHANDLE
- Remove any accelerator table in effect for the window or the queue
- Other
- Accelerator-table handle.
- hwndFrame (HWND) - input
-
- Frame-window handle.
- NULLHANDLE
- Set the queue-accelerator table
- Other
- Set the window-accelerator table.
Returns
- rc (BOOL) - returns
- Success indicator.
- TRUE
- Successful completion
- FALSE
- Error occurred.
Errors
Possible returns from WinGetLastError
- PMERR_INVALID_HWND (0x1001)
- An invalid window handle was specified.
- PMERR_INVALID_HACCEL (0x101A)
- An invalid accelerator-table handle was specified.
Example Code
This example uses the WinSetAccelTable call to remove any accelerator table in effect for the window.
#define INCL_WIN
#include <OS2.H>
HWND hwndFrame, hwndClient;
HAB hab;
HACCEL haccel;
hwndFrame = WinQueryWindow(hwndClient,
QW_PARENT); /* get handle of parent, */
/* which is frame window. */
WinSetAccelTable(hab,
(HACCEL)0, /* remove any accelerator table in */
/* effect. */
hwndFrame);
Definition
#define INCL_WINACCELERATORS /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HAB hab; /* Anchor-block handle. */ HACCEL haccelAccel; /* Accelerator-table handle. */ HWND hwndFrame; /* Frame-window handle. */ BOOL rc; /* Success indicator. */ rc = WinSetAccelTable(hab, haccelAccel, hwndFrame);