Solved

Auto resizing while playing video?

Posted on 1997-03-25
3
391 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 123
Process filename extension 3 172
substring method in java 1 96
Problem to event 3 75
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now