Solved

Auto resizing while playing video?

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 58
Separate files macro - Errors on larger data set 18 56
dog bark java program 15 82
pre4 challenge 19 88
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This video discusses moving either the default database or any database to a new volume.

705 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

20 Experts available now in Live!

Get 1:1 Help Now