LXDeviceAPI

Definition

 

int SetMessageDevice_LXDeviceAPI(int device_handling_id,int msgtype_id,HWND hwnd_msgrcv,int msg_id,int onoff);

Parameters

Parameter Available Value Description
int device_handling_id
  • return value of OpenDevice
int msgtype_id
  • MSGTYPEID0_DEVICE_LXDAPI
  • MSGTYPEID9_DEVICE_LXDAPI
Predefined on LXDeviceAPI.h
HWAND hwnd_msgrcv
  • window handle
App.’s window handle to receive the message from LXDeviceAPI.
int msg_id
  • WM_USER ~ WM_USER+31643
  • WM_APP ~ WM_APP+16383
You should define the unique message id without duplication with the other messages in your project.
int onoff
  • 0 : message off
  • 1 : message on
 message(correspond to int msgtype_id ) on/off

Return Values

Return  meaning Description
 1  Success
 -3  Fail. No device(correspond to int device_handling_id).
 -10  Fail. Wrong calling order. SetMessageDevice should be called after OpenApi.

Code Example

#define WM_STREAM_DEVICE  WM_USER+203 // You must define the message without duplication with any other messages in your program.

void CLXDeviceAPI_Sample1View::OnMenuSetmessagedevice()
{
  // Mandatory for receiving the stream data from LXDeviceAPI.
  SetMessageDevice_LXDeviceAPI(m_iDeviceHandlingID, MSGTYPEID0_DEVICE_LXDAPI, this->m_hWnd, WM_STREAM_DEVICE,1); 
}