The following code illustrates how to save a device element to a new file and receive notification upon completion.
USHORT usDeviceID; HWND hwndMyWindow; MCI_SAVE_PARMS msp; /* Assign hwndCallback the handle to the PM Window */ msp.hwndCallback = hwndMyWindow; msp.pszFileName = (PVOID) "movie.avi"; /* File name to save */ mciSendCommand( usDeviceID, /* Device ID */ MCI_SAVE, /* MCI save message */ MCI_NOTIFY | MCI_SAVE_VIDEO_FILE, /* Flags for this message */ (PVOID) &msp, /* Data structure */ 0); /* No user parm */