The following code illustrates several examples of how to specify the window and the window characteristics that a graphic device uses with MCI_WINDOW.

/* Use for (MCI_DGV_WINDOW_DEFAULT) */
   USHORT  usUserParm = 0;
   ULONG   ulReturn;
   MCI_DGV_WINDOW_PARMS mciWindowParms;

   memset (&mciWindowParms, 0x00, sizeof (MCI_DGV_WINDOW_PARMS));
   mciWindowParms.hwndCallback = hwndNotify;
   mciWindowParms.hwndDest = 0;

   ulReturn = mciSendCommand(usDeviceID, MCI_WINDOW,
                  MCI_WAIT | MCI_DGV_WINDOW_DEFAULT,
                  (PVOID)&mciWindowParms,
                  usUserParm);


   /* Use for MCI_WINDOW (MCI_DGV_WINDOW_HWND) */
   USHORT  usUserParm = 0;
   ULONG   ulReturn;
   MCI_DGV_WINDOW_PARMS mciWindowParms;

   memset (&mciWindowParms, 0x00, sizeof (MCI_DGV_WINDOW_PARMS));
   mciWindowParms.Callback = hwndNotify;
   mciWindowParms.hwndDest = hwndAlternate;

   ulReturn = mciSendCommand(usDeviceID, MCI_WINDOW,
                  MCI_WAIT | MCI_DGV_WINDOW_HWND,
                  (PVOID)&mciWindowParms,
                  usUserParm);

   /* Use for MCI_WINDOW (MCI_DGV_WINDOW_STATE) */
   USHORT  usUserParm = 0;
   ULONG   ulReturn;
   MCI_DGV_WINDOW_PARMS mciWindowParms;

   /* An example of a message to SHOW the current video window */
   memset (&mciWindowParms, 0x00, sizeof (MCI_DGV_WINDOW_PARMS));
   mciWindowParms.hwndCallback = hwndNotify;
   mciWindowParms.hwndDest = 0;
   mciWindowParms.usCmdShow = (INT)SWP_SHOW;

   ulReturn = mciSendCommand(usDeviceID, MCI_WINDOW,
                  MCI_WAIT | MCI_DGV_WINDOW_STATE,
                  (PVOID)&mciWindowParms,
                  usUserParm);

   /* Use for MCI_WINDOW (MCI_DGV_WINDOW_TEXT) */
   USHORT  usUserParm = 0;
   ULONG   ulReturn;
   MCI_DGV_WINDOW_PARMS mciWindowParms;

   memset (&mciWindowParms, 0x00, sizeof (MCI_DGV_WINDOW_PARMS));
   mciWindowParms.hwndCallback = hwndNotify;
   mciWindowParms.hwndDest = 0;
   mciWindowParms.pszText= (PSZ)"New Caption";

   ulReturn = mciSendCommand(usDeviceID, MCI_WINDOW,
                  MCI_WAIT | MCI_DGV_WINDOW_TEXT,
                  (PVOID)&mciWindowParms,
                  usUserParm);


[Back] [Next]