解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/5514/5514291.xml?temp=.6041986
      

  2.   

    看了,下载源码后编译出错
    Compiling...
    flash.cpp
    D:\vc\flash\flash\flash.cpp(67) : error C2065: 'WS_EX_LAYERED' : undeclared identifier
    FlashWnd.cpp
    d:\vc\flash\flash\flashwnd.h(283) : error C2065: 'WS_EX_LAYERED' : undeclared identifier
            c:\program files\microsoft visual studio\vc98\include\comip.h(660) : while compiling class-template member function 'int __thiscall COleContainerWnd<struct ShockwaveFlashObjects::IShockwaveFlash>::Create(struct _GUID,unsigned long,unsigned l
    ong,struct HWND__ *,struct HINSTANCE__ *)'
    d:\vc\flash\flash\flashwnd.h(681) : error C2065: 'AC_SRC_ALPHA' : undeclared identifier
            c:\program files\microsoft visual studio\vc98\include\comip.h(660) : while compiling class-template member function 'void __thiscall COleContainerWnd<struct ShockwaveFlashObjects::IShockwaveFlash>::Draw(struct HDC__ *,const struct tagRECT *,
    int)'
    d:\vc\flash\flash\flashwnd.h(684) : error C2065: 'UpdateLayeredWindow' : undeclared identifier
            c:\program files\microsoft visual studio\vc98\include\comip.h(660) : while compiling class-template member function 'void __thiscall COleContainerWnd<struct ShockwaveFlashObjects::IShockwaveFlash>::Draw(struct HDC__ *,const struct tagRECT *,
    int)'
    d:\vc\flash\flash\flashwnd.h(684) : error C2065: 'ULW_ALPHA' : undeclared identifier
            c:\program files\microsoft visual studio\vc98\include\comip.h(660) : while compiling class-template member function 'void __thiscall COleContainerWnd<struct ShockwaveFlashObjects::IShockwaveFlash>::Draw(struct HDC__ *,const struct tagRECT *,
    int)'
    d:\vc\flash\flash\flashwnd.h(684) : error C2065: 'ULW_OPAQUE' : undeclared identifier
            c:\program files\microsoft visual studio\vc98\include\comip.h(660) : while compiling class-template member function 'void __thiscall COleContainerWnd<struct ShockwaveFlashObjects::IShockwaveFlash>::Draw(struct HDC__ *,const struct tagRECT *,
    int)'
    Generating Code...
    Error executing cl.exe.flash.exe - 6 error(s), 0 warning(s)
      

  3.   

    在VC++中,不是网页中.如果窗口是背景的,加上FLASH控件后,我想能将透明显示Flash,即Flash的空白部份能显示窗口的背景,我试了不行
      

  4.   

    你这份代码我刚编译过, 原因是你没有安装Platform SDK, 你需要安装的是支持VC6的最后一个版本的SDK Platform SDK 2003 Feb, 同时, 如果你编译的这个例子和我的一样, 那他里面的ddraw.h 需要安装DirectX 的SDK, 或者直接引用.net 2003的.
    如果还没搞定, 我发工程给你,
      

  5.   

    如果把窗口弄成透明的,透明的FLASH会不会是黑色呢,看看吧
      

  6.   

    to:constname(constname) 
    最近在搞这个,麻烦发一份给我,谢谢
    [email protected]
      

  7.   

    to:constname(constname) 
    我也在研究这个,能不能也发一份给我,谢谢
    [email protected]
      

  8.   

    我研究了很久这个东西, 最后发现, 如果要实现, 那必须是在创建子窗口之前就设置WMODE, 但是那不能直接用MFC的封装类来Create, 要实现一堆接口, 太麻烦了. 后来我突然想到了一点, 那就是用ACTIVEX CONTROL TEST CONTAINER调用FLASH然后设置WMODE到TRANSPARENT, 然后保存状态到一个文件, 类似.stg这样的文件. 在CShockwaveFlash的CREATE方法里有个参数是传递一个CFILE的指针, 读这个.stg传给它就OK了...哈哈~~~比较懒的方法, 但是很管用~!希望这个对你有点帮助~~
      

  9.   

    VC6不行,VC7可以但效果不好;VB中可以;
    原因可能是ShockWaveFlash控件的宿主host窗口不是透明的;
    CodeProject有个洋牛,写了个东东可以,但很费资源,具体地址忘记了。
      

  10.   

    透明FLASH很费资源的, 在IE里面也是一样费资源, 只是IE里面的透明FLASH通常都很小而已.我给段代码给你好了, 上面我说过的我就不再重复了.在View的OnCreate或者Dialog的InitDialog里面写:
    [code]
    CString strFlashPropPath=_tgetenv(_T("tmp"));
    strFlashPropPath+="\\transflash.prop";
    CFile g_fpFlash(strFlashPropPath,CFile::modeCreate|CFile::modeReadWrite);
    HRSRC res1=FindResource(NULL,MAKEINTRESOURCE(FLASHPROP),"BIN");
    HGLOBAL hg1=LoadResource(NULL,res1);
    LPVOID lpv1=LockResource(hg1);
    g_fpFlash.Write(lpv1,SizeofResource(NULL,res1));
    g_fpFlash.Close(); CFile fp(strFlashPropPath,CFile::modeRead);
    m_flash.Create(NULL,NULL,CRect(0,0,640,640),this,1000,&fp,TRUE);
    fp.Close();
    m_flash.put_Movie("e:\\ui.swf"); // 这里随便写个地址加载
    m_flash.Play();
    [/code]
    其中FLASHPROP是一个ACTIVEX CONTROL TEST CONTAINER保存的透明FLASH的状态文件IMPORT到资源里的ID.在OnPaint里面:
    [code]
    RECT rt;
    GetClientRect(&rt);
    CDC memdc;
             CBitmap bmp;
    memdc.CreateCompatibleDC(GetDC());
    bmp.CreateCompatibleBitmap(GetDC(),rt.right,rt.bottom);
    memdc.SelectObject(&bmp);
    PaintWindowlessControls(&memdc);
    dc.BitBlt(0,0,rt.right,rt.bottom,&memdc,0,0,SRCCOPY);
    [/code]这样就OK了.注: 这个需要在VC7上才有效, VC6不支持IOleInplaceObjectWindowless接口.
      

  11.   

    OnPaint里面开始还要有个 CPaintDC dc(this);
    笔误.
      

  12.   

    呵呵  这个很简单的 我现在在做,就是把flash插入到一个Dlg里面让Dlg设置成透明就好了~:)
      

  13.   

    另外, 如果你想要窗口象FLASH那样透明, 用UpdateLayeredWindow, 该函数具体使用方法参考MSDN.
      

  14.   

    高手也给我发一份阿,
    [email protected]