Garmin Fleet Management Controller  2.19.0
CWndEventListener.cpp
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * MODULE NAME:
4 * CWndEventListener.cpp
5 *
6 * Copyright 2008-2009 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 
11 #include "stdafx.h"
12 
13 #include "CWndEventListener.h"
14 
15 //----------------------------------------------------------------------
27 //----------------------------------------------------------------------
29  (
30  EventId aEventId,
31  uint32 aEventData,
32  void* aEventDataPtr,
33  BOOL handleNow
34  )
35 {
36  CWnd* thisWindow = dynamic_cast<CWnd*>( this );
37  UINT windowsEventId = WM_EVENT( aEventId );
38 
39  ASSERT( thisWindow != NULL );
40  ASSERT( aEventId < EVENT_ID_CNT );
41 
42  if( IsWindow( thisWindow->m_hWnd ) )
43  {
44  if( handleNow )
45  {
46  thisWindow->SendMessage( windowsEventId, (WPARAM)aEventData, (LPARAM)aEventDataPtr );
47  }
48  else
49  {
50  thisWindow->PostMessage( windowsEventId, (WPARAM)aEventData, (LPARAM)aEventDataPtr );
51  }
52  }
53 }
void onEvent(EventId aEventId, uint32 aEventData, void *aEventDataPtr, BOOL handleNow)
Handles event callbacks by translating an EventId into a windows message.
EventId
Events generated by the FMI PC Application.
Definition: EventId.h:19
#define WM_EVENT(_event)
Translation from an application event to the corresponding Windows message.
unsigned long int uint32
32-bit unsigned integer
Definition: garmin_types.h:66