Home · All Commands · First Steps · Tutorials · Demos · FAQ | ||
Remote Interface Documentation |
Classes | |
struct | RI_CActualApplicationState |
Data structure for the Request "ActualApplicationState". More... | |
Functions | |
LRESULT | RI_ActualApplicationState_ReadData (LPARAM, RI_CActualApplicationState &) |
Read data from shared memory for "Actual Application State". | |
Variables | |
const UINT | RI_MESSAGE_CURRENTSTATE = RegisterWindowMessage(TEXT("RI_MESSAGE_CURRENTSTATE")) |
const UINT RI_MESSAGE_CURRENTSTATE = RegisterWindowMessage(TEXT("RI_MESSAGE_CURRENTSTATE")) |
Message ID for the Request "actual application state":
RI_MESSAGE_CURRENTSTATE
RI_ActualApplicationState_ReadData(LPARAM id, RI_CActualApplicationState data );
RI_NOERROR = Actual state of the application succeeded
Returns the current application state as a string. The state represents the current dialog which is shown and can be one of the following strings:
"Intro About ", "MainMenu ", "StationList ", "StationListOptions ", "Tour ", "Navigation ", "Route ", "RouteList ", "DefineDestination ", "DefineDestinationTown ", "DefineDestinationStreet ", "DefineDestinationHouseNr ", "DefineDestinationMap ", "DefineDestinationFavourites ", "DefineDestinationPrevDest ", "TmcMsgs ", "GpsWait ", "GpsInfo ", "NavInfo ", "PreDestinationList ", "Settings ", "SettingsAvoidsect ", "SettingsBaud ", "SettingsBrightness ", "SettingsBrightness ", "SettingsCopyright ", "SettingsDatalink ", "SettingsFavouritesAdminister ", "SettingsFavouritesDetails ", "SettingsFavouritesRename ", "SettingsGeneral ", "SettingsLanguage ", "SettingsMap ", "SettingsPOI ", "SettingsPort ", "SettingsProfile ", "SettingsProfileOverview ", "SettingsStreetPreference ", "SettingsTechnicalLKWData ", "SettingsSaveProfile ", "SettingsRouteoptimisation ", "SettingsSound ", "SettingsTMC ", "TmcListOptions ", "SettingsVehicle ", "SettingsTimeZone ", "SettingsInfo ", "TextBrowser ", "unkown ".
#define USE_LOADLIBRARY #include "TNSRemoteInterfaceDll.h" LPARAM GetUniqueID() { //generate unique ID static LPARAM id = 0; if (++id == 0) ++id; // do not use 0 !!!!! return id; } inline LRESULT RI_MESSAGE( const UINT request, HWND h_client, LPARAM id ) { //check if RI handle is valid if ( !IsWindow( RI_GetTNS() ) ) return RI_NAVIGATIONNOTACTIVE; //send the request PostMessage( RI_GetTNS(), request, WPARAM(h_client), id ); return RI_NOERROR; } LRESULT CDlgMFC_ActualApplicationState::WindowProc ( UINT message , WPARAM wParam , LPARAM lParam ) { //check messages for answer from RI if ( message == RI_MESSAGE_CURRENTSTATE ) { if ( (LRESULT)wParam == RI_NOERROR ) { RI_CActualApplicationState data; LRESULT read_suc = RI_ActualApplicationState_ReadData( lParam, data ); //Actual state of the application succeeded. errorcode (0) TRACE( TEXT("the actual state of the application is: %s"),data.m_Description ); } else //Actual state of the application not succeeded. errorcode (-1) } return CDialog::WindowProc( message, wParam, lParam ); } void CDlgMFC_ActualApplicationState::foo() { LPARAM id = GetUniqueID(); if ( RI_MESSAGE( RI_MESSAGE_CURRENTSTATE, GetSafeHwnd(), id ) == RI_NOERROR ) //message sending succeeded else //navigation software not running }
© PTV AG 2011 | Generated on Fri Oct 14 2011 10:17:32 for RI by 1.7.1 |