About Desktop Play!

Started by
24 comments, last by Eddycharly 15 years, 5 months ago
Hi all, I want to play videos on desktop and the videos must behind all the icons on the desktop. Can anybody help me? Thanks in advance!
Advertisement
I know that Windows Vista Ultimate supports having a video as your background outright (it's called DreamScene). Windows Vista Premium apparently has the capability and it just needs to be unlocked. If that's your os, a google search for Vista Home Premium Dreamscene will get you headed in the right direction.

I've never personally dealt with it on any other platform, but I believe VLC Media Player has the capability to do what you're wanting in Win XP. I have no clue if that same functionality crosses over to Linux.

Dreamscene is what Microsoft has named that feature, so using the word dreamscene in a search along with your platform will probably get you some good results.

Hope that helps.
Hi j-locke,

Thanks for your reply! My platform is XP and i have checked source codes of the VLC player. I found that it only create a overlay on the desktop, and then
do something with the coloy key, but i got little for i am not familiar with directdraw, Overlay and colorkey.
Quote:Original post by DavidOL
Hi j-locke,

Thanks for your reply! My platform is XP and i have checked source codes of the VLC player. I found that it only create a overlay on the desktop, and then
do something with the coloy key, but i got little for i am not familiar with directdraw, Overlay and colorkey.
Yes, it sets the desktop to RGB(0, 0, 1), and then sets that as the colour key for rendering videos with DirectDraw / DirectShow.

What language are you using, and what do you have at the moment? If you have a video rendering in a window, it's fairly easy to get it rendering onto the desktop.
Hi Evil Steve,

Thanks for your reply! I am using C++. At first, i tried to implement it with Directshow(using VMR7 with windowless mode), but my application can play videos on desktop on some PCs successfully, but others failed. Here is some of my codes:

hr = AddFilterByCLSID(CLSID_VideoMixingRenderer, L"Video Mixing Renderer",

&m_pVMR);

if(FAILED(hr))

{

TearDownGraph();

return hr;

}

IVMRFilterConfig* pConfig;

hr = m_pVMR->QueryInterface(IID_IVMRFilterConfig, (void**)&pConfig);

if (SUCCEEDED(hr))

{

hr = pConfig->SetRenderingMode(VMRMode_Windowless);

pConfig->Release();

}

if (SUCCEEDED(hr))

{

hr = m_pVMR->QueryInterface(IID_IVMRWindowlessControl, (void**)&m_pVMRWindowlessCtr);

if (SUCCEEDED(hr)

{

HWND hDeskWnd = ::GetDesktopWindow();

hr = pVMRWndCtrl->SetVideoClippingWindow(hDeskWnd);

}

}

I also tried the following method to find the desktop window's handle:

hDeskWnd = FindWindow( _T("Progman"), NULL );
if( hDeskWnd ) hDeskWnd = FindWindowEx( hDeskWnd, NULL, _T("SHELLDLL_DefView"), NULL );
if( hDeskWnd ) hDeskWnd = FindWindowEx( hDeskWnd, NULL, _T("SysListView32"), NULL );

with this method my AP can play videos on desktop on every Pc, but the videos hide all icons on the desktop.


So now i want to implement it with DirectDraw, but i am not familiar with DirectDraw. Can you help me? Thanks very much!
Hi Evil Steve,

If using DirectDraw, can you show me what i should do? Can i do as following:
1. Create a primary surface, but i don't know how to play videos on it. Also do i need set color keys for the primary surface?
2. Create a overlay surface, but i don't know how to set the color keys for it. "it sets the desktop to RGB(0, 0, 1), and then sets that as the colour key for rendering videos with DirectDraw / DirectShow.", by this do you mean that in my program i need first get the current color key of the Desktop, then set the got color key on the overlay surface? I found that VLC can work with all color keys well.
3. Do i need create a off-screen overlay?

Thanks a lot!
Quote:Original post by DavidOL
Hi Evil Steve,

If using DirectDraw, can you show me what i should do? Can i do as following:
1. Create a primary surface, but i don't know how to play videos on it. Also do i need set color keys for the primary surface?
2. Create a overlay surface, but i don't know how to set the color keys for it. "it sets the desktop to RGB(0, 0, 1), and then sets that as the colour key for rendering videos with DirectDraw / DirectShow.", by this do you mean that in my program i need first get the current color key of the Desktop, then set the got color key on the overlay surface? I found that VLC can work with all color keys well.
3. Do i need create a off-screen overlay?

Thanks a lot!
You can download the VLC source code and see what it does - the relevant file is directx.c.

VLC creates an overlay surface, and uses a colour key of 1 (See DirectXFindColorkey()). It also disables the wallpaper and sets the colour key value to the desktop background colour (See SwitchWallpaperMode()).
It's been a long time since I did any DirectDraw stuff, but I don't think the overlay is offscreen (And I don't even think an overlay can be offscreen - that doesn't really make sense).
VLC creates a primary surface seperate from the overlay surface (Not sure if it's actually needed though).
Hi Evil Steve,

First thanks for your help!

Yes, i have already downloaded the VLC source code and checked the directx.c too. But there is some puzzles with me, all functions in directx.c file are static except DirectXEnumCallback, DirectXEnumCallback2 and SwitchWallpaperMode, so how functions in other files or modules to call these functions in directx.c? If i switch to the WallPaper mode, it need to call functions in directx.c, but the functions are static, how to do this? By the way, do you know which function is called when i select the WallPaper mode? Thanks!
Hi there,

It's too complex to do it with directdraw, so i decide back to the Directshow method. The above directshow codes work well on some PCs and can play videos on desktop, but on some other PCs, there are no videos on the desktop. Does anybody know how to solve this problem? Thanks very much!
one way to do that is to inject a dll in the explorer.exe process, and the subclass the desktop window.
i wrote a little toy a while back that used the desktop window to render some 3D stuff, look for 'FunDesktop' in the forums.

This topic is closed to new replies.

Advertisement