Skip to main content.

Message Pump Functions

Used to interact with the underlaying message pump system for the host OS.

Dispatch

Function Prototypes

  • bool Dispatch(void) const
    Works the message pump for the application, dispatching events as required.

Return Value

  • False indicates that the application has asked to quit.
  • True means keep on looping.

Possible Known Exceptions

  • None

Other Details / Notes

  • Under Win32 the dispatch method returns false when a quit message is posted.
  • This system will probably be superceeded by a user call back function at some point
  • Under Win32 the message reader is non-blocking and will return right away if no messages are found, thus it is upto the end user to make their main thread yeild if the program is expected to work properly under multi-threading.

RegisterUserMessage

Function Prototypes

  • void RegisterUserMessage(winHnd window, winmsg_t msg, UserMessageHandler_t handler);
    Registers a user function to act on the message msg for the requested window.
  • void RegisterUserMessage(winmsg_t msg, UserMessageHandler_t handler);
    Registers a user function to act on the message msg for the current window.

Return Value

  • None

Possible Known Exceptions

  • None

Other Details / Notes

  • The handler can either be a bare function or a functor, the signature of the function is decribed in the typedef section of this guide and demoed in the examples.

Copyright © 2004, Rob Jones
Home | Site Map | Contact Us | Disclaimer | Privacy Statement