Jump to content

WinCopyAccelTable

From EDM2
Revision as of 02:08, 13 May 2023 by Martini (talk | contribs) (Created page with "This function is used to get the accelerator-table data corresponding to an accelerator-table handle, or to determine the size of the accelerator-table data. ==Syntax== Win...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function is used to get the accelerator-table data corresponding to an accelerator-table handle, or to determine the size of the accelerator-table data.

Syntax

WinCopyAccelTable(hAccel, pacctAccelTable, ulCopyMax);

Parameters

hAccel (HACCEL) - input
Accelerator-table handle.
pacctAccelTable (PACCELTABLE) - in/out
Accelerator-table data area.
NULL
Return the size, in bytes, of the complete accelerator table, and ignore the ulCopyMax parameter.
Other
Copy up to ulCopyMax bytes of the accelerator table into this data area.
ulCopyMax (ULONG) - input
Maximum data area size.
ulCopied (ULONG) - returns
Amount copied or size required.
Other
Amount of data copied into the data area, or the size of data area required for the complete accelerator table.
0
Error occurred.

Returns

ulCopied (ULONG) - returns
Amount copied or size required.
Other
Amount of data copied into the data area, or the size of data area required for the complete accelerator table.
0
Error occurred.

Error

Possible returns from WinGetLastError

PMERR_INVALID_HACCEL (0x101A)
An invalid accelerator-table handle was specified.

Remarks

Example Code

This example gets the accelerator-table data corresponding to an accelerator-table handle returned by WinCreateAccelTable or WinLoadAccelTable and assigns the accelerator table code page to a variable.

#define INCL_WINACCELERATORS    /* Window Accelerator Functions */
#include <os2.h>

ULONG   ulCopied;       /* bytes copied                         */
HACCEL  hAccel;         /* Accelerator-table handle             */
ACCELTABLE  pacctAccelTable;/* Accelerator-table data area      */
ULONG   ulCopyMax;      /* Maximum data area size               */
ULONG   ulAccelCP;      /* code page                            */

ulCopyMax = sizeof(pacctAccelTable);
if (hAccel)
   ulCopied = WinCopyAccelTable(hAccel, &pacctAccelTable,
                                ulCopyMax);
if (ulCopied)
   ulAccelCP = pacctAccelTable.codepage;

Definition

#define INCL_WINACCELERATORS /* Or use INCL_WIN, INCL_PM, */
#include <os2.h>

HACCEL         hAccel;           /*  Accelerator-table handle. */
PACCELTABLE    pacctAccelTable;  /*  Accelerator-table data area. */
ULONG          ulCopyMax;        /*  Maximum data area size. */
ULONG          ulCopied;         /*  Amount copied or size required. */

ulCopied = WinCopyAccelTable(hAccel, pacctAccelTable,
             ulCopyMax);

Related Functions

  • WinCreateAccelTable
  • WinDestroyAccelTable
  • WinLoadAccelTable
  • WinQueryAccelTable
  • WinSetAccelTable
  • WinTranslateAccel