Xerox -05W Printer User Manual


 
13-19
Dynamic Data Exchange
The first four functions in the table enable interrogation of TeemTalk. The remaining
functions are described in the following sections.
All functions referenced with the "Session" topic can additionally be performed using
a topic name relating to the relevant TeemTalk instance, i.e. TTLK1, TTLK2, etc. as
discussed in the section Using The Edit Menu DDE Functions earlier.
If a TeemTalk session has been created other than Untitled, then that session name can
be used as the current session topic by an application conversing with TeemTalk. Note
that changing the session name will remove the link to the session.
SendMouse & SendMouseStr
SendMouse is used to send the coordinates of a mouse click to a remote application
(i.e. host).
The data structure passed across a DDE link between two co-operating applications
is defined in the DDE.H file (supplied as part of the Windows SDK) as follows:
typedef struct tagDDEPOKE
{
WORD unused:13, /* Earlier versions of DDE.H incorrectly */
/* 12 unused bits. */
fRelease:1,
fReserved:2,
short cfFormat;
BYTE Value[1]; /* This member was named rgb[1] in */
/* previous versions of DDE.H */
} DDEPOKE;
In order to supply the three values expected by TeemTalk, we have defined a
DDE_MOUSE_REPORT structure as follows:
typedef struct DDE_MOUSE_REPORT
{
int X;
int Y;
int ButtonID;
} DDEMOUSEREPORT, FAR *LPDDEMOUSERPORT;
This needs to be integrated with the DDEPOKE structure when allocating the
memory required to transfer this data to TeemTalk. One way of doing this is shown
below.
/* Allocate size of DDE data header, plus the mouse hit data: */
/* terminated by <CR> <LF> <NULL>. The <NULL> is counted */
/* by DDEPOKE.Value[1] */
if (!(hPokeData
= GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,