Using MCIWndPutSource
-
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.
-
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.
See
MCI_WINDOW
. -
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.
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.
-
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.
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.
-
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.
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.
-
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.
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.
-
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.
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)