on_message
The engine message loop. This function is executed every time a Windows message event is sent to the engine window.
Type
Event
Remarks:
- This function pointer can be used to call the engine message loop from another window's message loop. The parameters are the same as for window messages; a description can be found in the Windows API documentation.
- As long as the engine window exists, this pointer must never be set to NULL. Otherwise the engine can't react anymore on Windows messages.
Edition:
A7.20 LC
Example (lite-C):
#include <acknex.h>
#include <windows.h>
LRESULT CALLBACK OriginalHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK MyMessageHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (WM_SIZE == message)
{
printf("Resize attempt!");
return 1;
}
return OriginalHandler(hwnd,message,wParam,lParam);
}
function main()
{
OriginalHandler = on_message; // store the original message loop
on_message = MyMessageHandler; // and replace it by your own
...
}
See also:
hWnd, hWndTarget
► latest
version online