Defining the Structure
The members of the structure for an MCI message are always 32 bits long - the size of doubleword values. The number of members in the structure depends on the particular message. The first member must be reserved for a handle to a window function used with the MCI_NOTIFY flag. The next members in the structure depend on the type of data returned for the message:
- If no data is returned, no return members are reserved in the structure. Any data members for passing information to the device driver immediately follow the dwCallback member.
- If integer data is returned, the second member of the structure is reserved for the return data. Any data members for passing information to the device driver start in the third member.
- Return data. The second DWORD is assigned to a member reserved for a pointer to the zero-terminated return string. The third DWORD is assigned to a member reserved for the size of return buffer. The application is responsible for creating the buffer for return string. Any data members for passing information to the device driver start in the fourth member.
- If RECT data is returned, the second and third members of the structure are reserved for the return data. The first DWORD position is reserved for the top-left values of the RECT data. The second DWORD position is reserved for the bottom-right values of the RECT data. Any data members for passing information to the device driver start in the fourth DWORD position. Rather than specifying two DWORDs for the RECT data, most structure definitions use one RECT data member to obtain an equivalent structure.