Solved

Auto resizing while playing video?

Posted on 1997-03-25
3
403 Views
Last Modified: 2013-11-20
Hi:
  I have an object of a class derived from CWnd and use this window to play video. (Under VC++4.2 and Win95). What I want to do is that the video image can cover entire client area while the size of the window changed(enlarge of shrink). I don't care the quality of the image. Now I am doing that by handling the ON_WM_WINDOWPOSCHANGED message and using some functions supported by the device driver(for the video playing). The problem is I want to develop a generic application, so I can't use those special functions. Is there anything I can do when I create the displaying window so it can do what I want. I saw an application doing exact the same thing. I went through the Online help and still have no idea. I read the Resizing sample from Microsoft but thats not what I need. I think what I need is something like changing the size of fonts while the size of windows changed. I have no control of the video display.(I'm using MCI drivers and MCI_PUT doesn't work for all cases)
0
Comment
Question by:danli020797
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 300 total points
ID: 1300678
You should handle ON_WM_SIZE instead of ON_WM_WINDOWPOSCHANGED. Send MCI_PUT in the handler.

Another easier way is to use MCIWnd window class to play video. You can see the Visual C++ 4.2 documentations for more details:
SDKs/Win32 SDK/Multimedia/Media Control Interface/MCIWnd Window Class.

0
 

Author Comment

by:danli020797
ID: 1300679
Thank you for your answer.
The problem I had was a little bit complicate(for me). One of the mci driver I used didn't support MCI_PUT the way it should be so I needed to do it manually. The solution I have now is using the video window as a child window of the main, then use MoveWindow() in WM_SIZE/WM_WINDOWPOSCHANGED handler and it's working ok. The odd thing is if I use WM_SIZE handler with the mci driver that is not support MCI_PUT, I will have problem while moving the whole window without resizing it. There's no problem when I run the same code with another mci driver which implement MCI_PUT correctly but I don't think there's any relation between this. maybe there is some bug in the (bad) mci driver. But I still have a "minor" thing need to solve, which is, if I move the window partly outside off the left side of desktop(rect.left < 0), the video window doesn't move along, any idea? It only happened to the left side.
  The reason I do not use MCIWnd is that I am afraid the MCI window will be destroyed when I switch devices(closing a video device and open another one, for example). If that is not the case, could you please let me know?
  Again, appreciate your help.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1300680
Do you use the window style WS_POPUP or WS_CHILD? If it is WS_CHILD, it is likely that the action you described is a bug of the MCI driver. MCIWnd can do everything that MCI command can do. You can keep the window when you switch devices if you create the MCIWnd window without specifying a device or media file.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
while loop over for loop 7 119
difference between String.subString() and String.subSequence() 6 291
Thin secure Windows 10 5 116
How do I get Window Title of all opened process? 4 61
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question