Creating Message Parameters

Before a message can be passed to a target window, its message parameters must be created from the necessary data items. As mentioned in Messages, message parameters are 32-bit fields. Presentation Manager provides a number of macros to convert existing data types into the correct representation, and to extract data from message parameters within the target window procedure. These macros are described in Table "Presentation Manager Macros". For example, to create message parameter mp1 composed of two unsigned integers usInt1 and usInt2, the following statement is used:

mp1 = MPFROM2SHORT(usInt1,usInt2);

Similarly, to extract two unsigned integers usInt3 and usInt4 from the message parameter mp2, the following statements are used:

usInt3 = SHORT1FROMMP(mp2);
usInt4 = SHORT2FROMMP(mp2);

Characters, pointers, window handles, etc., may all be placed into and retrieved from message parameters using macros supplied by Presentation Manager.


[Back: Identifying the Destination Window]
[Next: Broadcasting Messages]