Download Source Code

CMessage Class Reference

Provides callback mechanisms. More...

#include <Message.h>

Inheritance diagram for CMessage:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CMessage ()
 Default constructor.
virtual ~CMessage ()
 Destructor.
void SetMessageTarget (HWND hWnd, UINT uWMMessageID)
 Set the Message ID and window handle that will receive callback messages.
HWND GetWMMessageHWND ()
 Returns the message target window handle.
UINT GetWMMessageID ()
 Returns the message target Message ID.
BOOL IsMessageTarget ()
 Returns non-zero if there is a valid message target.
void ClearMessageTarget ()
 Clears the Windows messaging target.
BOOL SendWMMessage (WPARAM wParam, LPARAM lParam)
 Sends a Windows message to the target.
BOOL PostWMMessage (WPARAM wParam, LPARAM lParam)
 Posts a Windows message to the target.
virtual BOOL SetCallbackFunction (CMESSAGE_CALLBACK_FUNCTION pFunction, LPVOID pData=NULL)
 Sets the address of the function that will receive callback messages.
BOOL IsCallbackFunction ()
 Returns non-zero if there is a callback function.
void ClearCallbackFunction ()
 Clears the registered callback function address.
CMESSAGE_CALLBACK_FUNCTION GetCallbackFunction ()
 Returns a pointer to the registered callback function.
BOOL DoCallback (WPARAM wParam, LPARAM lParam)
 Performs the function callback.
BOOL MSendMessage (WPARAM wParam, LPARAM lParam, BOOL bFunction=TRUE, BOOL bWMessage=TRUE)
 Send a Windows message and/or do the callback.
BOOL MPostMessage (WPARAM wParam, LPARAM lParam, BOOL bFunction=TRUE, BOOL bWMessage=TRUE)
 Post a Windows message and/or do the callback.

Detailed Description

Provides callback mechanisms.

This class makes it easy to provide callbacks through either Windows messaging or callback functions. The callback mechanism is transparent to the user.


Member Function Documentation

BOOL CMessage::DoCallback WPARAM  wParam,
LPARAM  lParam
[inline]
 

Performs the function callback.

Parameters:
[in] wParam - WPARAM passed on to target
[in] lParam - LPARAM passed on to target
Returns:
Non-zero if success
See also:

BOOL CMessage::MPostMessage WPARAM  wParam,
LPARAM  lParam,
BOOL  bFunction = TRUE,
BOOL  bWMessage = TRUE
[inline]
 

Post a Windows message and/or do the callback.

Parameters:
[in] wParam - WPARAM passed on to target
[in] lParam - LPARAM passed on to target
[in] bFunction - Non-zero to use callback function
[in] bWMessage - Non-zero to use Windows messaging
Returns:
Non-zero if a callback is made
See also:

BOOL CMessage::MSendMessage WPARAM  wParam,
LPARAM  lParam,
BOOL  bFunction = TRUE,
BOOL  bWMessage = TRUE
[inline]
 

Send a Windows message and/or do the callback.

Parameters:
[in] wParam - WPARAM passed on to target
[in] lParam - LPARAM passed on to target
[in] bFunction - Non-zero to use callback function
[in] bWMessage - Non-zero to use Windows messaging
Returns:
Non-zero if a callback is made
See also:

BOOL CMessage::PostWMMessage WPARAM  wParam,
LPARAM  lParam
[inline]
 

Posts a Windows message to the target.

Parameters:
[in] wParam - WPARAM passed on to target
[in] lParam - LPARAM passed on to target
Returns:
Non-zero if success
See also:

BOOL CMessage::SendWMMessage WPARAM  wParam,
LPARAM  lParam
[inline]
 

Sends a Windows message to the target.

Parameters:
[in] wParam - WPARAM passed on to target
[in] lParam - LPARAM passed on to target
Returns:
Non-zero if success
See also:

virtual BOOL CMessage::SetCallbackFunction CMESSAGE_CALLBACK_FUNCTION  pFunction,
LPVOID  pData = NULL
[inline, virtual]
 

Sets the address of the function that will receive callback messages.

Parameters:
[in] pFunction - Callback function address
[in] pData - User data, usually class pointer
Returns:
Non-zeo if success
See also:

void CMessage::SetMessageTarget HWND  hWnd,
UINT  uWMMessageID
[inline]
 

Set the Message ID and window handle that will receive callback messages.

Parameters:
[in] hWnd - The window that will receive messages
[in] uWMMessageID - The MessageID that will be sent to the window when characters are ready.
Returns:
See also:


The documentation for this class was generated from the following file:
  • inc/Message.h
Copyright Robert Umbehant
This documentation is covered by the LGPL