Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Using MCIWndPutSource

Using MCIWndPutSource

Scheduled Pinned Locked Moved C / C++ / MFC
c++designquestion
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    goodoljosh1980
    wrote on last edited by
    #1

    I am using the MCIWnd class to play a video within my MFC application. However, the video location in the UI defaults to the upper left hand corner. I am trying to move that location using the MCIWndPutSource function. Here is what I am trying:

    m_Player = MCIWndCreate(GetSafeHwnd(),AfxGetInstanceHandle(),
    WS_CHILDWINDOW | WS_VISIBLE | MCIWNDF_NOMENU, name);

    RECT \*temp = new RECT;
    temp->left = 0;
    temp->top = 500;
    temp->right = 320;
    temp->bottom = 740;
    
    MCIWndSetZoom(m\_Player, 200);
    MCIWndPutSource(m\_Player, temp);
    MCIWndPlay(m\_Player);
    

    After the PutSource call, if I call the GetSource function, it returns back the original coordinates as if I did not move the location at all. Anyone have an idea why this isn't working, or how I can accomplish this another way? Thanks for anything.

    H R 2 Replies Last reply
    0
    • G goodoljosh1980

      I am using the MCIWnd class to play a video within my MFC application. However, the video location in the UI defaults to the upper left hand corner. I am trying to move that location using the MCIWndPutSource function. Here is what I am trying:

      m_Player = MCIWndCreate(GetSafeHwnd(),AfxGetInstanceHandle(),
      WS_CHILDWINDOW | WS_VISIBLE | MCIWNDF_NOMENU, name);

      RECT \*temp = new RECT;
      temp->left = 0;
      temp->top = 500;
      temp->right = 320;
      temp->bottom = 740;
      
      MCIWndSetZoom(m\_Player, 200);
      MCIWndPutSource(m\_Player, temp);
      MCIWndPlay(m\_Player);
      

      After the PutSource call, if I call the GetSource function, it returns back the original coordinates as if I did not move the location at all. Anyone have an idea why this isn't working, or how I can accomplish this another way? Thanks for anything.

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      See MCI_WINDOW.

      1 Reply Last reply
      0
      • G goodoljosh1980

        I am using the MCIWnd class to play a video within my MFC application. However, the video location in the UI defaults to the upper left hand corner. I am trying to move that location using the MCIWndPutSource function. Here is what I am trying:

        m_Player = MCIWndCreate(GetSafeHwnd(),AfxGetInstanceHandle(),
        WS_CHILDWINDOW | WS_VISIBLE | MCIWNDF_NOMENU, name);

        RECT \*temp = new RECT;
        temp->left = 0;
        temp->top = 500;
        temp->right = 320;
        temp->bottom = 740;
        
        MCIWndSetZoom(m\_Player, 200);
        MCIWndPutSource(m\_Player, temp);
        MCIWndPlay(m\_Player);
        

        After the PutSource call, if I call the GetSource function, it returns back the original coordinates as if I did not move the location at all. Anyone have an idea why this isn't working, or how I can accomplish this another way? Thanks for anything.

        R Offline
        R Offline
        Rajkumar R
        wrote on last edited by
        #3

        MCIWndPutSource is to crop the video image, it seems you want to use MCIWndPutDest. And it seems MCIWndPutSource fails; you haven't checked the return value, because may be the rectangle you specified is out of bound of the video image.

        G 1 Reply Last reply
        0
        • R Rajkumar R

          MCIWndPutSource is to crop the video image, it seems you want to use MCIWndPutDest. And it seems MCIWndPutSource fails; you haven't checked the return value, because may be the rectangle you specified is out of bound of the video image.

          G Offline
          G Offline
          goodoljosh1980
          wrote on last edited by
          #4

          Rajkumar R wrote:

          MCIWndPutSource is to crop the video image, it seems you want to use MCIWndPutDest.

          I have tried the PutDest function as well. When I use this, the video inside the window shifts, but the window in which it plays does not. Basically, when the video starts to play, the child window (the video player) defaults to the upper left hand corner. If I use any of the MCI functions, it seems that the video within the player window will shift, but not the window itself which is what I am looking for.

          R 1 Reply Last reply
          0
          • G goodoljosh1980

            Rajkumar R wrote:

            MCIWndPutSource is to crop the video image, it seems you want to use MCIWndPutDest.

            I have tried the PutDest function as well. When I use this, the video inside the window shifts, but the window in which it plays does not. Basically, when the video starts to play, the child window (the video player) defaults to the upper left hand corner. If I use any of the MCI functions, it seems that the video within the player window will shift, but not the window itself which is what I am looking for.

            R Offline
            R Offline
            Rajkumar R
            wrote on last edited by
            #5

            then you just want to move the MCI child window, m_Player, right? MoveWindow, SetWindowPos.

            RECT *temp = new RECT;
            temp->left = 0;
            temp->top = 500;
            temp->right = 320;
            temp->bottom = 740;
            BOOL MoveWindow(
            m_Player // HWND hWnd,
            temp->left, //int X,
            temp->top , //int Y,
            temp->right - temp->left, // int nWidth,
            temp->bottom - temp->top, //int nHeight,
            TRUE //BOOL bRepaint
            );

            remember you are positioning relative to parent window. I thought you are trying to position the video within the MCI window.

            G 1 Reply Last reply
            0
            • R Rajkumar R

              then you just want to move the MCI child window, m_Player, right? MoveWindow, SetWindowPos.

              RECT *temp = new RECT;
              temp->left = 0;
              temp->top = 500;
              temp->right = 320;
              temp->bottom = 740;
              BOOL MoveWindow(
              m_Player // HWND hWnd,
              temp->left, //int X,
              temp->top , //int Y,
              temp->right - temp->left, // int nWidth,
              temp->bottom - temp->top, //int nHeight,
              TRUE //BOOL bRepaint
              );

              remember you are positioning relative to parent window. I thought you are trying to position the video within the MCI window.

              G Offline
              G Offline
              goodoljosh1980
              wrote on last edited by
              #6

              Rajkumar R wrote:

              then you just want to move the MCI child window, m_Player, right?

              Yes, I want to move the child window, but neither MoveWindow or SetWindowPos allow me to do that from what I can tell.

              R 1 Reply Last reply
              0
              • G goodoljosh1980

                Rajkumar R wrote:

                then you just want to move the MCI child window, m_Player, right?

                Yes, I want to move the child window, but neither MoveWindow or SetWindowPos allow me to do that from what I can tell.

                R Offline
                R Offline
                Rajkumar R
                wrote on last edited by
                #7

                I don't remember, try MCIWNDF_NOAUTOSIZEWINDOW in MCIWndCreate if not working, i think you need to move the parent window (that is specify a movable child window as parent window of MCI window)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups