MCI_WHERE
Appearance
This message returns the coordinates of the source and destination rectangles, as well as the current location of the video window.
Syntax
param1 ULONG ulParam1; /* Message flags. */ param2 PMCI_VID_RECT_PARMS pParam2; /* Pointer to rectangle structure. */
Parameters
- ulParam1 (ULONG) - input
- This parameter can contain any of the following flags:
- * MCI_NOTIFY — Posts a notification message when the action completes.
- * MCI_WAIT — Does not return control until the action completes.
- Digital Video Extensions
- * MCI_DGV_WHERE_DESTINATION — Returns the destination display rectangle in the `rc` field.
- * MCI_DGV_WHERE_SOURCE — Returns the video source rectangle in the `rc` field.
- * MCI_DGV_WHERE_ADJUSTED — Used with `RECORD` flags. Returns the actual coordinates that will be used by capture hardware based on MCI_PUT settings.
- * MCI_DGV_WHERE_WINDOW — Returns the current location of the video window relative to its parent.
- * MCI_DGV_MONITOR — Returns the size and position for the monitor window.
- * MCI_DGV_RECORD — Returns the source and destination rectangles for video capture.
- Video Overlay Extensions
- * MCI_OVLY_WHERE_DESTINATION — Returns the destination display rectangle.
- * MCI_OVLY_WHERE_SOURCE — Returns the video overlay source rectangle.
- * MCI_OVLY_WHERE_WINDOW — Returns the video window location relative to its parent.
- pParam2 (PMCI_VID_RECT_PARMS) - input/output
- A pointer to an MCI_VID_RECT_PARMS structure. Specific devices may require:
- * PMCI_DGV_RECT_PARMS — For digital video devices.
- * PMCI_OVLY_RECT_PARMS — For video overlay devices.
Return Value
- rc (ULONG)
- * MCIERR_SUCCESS — Command completed successfully.
- * MCIERR_OUT_OF_MEMORY — System out of memory.
- * MCIERR_INVALID_DEVICE_ID — Invalid device ID.
- * MCIERR_MISSING_PARAMETER — A required parameter is missing.
- * MCIERR_DRIVER — Internal driver error.
- * MCIERR_INVALID_FLAG — Invalid flag specified.
- * MCIERR_FLAGS_NOT_COMPATIBLE — Specified flags cannot be used together.
- * MCIERR_INSTANCE_INACTIVE — Device instance is inactive.
Remarks
The flags and parameters available depend on the specific device being queried.
Note: The resulting coordinates are returned directly into the rc (RECTL) field of the structure pointed to by pParam2.
Related Messages
Example Code
The following code demonstrates how to query the current destination video sub-rectangle within the video window.
MCI_DGV_RECT_PARMS mciRectParms;
USHORT usUserParm = 0;
ULONG ulReturn;
LONG lX1, lX2, lY1, lY2;
/* Initialize structure */
memset (&mciRectParms, 0x00, sizeof (MCI_DGV_RECT_PARMS));
mciRectParms.hwndCallback = hwndNotify;
/* Query the current destination rectangle */
ulReturn = mciSendCommand(usDeviceID, MCI_WHERE,
MCI_WAIT | MCI_DGV_WHERE_DESTINATION,
(PVOID)&mciRectParms,
usUserParm);
/* Extract coordinates from the returned RECTL structure */
lX1 = mciRectParms.rc.xLeft;
lY1 = mciRectParms.rc.yBottom;
lX2 = mciRectParms.rc.xRight;
lY2 = mciRectParms.rc.yTop;