zoukankan      html  css  js  c++  java
  • 【VS开发】MFC修改Opencv namedWindow的风格

    当在MFC中应用opencv的窗口来显示图片。希望namedWindow创建的窗口能根据需要改变风格:

     

    //by dongchunxiao


    cv::namedWindow("windows1",0); //创建一个窗口 
    HWND hWnd = (HWND)cvGetWindowHandle("windows1");//获取子窗口的HWND
    HWND hParentWnd = ::GetParent(hWnd);//获取父窗口HWND。父窗口是我们要用的

    ::SetWindowPos(hParentWnd,HWND_TOPMOST,100,1,500,500,SWP_NOSIZE | SWP_NOMOVE); //修改窗口为最顶部

    //隐藏窗口标题栏 
    long style = GetWindowLong(hParentWnd,GWL_STYLE); 
    style &= ~(WS_CAPTION); 
    // style &= ~(WS_MAXIMIZEBOX); 
    SetWindowLong(hParentWnd,GWL_STYLE,style);

    //改变窗口的位置和大小。这里主要前面的SetWindowPos不能改变位置和大小(为什么?)
    ::MoveWindow(hParentWnd,10,100,500,500,0);

  • 相关阅读:
    less 28-31
    less27 27a
    sqli 26 26a
    sqli lab 25 25a
    kail 更新源
    sqli lab 23 、24
    less 20 21 22
    less18 19
    less 17
    数字类型,字符串类型,列表类型
  • 原文地址:https://www.cnblogs.com/huty/p/8517227.html
Copyright © 2011-2022 走看看