Hi,
I am trying to layer videos over each other. Imagine I have one big video playing which fills the whole window, then am playing short small clips over the top.
I am using the WMPSDK, and can get a video playing on top of another, based on the sample code WMPHost.
The videos are all child windows of the application window, the root. I am creating instances of the CWMPHost class from the sample.
My problem is I don't seem to be able to order the windows, top to bottom. Here are my attempts, all useless!
//HWND bg; // handle to background video/jpg
// HWND vid; // handle to clip I am trying to overlay
// ignore x and y stuff
SetWindowPos( vid, bg, x, y, w, h, 0 );
SetWindowPos( vid, HWND_TOPMOST, x, y, w, h, 0 );
SetWindowPos( vid, HWND_TOP, x, y, w, h, 0 );
SetWindowPos( bg, HWND_NOTOPMOST, x, y, w, h, 0 );
SetWindowPos( vid, HWND_TOP, x, y, w, h, 0 );
SetWindowPos( bg, HWND_BOTTOM, x, y, w, h, 0 );
I know my handles are good since this works:
// Show video
SetWindowPos(vid, NULL, m_x, m_y, m_w, m_h, SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER | SWP_SHOWWINDOW );
// Hide video
SetWindowPos(vid, NULL, m_x, m_y, m_w, m_h, SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER | SWP_HIDEWINDOW );
The ordering of layers seems to be pretty undefined :(
Anyone shed any light on this for me? Thank you
[Edited by - sipickles on July 8, 2007 11:31:06 AM]