I created a small app the other day, it has a transparent window, but when i moved it over window media player i couldn't see the video playin, can someone tell me why, also has anyone done somethin like this, coz i saw a video about windows vista where the video is visible behind the title bar of the windows and have been wondering ever since that, if its possible to do it in xp also...

any ideas on how to do it?
Posted on 2005-10-16 06:10:11 by lone_samurai5
The movie should be rendered with RGB overlay or VMR-9. You can't mix RGB with  YUV Overlay-1/2, iirc. VMR-9 is present in DX9.
Posted on 2005-10-16 08:40:01 by Ultrano
lone_samurai5,
Hi~  This applicant has a tranparent window. The code is as followed.

.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
include \masm32\include\gdi32.inc
includelib \masm32\lib\gdi32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

WinMain proto :DWORD,:DWORD,:DWORD,:DWORD

.data
ClassName db ".:|| aSxDoX ||:.",0
AppName db ".:|| aSxDoX ||:.",0

.data?
hInstance HINSTANCE ?
CommandLine LPSTR ?
.code
start:
invoke GetModuleHandle, NULL
mov    hInstance,eax
invoke WinMain, hInstance,NULL,NULL, SW_SHOWDEFAULT
invoke ExitProcess,eax

WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD
LOCAL wc:WNDCLASSEX
LOCAL msg:MSG
LOCAL hwnd:HWND
mov   wc.cbSize,SIZEOF WNDCLASSEX
mov   wc.style, 2003h
mov   wc.lpfnWndProc, OFFSET WndProc
mov   wc.cbClsExtra,NULL
mov   wc.cbWndExtra,NULL
push  hInstance
pop   wc.hInstance
invoke LoadBitmap,hInst,10
invoke CreatePatternBrush,eax
mov   wc.hbrBackground,eax
mov   wc.lpszMenuName,NULL
mov   wc.lpszClassName,offset ClassName
invoke LoadIcon,hInst,11
mov   wc.hIcon,eax
mov   wc.hIconSm,0
invoke LoadCursor,NULL,IDI_APPLICATION
mov   wc.hCursor,eax
invoke RegisterClassEx, addr wc
INVOKE CreateWindowEx,80000h,ADDR ClassName,ADDR AppName,\
           80000000h,80000000h,\
           80000000h,0c4h,0bdh,NULL,NULL,\
           hInst,NULL
mov   hwnd,eax
invoke ShowWindow,hwnd,1
invoke SetLayeredWindowAttributes,hwnd,820282h,NULL,1 

.WHILE TRUE
invoke GetMessage, ADDR msg,NULL,0,0
.BREAK .IF (!eax)
invoke TranslateMessage, ADDR msg
invoke DispatchMessage, ADDR msg
.ENDW
mov     eax,msg.wParam
ret
WinMain endp

WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
.if uMsg == WM_CREATE
Invoke SetTimer,hWnd,1,64h,0
ret
.endif

.if uMsg == WM_LBUTTONDOWN
Invoke SendMessage,hWnd,WM_NCLBUTTONDOWN,HTCAPTION,lParam
.endif

.if uMsg == WM_TIMER
Invoke GetAsyncKeyState,23h
      .if eax != 0
        Invoke ExitProcess,0
      .endif
.endif

invoke DefWindowProc,hWnd,uMsg,wParam,lParam
ret
WndProc endp

end start


I hope this will help you to solve your problem.
Posted on 2005-10-30 03:51:03 by rocky.cez