Trux Configuration Guide
Custom OS Installations
E-EQ-TRUXCONFIG-D-ARC 137
Send data directly to an application
In some cases a more direct communication between WLinq and the receiving program is needed.
In WLinq 2.10 and later there is an alternative way of sending data to a program. Instead of
simulating key presses, the data strings can be sent with the message WM_COPYDATA to the
receiving program.
The advantages for sending data in this way are:
In one test the processing speed was increased by 40 to 70 times compared to sending via
key presses.
The receiving program does not need to have an input field where the data string is received.
Data is not sent to the active window. Only to the program that has registered themselves as
receivers of data from WLinq.
More than one program can receive the same data simultaneously. This makes it possible to
have a monitoring program that eases trouble shooting.
A disadvantage is of course that the receiving program has to be customized to receive data from
WLinq.
There is no setting in WLinq that tells it to send data via the WM_COPYDATA message. Instead
WLinq switches to use WM_COPYDATA as soon as a program registers itself as a receiver. This is
how it works:
WLinq is started and it registers the Windows message "WLinq32.Subscribe". At this time WLinq
will send data as key presses.
The receiving program is started. It also registers the message "WLinq32.Subscribe" and then
looks up the handle to WLinq's window. Then the program send the message "WLinq32.Subscribe"
together with the program's window handle to WLinq's window.
WLinq now registers the program as a subscriber of WM_COPYDATA messages. WLinq switches to
sending data via WM_COPYDATA instead of simulating key presses.
When WLinq receives a data string on the serial port, the usual string processing occurs (string
replacement, data editing and so on), but instead of simulating key presses the resulting data
string is sent via the WM_COPYDATA message to the programs that has registered as subscribers.
It is worth mentioning that it is not possible to send keys like HOME or END via WM_COPYDATA.
Only characters with ASCII-values between 1 and 255 can be sent.
Sample code
All code samples are in the programming language C++.
The following sample shows how to register the Subscribe message:
The code below shows how to find the handle to WLinq's window:
Summary of Contents for Akerstroms Tx700
Page 1: ...Trux Configuration Guide Tx700 Tx800...
Page 8: ...Table of Contents User Manual Tx800 8 E EQ TRUXCONFIG D ARC...
Page 46: ...Touchscreen Trux Configuration Guide 46 E EQ TRUXCONFIG D ARC...
Page 86: ...WAN Trux Configuration Guide 86 E EQ TRUXCONFIG D ARC...
Page 90: ...Custom OS Installations Trux Configuration Guide 90 E EQ TRUXCONFIG D ARC...
Page 145: ...Trux Configuration Guide Custom OS Installations E EQ TRUXCONFIG D ARC 145...