Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 488
  • Last Modified:

ActiveMovie window problem

I am writing a program to play an mpeg file in a window using active movie.  The problem I have is that I need to detect when the user clicks on the movie.  This seem to pose a problem because active movie will always (I think..) create a window of its own.

Is there anyway I can get click messages from the active movie window?
Or, is there anyway I can get active movie to use my application window for playing the movie?
0
Gumpster
Asked:
Gumpster
  • 2
  • 2
1 Solution
 
nietodCommented:
One way would be to use a system hook to look for mouse clicks int he move window.  However, there might be a better (more direct) way.  I'll leave this as a comment fo now and lets see if there are better answers.
0
 
chensuCommented:
The ActiveMovie Control supports several events common to other controls: Click, DblClick, KeyDown, KeyPress, KeyUp, MouseDown, MouseMove, and MouseUp. Just create the event sink to capture the event.
0
 
GumpsterAuthor Commented:
I am programming this application in VC5, using direct COM calls.  I have not found any reference to event sinks in the (poor..) documentation, with reference to IVideoWindow or anyother activemovie interfaces.

Is it possible to use an event sink on an IVideoWindow interface?

Also, I think I read somewhere that un-handled Windows Messages from a child window where sent to the parent window.  If this is true, is it possible to trap these messages?
0
 
chensuCommented:
So, you are not using the ActiveMovie Control.

You can capture the WM_PARENTNOTIFY message for the parent window. The WM_PARENTNOTIFY message is sent to the parent of a child window when the child window is created or destroyed, or when the user clicks a mouse button while the cursor is over the child window. You can even get the coordinates.
0
 
GumpsterAuthor Commented:
Thanks very much for your help!
I've found that the IMediaEvent method 'SetNotifyWindow' allows you to set a window where events, like WM_LBUTTONDOWN, are sent.

This solution seems to work fine!
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now