在Directshow中,我们可以对render指定显示窗口,在写程序的过程中, 发现通过put_Owner设置的显示窗口存在自动刷新问题,譬如窗口被遮挡然后再次露出时,被遮挡部分不能自动刷新,需要拖动窗口进行刷新。

网上搜索了一下,找到了解决问题的办法:

http://blog.csdn.net/lemon_wei/archive/2008/02/29/2132195.aspx

具体处理方法:

假设图象窗口的picture控件id为IDC_FRAME_VIEW, 
    pViewWindon 为 IVideoWindow*接口,作四步处理

1、修改显示控件属性 
      CWnd* pWnd = GetDlgItem(IDC_FRAME_VIEW); 
      pWnd->ModifyStyle(0,   WS_CLIPCHILDREN);

2、设置为子窗口的句柄 
      CWnd* pWnd = GetDlgItem(IDC_FRAME_VIEW);
      put_Owner((OAHWND)pWnd->GetSafeHwnd( ))

3、OnPaint   不用动

4、OnEraseBkgnd   加如下代码 
      
      RECT   rect; 
      CWnd* pWnd = GetDlgItem(IDC_FRAME_VIEW); 
      pWnd->GetWindowRect(&rect); 
      ScreenToClient(&rect); 
      pDC-> ExcludeClipRect(&rect); 
      return   CDialog::OnEraseBkgnd(pDC);

其中的 ModifyStyle 中第二个参数dwstyle

  1. WS_BORDER
  2. Creates a window that has a thin-line border.
  3. WS_CAPTION
  4. Creates a window that has a title bar (includes the WS_BORDER style).
  5. WS_CHILD
  6. Creates a child window. A window with this style cannot have a menu bar. This style cannot be used with the WS_POPUP style.
  7. WS_CHILDWINDOW
  8. Same as the WS_CHILD style.
  9. WS_CLIPCHILDREN
  10. Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window.
  11. WS_CLIPSIBLINGS
  12. Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window.
  13. WS_DISABLED
  14. Creates a window that is initially disabled. A disabled window cannot receive input from the user. To change this after a window has been created, use EnableWindow.
  15. WS_DLGFRAME
  16. Creates a window that has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar.
  17. WS_GROUP
  18. Specifies the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.
  19. You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use SetWindowLong.
  20. WS_HSCROLL
  21. Creates a window that has a horizontal scroll bar.
  22. WS_ICONIC
  23. Creates a window that is initially minimized. Same as the WS_MINIMIZE style.
  24. WS_MAXIMIZE
  25. Creates a window that is initially maximized.
  26. WS_MAXIMIZEBOX
  27. Creates a window that has a maximize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
  28. WS_MINIMIZE
  29. Creates a window that is initially minimized. Same as the WS_ICONIC style.
  30. WS_MINIMIZEBOX
  31. Creates a window that has a minimize button. Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.
  32. WS_OVERLAPPED
  33. Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style.
  34. WS_OVERLAPPEDWINDOW
  35. Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style.
  36. WS_POPUP
  37. Creates a pop-up window. This style cannot be used with the WS_CHILD style.
  38. WS_POPUPWINDOW
  39. Creates a pop-up window with WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.
  40. WS_SIZEBOX
  41. Creates a window that has a sizing border. Same as the WS_THICKFRAME style.
  42. WS_SYSMENU
  43. Creates a window that has a window menu on its title bar. The WS_CAPTION style must also be specified.
  44. WS_TABSTOP
  45. Specifies a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.
  46. You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use SetWindowLong.
  47. WS_THICKFRAME
  48. Creates a window that has a sizing border. Same as the WS_SIZEBOX style.
  49. WS_TILED
  50. Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.
  51. WS_TILEDWINDOW
  52. Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_OVERLAPPEDWINDOW style.
  53. WS_VISIBLE
  54. Creates a window that is initially visible.
  55. This style can be turned on and off by using ShowWindow or SetWindowPos.
  56. WS_VSCROLL
  57. Creates a window that has a vertical scroll bar.

