MiniGUI API Reference (MiniGUI-Threads)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Functions
Accelerator operations

Functions

MG_EXPORT HACCEL GUIAPI CopyAcceleratorTable (HACCEL hacc)
 Copies the specified accelerator table. More...
 
MG_EXPORT int GUIAPI DeleteAccelerators (HACCEL hacc, int key, DWORD keymask)
 Deletes an accelerator from the accelerator table. More...
 
MG_EXPORT int GUIAPI AddAccelerators (HACCEL hacc, int key, DWORD keymask, WPARAM wParam, LPARAM lParam)
 Adds an accelerator to the accelerator table. More...
 
MG_EXPORT int GUIAPI DestroyAcceleratorTable (HACCEL hacc)
 Destroys an accelerator table. More...
 
MG_EXPORT HACCEL GUIAPI CreateAcceleratorTable (HWND hWnd)
 Creates an empty accelerator table. More...
 
MG_EXPORT int GUIAPI TranslateAccelerator (HACCEL hAccel, PMSG pMsg)
 Translates an accelerator key message to MSG_COMMAND messge and sends it to the window procedure. More...
 

Detailed Description

Function Documentation

◆ AddAccelerators()

int GUIAPI AddAccelerators ( HACCEL  hacc,
int  key,
DWORD  keymask,
WPARAM  wParam,
LPARAM  lParam 
)

Adds an accelerator to the accelerator table.

This function adds an accelerator to the accelerator table. It's called after you call CreateAcceleratorTable function.

Parameters
haccThe handle to the accelerator table.
keyThe key value of the accelerator. Note that you can define the key value by either scancode or ASCII code. If you define the key with scancode, the key value should be equal to (scancode + 256).
keymaskThe shift key state, can be OR'ed value of the following values:
  • KS_SHIFT
    Shift key should be pressed.
  • KS_ALT
    Alt key should be pressed.
  • KS_CTRL
    Ctrl key should be pressed.
wParamThe first parameter of the MSG_COMMAND when receiving such a accelerator key.
lParamThe second parameter of the MSG_COMMAND when receiving such a accelerator key.
Returns
The function returns 0 for success, non-zero for failure.
See also
CreateAcceleratorTable, DeleteAccelerators

◆ CopyAcceleratorTable()

HACCEL GUIAPI CopyAcceleratorTable ( HACCEL  hacc)

Copies the specified accelerator table.

This function copies the specified accelerator table. The function is used to obtain the accelerator table data that corresponds to an accelerator table handle.

Parameters
haccThe handle to the accelerator table.
Returns
The handle to the copied new accelerator table.

◆ CreateAcceleratorTable()

HACCEL GUIAPI CreateAcceleratorTable ( HWND  hWnd)

Creates an empty accelerator table.

This function creates an empty accelerator table.

Parameters
hWndThe handle to the main window.
Returns
The handle to the new accelerator table, zero when error.
See also
AddAccelerators, DestroyAcceleratorTable

◆ DeleteAccelerators()

int GUIAPI DeleteAccelerators ( HACCEL  hacc,
int  key,
DWORD  keymask 
)

Deletes an accelerator from the accelerator table.

This function deletes an accelerator from the accelerator table.

Parameters
haccThe handle to the accelerator table.
keyThe key value of the accelerator.
keymaskThe shift key state.
Returns
The function returns 0 for success, non-zero for failure.
See also
AddAccelerators, DestroyAcceleratorTable

◆ DestroyAcceleratorTable()

int GUIAPI DestroyAcceleratorTable ( HACCEL  hacc)

Destroys an accelerator table.

This function destroys the specified accelerator table hacc. Before closing a window, you must call this function to destroy each accelerator table that is created by using CreateAcceleratorTable function.

Parameters
haccThe handle to the accelerator table.
Returns
The function returns 0 for success, non-zero for failure.
See also
CreateAcceleratorTable

◆ TranslateAccelerator()

int GUIAPI TranslateAccelerator ( HACCEL  hAccel,
PMSG  pMsg 
)

Translates an accelerator key message to MSG_COMMAND messge and sends it to the window procedure.

Parameters
hAccelThe handle to the accelerator table.
pMsgThe pointer to the MSG structure to be translated.
Returns
The function returns 0 for success, non-zero for failure.
See also
TranslateMessage