WinapiExtension
 All Classes Files Functions Variables Typedefs Pages
Classes | Public Member Functions | List of all members
WindowMessageHandler Class Referenceabstract

Arbitrary message handler functions can be passed to this class. More...

#include <WindowMessageHandler.h>

Inheritance diagram for WindowMessageHandler:
Window WindowModal

Public Member Functions

template<typename MESSAGE >
void Bind (UINT message, void(*function)(MESSAGE &))
 
template<typename MESSAGE , typename FUNCTOR >
void Bind (UINT message, FUNCTOR function)
 
template<typename CLASS , typename MESSAGE , typename HANDLER >
void Bind (UINT message, void(CLASS::*function)(MESSAGE &), HANDLER *handler)
 
template<typename FUNCTOR >
void BindCommand (WORD id, FUNCTOR function, WORD notifyCode=0)
 
template<typename FUNCTOR >
void BindCommand (HWND hwnd, FUNCTOR function, WORD notifyCode=0)
 
template<typename CLASS , typename HANDLER >
void BindCommand (WORD id, void(CLASS::*function)(msgCommand &), HANDLER *handler, WORD notifyCode=0)
 
template<typename CLASS , typename HANDLER >
void BindCommand (HWND hwnd, void(CLASS::*function)(msgCommand &), HANDLER *handler, WORD notifyCode=0)
 
template<typename FUNCTOR >
void BindNotify (UINT_PTR id, UINT notifyCode, FUNCTOR function)
 
template<typename FUNCTOR >
void BindNotify (HWND hwnd, UINT notifyCode, FUNCTOR function)
 
template<typename CLASS , typename HANDLER >
void BindNotify (UINT_PTR id, UINT notifyCode, void(CLASS::*function)(msgNotify &), HANDLER *handler)
 
template<typename CLASS , typename HANDLER >
void BindNotify (HWND hwnd, UINT notifyCode, void(CLASS::*function)(msgNotify &), HANDLER *handler)
 
virtual LRESULT OnMessage (HWND hwnd, UINT message, WPARAM wp, LPARAM lp)=0
 
bool PassMessageToHandlerFunction (HWND hwnd, UINT message, WPARAM wp, LPARAM lp, LRESULT &result)
 
void UnBind (UINT message)
 
void UnBindCommand (WORD id, WORD notifyCode=0)
 
void UnBindCommand (HWND hwnd, WORD notifyCode=0)
 
void UnBindNotify (UINT_PTR id, UINT notifyCode=0)
 
void UnBindNotify (HWND hwnd, UINT notifyCode=0)
 

Detailed Description

Arbitrary message handler functions can be passed to this class.

Member Function Documentation

template<typename MESSAGE >
void WindowMessageHandler::Bind ( UINT  message,
void(*)(MESSAGE &)  function 
)
inline

Bind a global function to a message.

template<typename MESSAGE , typename FUNCTOR >
void WindowMessageHandler::Bind ( UINT  message,
FUNCTOR  function 
)
inline

Bind a functor to a message.

template<typename CLASS , typename MESSAGE , typename HANDLER >
void WindowMessageHandler::Bind ( UINT  message,
void(CLASS::*)(MESSAGE &)  function,
HANDLER *  handler 
)
inline

Bind a class member function to a message.

template<typename FUNCTOR >
void WindowMessageHandler::BindCommand ( WORD  id,
FUNCTOR  function,
WORD  notifyCode = 0 
)
inline

Bind a WM_COMMAND message handler either to an ID or a window handle. This way the function is only called for that specific ID.

template<typename FUNCTOR >
void WindowMessageHandler::BindCommand ( HWND  hwnd,
FUNCTOR  function,
WORD  notifyCode = 0 
)
inline
See Also
BindCommand()
template<typename CLASS , typename HANDLER >
void WindowMessageHandler::BindCommand ( WORD  id,
void(CLASS::*)(msgCommand &)  function,
HANDLER *  handler,
WORD  notifyCode = 0 
)
inline
See Also
BindCommand()
template<typename CLASS , typename HANDLER >
void WindowMessageHandler::BindCommand ( HWND  hwnd,
void(CLASS::*)(msgCommand &)  function,
HANDLER *  handler,
WORD  notifyCode = 0 
)
inline
See Also
BindCommand()
template<typename FUNCTOR >
void WindowMessageHandler::BindNotify ( UINT_PTR  id,
UINT  notifyCode,
FUNCTOR  function 
)
inline

Bind a WM_NOTIFY message handler to a notification code and either to an ID or a window handle. This way the function is only called for that specific ID.

template<typename FUNCTOR >
void WindowMessageHandler::BindNotify ( HWND  hwnd,
UINT  notifyCode,
FUNCTOR  function 
)
inline
See Also
BindNotify()
template<typename CLASS , typename HANDLER >
void WindowMessageHandler::BindNotify ( UINT_PTR  id,
UINT  notifyCode,
void(CLASS::*)(msgNotify &)  function,
HANDLER *  handler 
)
inline
See Also
BindNotify()
template<typename CLASS , typename HANDLER >
void WindowMessageHandler::BindNotify ( HWND  hwnd,
UINT  notifyCode,
void(CLASS::*)(msgNotify &)  function,
HANDLER *  handler 
)
inline
See Also
BindNotify()
virtual LRESULT WindowMessageHandler::OnMessage ( HWND  hwnd,
UINT  message,
WPARAM  wp,
LPARAM  lp 
)
pure virtual

Old style message handling, everything in one big virtual function

Implemented in Window.

bool WindowMessageHandler::PassMessageToHandlerFunction ( HWND  hwnd,
UINT  message,
WPARAM  wp,
LPARAM  lp,
LRESULT &  result 
)
inline
Returns
True if the message was fully processed and the result is set.
void WindowMessageHandler::UnBind ( UINT  message)
inline

Remove a message handler.

void WindowMessageHandler::UnBindCommand ( WORD  id,
WORD  notifyCode = 0 
)
inline

Remove a WM_COMMAND message handler.

void WindowMessageHandler::UnBindCommand ( HWND  hwnd,
WORD  notifyCode = 0 
)
inline
See Also
UnBindCommand()
void WindowMessageHandler::UnBindNotify ( UINT_PTR  id,
UINT  notifyCode = 0 
)
inline

Remove a WM_NOTIFY message handler.

void WindowMessageHandler::UnBindNotify ( HWND  hwnd,
UINT  notifyCode = 0 
)
inline
See Also
UnBindNotify()

The documentation for this class was generated from the following file: