Solved

Auto resizing while playing video?

Posted on 1997-03-25
3
395 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 AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Detect CR LF to each line 12 159
wordcount challenge 11 121
Message not shown 5 50
Way to decrease size of apk file 9 67
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…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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