Introduction This simple C# WinForms project allows you to playback video from a live capture device or from an existing video file and blend the video using transparency with the existing Windows desktop. The user can still interact with all other application windows "through" the playing video stream.http://www.codeproject.com/KB/audio-video/TransparentDesktopVideo.aspx
This simple C# WinForms project allows you to playback video from a live capture device or from an existing video file and blend the video using transparency with the existing Windows desktop. The user can still interact with all other application windows "through" the playing video stream.http://www.codeproject.com/KB/audio-video/TransparentDesktopVideo.aspx
MCI_ANIM_OPEN_PARMS mciopen;
MCI_ANIM_WINDOW_PARMS mciWindow;
memset((LPSTR)&mciopen,0,sizeof(mciopen));
memset((LPSTR)&mciWindow,0,sizeof(mciWindow));
mciopen.lpstrDeviceType="MPEGVideo";
mciopen.lpstrElementName="c:\\na.mpg";
mciSendCommand(0,MCI_OPEN,MCI_OPEN_TYPE|MCI_OPEN_ELEMENT,(DWORD)(LPVOID)&mciopen);
mciWindow.hWnd=GetDesktopWindow();//如果桌面是web的话要得到IE的句柄
mciSendCommand(mciopen.wDeviceID;
,MCI_WINDOW,MCI_ANIM_WINDOW_HWND,(DWORD)(LPVOID)&mciWindow);
mciSendCommand(mciopen.wDeviceID;
,MCI_PLAY,NULL,NULL);这样可以简单的实现桌面播放,但是它截获了鼠标键盘消息.分两种情况!
1:桌面开启了web方式查看的话,想办法得到桌面的IE句柄。
2:如果没有开启,则要得到sysListview32的句柄。
直接GetDC, 输出视频到HDC 就好了
1。视频播放完再次播放时转换不连续
2。如果硬件加速被关闭或被其他程序占用,会失败to zzz3265:
直接GetDC方式不对,
我目前有些思路,正在修改,再次感谢大家,也等大家的其他想法