|
-
Nov 4th, 2001, 09:08 AM
#1
Thread Starter
New Member
How to get hWnd from an MediaPlayer OCX
Hi there,
For some reason I need to know the hWnd of a MediaPlayer Control which is placed on my form.
Every other control offers a hWnd as a property. But not bloody MediaPlayer 7.01
Strange thing: "ActiveMovie" Control (which comes to provide compatibility) offers hWnd. But I can't use ActiveMove cause it does not support some other needed features of MediaPlayer.
Any ideas ?
Thanks,
Hias
-
Nov 4th, 2001, 09:53 AM
#2
Hyperactive Member
maybe I'm able to help you if you say why you need the hWnd. We can figure out then what other possibilities you have. I've tried with the function windowfrompoint to receive his hwnd, that didn't work out. By using Spy++ you can get the hWnd of an object named 'VBFocus'. When I delete the mediaplayercontrol, the VBFocus object isn't there anymore, so I suppose that the mediaplayer is called 'VBFocus'.
Now, you can try to use EnumChildWindows and pass it your window's hwnd. You ask for every hwnd you get with the callbackfuntion his classname. If it is VBFocus, then that should be the hwnd of the mediaplayercontrol.
-
Nov 4th, 2001, 10:10 AM
#3
Thread Starter
New Member
Well, I need the hWnd for capturing media-player's window content.
The good thing is: now I know how to retrieve the hWnd. Its as simple:
Dim hWnd as Long
hWnd = MediaPlayer1.ActiveMovie.hWnd
ActiveMovie is a pseudo object within mediaplayer for backward compatibility.
The bad thing is: capturing media-player's window content does not work.
I tried out several methods - all same result: wenever a video is loaded, running or paused: capture content is black
Do you know this problem ?
Hias
-
Nov 4th, 2001, 10:18 AM
#4
Hyperactive Member
With capturing, do you mean copying the hDC from the control/making a screenshot with VB? (I'm dutch, no good english )
-
Nov 9th, 2001, 01:48 PM
#5
Thread Starter
New Member
Hi,
Exactly, I wanna get snapshots of the video which is currently played by mediaplayer.
The "classic" way (BitBlt'ing from the Media-Players hDC) does not work correct:
If Mediaplayer is just startet, without playing a video, it is showing its microsoft logo. In this case BitBlt is working. But if I start a video (AVI or MPG) BitBlt does not work any longer - I get just grey bitmaps.
I hate it !
Hias
-
Nov 10th, 2001, 11:50 AM
#6
Hyperactive Member
Can't help you here, 'cause I always make a screebshot by using bitblt, but I'm very interested in how they disabled that for that part of the screen. In my school they are using a program that shows on the head computer what the other computers are doing, by making a screenshot of the target computer, so we can't play games anymore. If someone knows how to create a program that disables capturing the screen, this guy's very interested
-
Jun 10th, 2002, 04:04 PM
#7
New Member
-
Jun 10th, 2002, 06:25 PM
#8
The picture isn't missing
obviously none of you have ever heard of overlay.
wheny ou use hardware acceleration for Media Player, it doesn't print it on the screen. it prints it almost the same way it shows the mouse. it's just faster. you will need to go to options and turn hardware acceleration all the way to 0
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jun 10th, 2002, 06:26 PM
#9
The picture isn't missing
and just so you don't ask, you can't take screenshots of the overlay
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Jun 10th, 2002, 06:27 PM
#10
The picture isn't missing
if you have a dvd-rom, play a dvd and take a screenshot and paste it into paint. if the movie is still playing you can see the overlay, so the picture is moving.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|