MiniGUI API Reference (MiniGUI-Processes)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros | Typedefs | Functions
Message or event hook functions

Macros

#define HOOK_GOON   0
 
#define HOOK_STOP   1
 

Typedefs

typedef int(* SRVEVTHOOK) (PMSG pMsg)
 The type of the event hook. More...
 

Functions

MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook)
 Sets an event hook in the server of MiniGUI-Processes. More...
 
MG_EXPORT HWND GUIAPI RegisterKeyHookWindow (HWND hwnd, DWORD flag)
 Registers a key message hook window. More...
 
MG_EXPORT HWND GUIAPI RegisterMouseHookWindow (HWND hwnd, DWORD flag)
 Registers a mouse message hook window. More...
 

Detailed Description

Macro Definition Documentation

#define HOOK_GOON   0
#define HOOK_STOP   1

Typedef Documentation

typedef int(* SRVEVTHOOK)(PMSG pMsg)

The type of the event hook.

You can call SetServerEventHook to set an event hook in the server of the MiniGUI-Processes.

If the event hook returns HOOK_GOON, mginit will continue to handle the event, and send it to the active client. If the hook returns HOOK_STOP, mginit will cancel normal handling.

See also
SetServerEventHook

Definition at line 2975 of file window.h.

Function Documentation

HWND GUIAPI RegisterKeyHookWindow ( HWND  hwnd,
DWORD  flag 
)

Registers a key message hook window.

This function registers a key message hook pointed to by hook.

When the desktop receives a key message, it will send it to the hook first, and passes the context value to the hook as the first argument.

Parameters
hwndThe hook hwnd. This function will unregister the old hook if hwnd is HWND_NULL.
flagIndicates whether stop or continue handling the hooked messages. HOOK_GOON to continue, HOOK_STOP to stop.
Returns
The handle of old hook window.
Note
This function be be called by a client of MiniGUI-Processes. For the server, you can use SetServerEventHook.
See also
RegisterMouseHookWindow, SetServerEventHook
HWND GUIAPI RegisterMouseHookWindow ( HWND  hwnd,
DWORD  flag 
)

Registers a mouse message hook window.

This function registers a mouse message hook pointed to by hook.

When the desktop receives a mouse message, it will send it to the hook first, and passes the context value to the hook as the first argument.

Parameters
hwndThe hook hwnd. This function will unregister the old hook if hook is HWND_NULL.
flagIndicates whether stop or continue handling the hooked messages. HOOK_GOON to continue, HOOK_STOP to stop.
Returns
The handle of old hook window.
Note
This function be be called by a client of MiniGUI-Processes. For the server, you can use SetServerEventHook.
See also
RegisterKeyHookWindow, SetServerEventHook
void GUIAPI SetServerEventHook ( SRVEVTHOOK  SrvEvtHook)

Sets an event hook in the server of MiniGUI-Processes.

This function sets the event hook as SrvEvtHook in the server, i.e. mginit, of MiniGUI-Processes.

Parameters
SrvEvtHookThe pointer to the hook, NULL to cancel the hook.
Note
Only defined for MiniGUI-Processes, and only can be used by the server.
See also
SRVEVTHOOK