NMX_RegisterMessage_1

<< Click to Display Table of Contents >>

Navigation:  NmxDLL Reference Guide > API (programming interface) > Notifications >

NMX_RegisterMessage_1

This function is used to register a notification message at the DLL.

 

Definition


NMX_STATUS NMX_RegisterMessage_1(

 NMX_PHANDLE pHandle,

 unsigned long ulNotification,

 HWND hWnd,

 unsigned long ulMsgCode,

 WPARAM tWParam,

 LPARAM tLParam);

 

Parameter


pHandle

Connection Handle.

ulNotification

Notification type, e.g. NMXNOTIFY_NEW_STATIC32.

hWnd

Window Handle of the Windows Window, which handles the message queue.

ulMsgCode

Message number, which must be defined by the application (see also comment below).

tWParam

The wParam of the Windows message.

tLParam

The lParam of the Windows message.

 

Typical function call (C example)


NMX_RegisterMessage_1(pHandle, NMXNOTIFY_NEW_STATIC32, static_cast<HWND>(Handle.ToPointer()), WM_MESSAGE_NEW_STATIC32, 0, 0);

 

.Net DLL specific implementation


NMX_MSTATUS RegisterMessage_1(

                 System::IntPtr pHandle,

                 NMX_NOTIFICATION eNotification,

                 System::IntPtr hWnd,

                 System::UInt32 ulMsgCode,

                 System::UInt32 tWParam,

                 System::UInt32 tLParam);

NMX_NOTIFICATION is an enum type, which is defined in the .Net - DLL. The available notifications are identical to the standard notifications, except that they don't have a fixed binary representation.

 

Comments


If hWnd is NULL, a registered message will be cleared.

 

Message Code (ulMsgCode)


The message-number is defined by your application. Using Visual C++, this can be done for example as follows:

#define WM_MESSAGE_DISCONNECTED                        (WM_USER + NMXNOTIFY_DISCONNECTED)

#define WM_MESSAGE_FAILURE_DATA_EXCHANGE                (WM_USER + NMXNOTIFY_FAILURE_DATA_EXCHANGE)

#define WM_MESSAGE_RECONNECTED                        (WM_USER + NMXNOTIFY_RECONNECTED)

#define WM_MESSAGE_NEW_STATIC32                        (WM_USER + NMXNOTIFY_NEW_STATIC32)

#define WM_MESSAGE_SAMPLING_NEWDATA                        (WM_USER + NMXNOTIFY_SAMPLING_NEW_DATA)

#define WM_MESSAGE_SAMPLING_ALLRECEIVED                (WM_USER + NMXNOTIFY_SAMPLING_ALL_DATA_RECEIVED)

#define WM_MESSAGE_SAMPLING_FINISHED                (WM_USER + NMXNOTIFY_SAMPLING_FINISHED)

#define WM_MESSAGE_SAMPLING_ERROR                        (WM_USER + NMXNOTIFY_SAMPLING_ERROR)

#define WM_MESSAGE_SAMPLING_BUFFER_OVERFLOW        (WM_USER + NMXNOTIFY_SAMPLING_BUFFER_OVERFLOW)

#define WM_MESSAGE_SAMPLING_TIMEOUT                        (WM_USER + NMXNOTIFY_SAMPLING_TIMEOUT)