Directshow 通过 put_Owner 指定显示窗口后,自动刷新问题的更多相关文章

  1. ASPX 关闭子窗口后自动更新父窗口

    Response.Write("<script language:javascript>javascript:window.close();</script>&quo ...

  2. 黄聪:PHP如何实现延迟一定时间后自动刷新当前页面、自动跳转header("refresh:1;url={$url}");

    //1秒后自动跳转 header("refresh:1;url={$url}"); exit; //1秒后自动刷新当前页面header("refresh:1;" ...

  3. Javascript实现页面加载完成后自动刷新一遍清除缓存文件

    我们有些时候在加载页面时,会出现缓存文件对当前文件的表现效果有干扰,如有些缓存的样式文件会是页面效果发生改变,这时我们希望页面在加载时能自动刷新一遍清楚缓存文件. 但是由于跳转页面肯定会用到BOM部分 ...

  4. BrowserSync 热更新的使用(保存后自动刷新)

    BrowserSync使用的优点,BrowserSync监听条件中的文件,发现更新会立刻刷新浏览器,就像 vue中的热更新一样,解放F5实现自动更新,提高开发效率, 解决了使用双屏幕时来回切换的烦恼! ...

  5. 问题解决——ShowWindow不显示窗口

    配合任务栏通知区域. //MFC对话框程序 void CXXXDlg::OnShowHideUi() { // TODO: 在此添加命令处理程序代码 m_bShown=!m_bShown; ShowW ...

  6. gulp之压缩合并MD5清空替换加前缀以及自动编译自动刷新浏览器大全

    gulp是基于流的前端构件化工具.目前比较火的前端构建化工具还是挺多的,grunt gulp fis3等等. 这个鬼东西有什么用?请参考https://www.zhihu.com/question/3 ...

  7. JAVA-JSP内置对象之response对象实现页面自动刷新

    相关资料:<21天学通Java Web开发> response对象 实现页面自动刷新1.可以通过response对象的addIntHeader()方法添加一个标题为Refrsh的标头,并指 ...

  8. JSP中自动刷新

    以下内容引用自http://wiki.jikexueyuan.com/project/jsp/auto-refresh.html: 细想一个显示在线比赛分数.股市状态或当前交易额的网页.对于所有这种类 ...

  9. nodejs里的express自动刷新高级篇【转载】

    搬运自[简书:http://www.jianshu.com/p/2f923c8782c8]亲测可用哦! 最近在使用express框架及mongodb,由于前端和后端代码修改后都需要实现自动刷新功能,刚 ...

随机推荐

  1. 使用Project进行挣值分析

        挣值分析(EV)技术是一种根据项目的成本基准来度量和分析项目绩效的方法.挣值分析的结果可以指出项目在成本和进度方面存在的偏差.EV分析结合了成本,进度,已完成工作等各种因素来衡量项目的绩效,并 ...

  2. 将默认首页设置成index.do的方法

    变态欺骗法,今天csdn一个前辈的,学习了,公司服务器是weblogic的,也可以欺骗. 但是我又非常迫切.非常盼望.非常渴望使用index.do做首页,怎么办? Tomcat中用一段注释: When ...

  3. 转:php+mysql菜单无限级分类(非递归)

    php+mysql无限级分类(非递归) 参考:http://www.chhua.com/web-note3244

  4. <Win32_16>来看看标准菜单和右键菜单的玩法

    日常应用中,菜单主要分为两种:(1) 标准菜单(处于应用程序菜单栏处的菜单)    (2)右键快捷菜单 几乎你所见过或使用过的软件中,都有它俩儿 为应用程序添加它们的基本步骤: (1)用代码或者IDE ...

  5. ThinkPHP 3.1.2 模板中的基本语法<1>

    # # ThinkPHP 3.1.2 模板中的基本语法 一.传统的方式,导入CSS和JS文件 1.css link js scr <link rel='stylesheet' type='tex ...

  6. cocos2dx中的其他层

    在cocos2dx中,CCLayer默认是黑色的,但是有时候需要有其他颜色北京的图层,那么就需要用到CCLayerColor 如下代码: ccColor4B color =ccc4(255, 0, 0 ...

  7. 十一、观察者模式(Observable、Observer)

    老板出差了,员工1.员工2..均放羊中.他们请求前台的秘书,当老板回来时通知自己,免得被Boss抓个现行.秘书想了想,说————嗯,这是观察者模式. 当一个对象的改变需要同时改变其它对象,而且它不知道 ...

  8. 基于RYU控制器(controller)上的simple-switch 的APP做的測试-SDN/OpenFlow

    近期一直在学习RYU控制器,在使用的过程中,发现有下面几方面的长处:RYU控制器全然使用Python语言编写,在理解起来和上手速度上是挺快的:RYU控制器的总体架构清晰明了,在日后有时间我会整理一个关 ...

  9. Java之SPI机制

    之前开阿里的HSF框架,里面用到了Java的SPI机制,今天闲暇的时候去了解了一下,通过写博客来记录一下 SPI的全名为Service Provider Interface,我对于该机制的理解是为接口 ...

  10. Java 取得当前日期之后N天的日期 zz

    链接地址:http://blog.sina.com.cn/s/blog_483486840100vrjn.html public static String afterNDay(int n){    ...