Home · All Commands · First Steps · Tutorials · Demos · FAQ
 

Remote Interface Documentation

Variables

AllowUserInteraction: Allow user interaction

Variables

const UINT RI_MESSAGE_ALLOWUSERINTERACTION = RegisterWindowMessage(TEXT("RI_MESSAGE_ALLOWUSERINTERACTION"))

Variable Documentation

const UINT RI_MESSAGE_ALLOWUSERINTERACTION = RegisterWindowMessage(TEXT("RI_MESSAGE_ALLOWUSERINTERACTION"))

Message ID for the Request "allow user interaction":
RI_MESSAGE_ALLOWUSERINTERACTION

Write Memory:

This function has no writer.

Read Memory:

This function has no reader.

Return Values for AllowUserInteraction:

RI_NOERROR = AllowUserInteraction succeeded. errorcode (0)

Description:

Enables the user interaction (mouse and key) with the navigator.
To disabe the user input, see BlockUserInteraction.

Example:

#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_AllowUserInteraction::WindowProc ( UINT  message , WPARAM  wParam , LPARAM  lParam )
{
    //check messages for answer from RI
    if ( message == RI_MESSAGE_ALLOWUSERINTERACTION )
    {
        if ( (LRESULT)wParam == RI_NOERROR )
            //AllowUserInteraction succeeded. errorcode (0)
        else
            //AllowUserInteraction not succeeded. errorcode (-1)
    }
    return CDialog::WindowProc( message, wParam, lParam );
}

void CDlgMFC_AllowUserInteraction::foo()
{
    LPARAM id = GetUniqueID();
    if ( RI_MESSAGE( RI_MESSAGE_ALLOWUSERINTERACTION, 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 doxygen 1.7.1