1、http://bbs.csdn.net/topics/390672855

该帖子中 第15楼:

MSDN里面说了:
if hWndNewParent is not NULL and the window was previously a child of the desktop, you should clear the WS_POPUP style and set the WS_CHILD style before calling SetParent.

就是如果你原来是主窗体要修改style为WS_CHILD的

ZC: 查了下MSDN,并尝试了一下,确实需要将 子窗口的 风格WS_POPUP去掉,并 加上WS_CHILD 。

2、

SetWindowLong (https://msdn.microsoft.com/en-us/library/windows/desktop/ms633591(v=vs.85).aspx

ZC: 参考代码:

    QWebView *pWV = new QWebView();
pWV->show();
pWV->load(QUrl::fromUserInput("www.163.com")); HWND hWndChild = (HWND)pWV->winId();
LONG lStyle = GetWindowLong(hWndChild, GWL_STYLE);
lStyle = lStyle & (~WS_POPUP) | WS_CHILD;
SetWindowLong(hWndChild, GWL_STYLE, lStyle); HWND hWndNewParent = (HWND);
SetParent(hWndChild, hWndNewParent);

Z

SetParent的更多相关文章

  1. crm 2011 plugin setparent setbusiness 用户更改经理 更改办事处

    背景: 在更改经理或者更改办事处时,使用plugin处理相应的团队. 问题:plugin写完,注册时发现使用update注册没有效果,然后bing得到,这里要使用setbusiness 和 setpa ...

  2. Qt中widget重新setParent需要注意的问题

    有时候需要在widget中重新setParent,但会发现setParent有时候会出现问题,比如子窗口不在刷出来等等. 其实,有一点是需要注意的,就是Qt文档里说的,如果你当前widget重新设置了 ...

  3. MFC子窗口和父窗口(SetParent,SetOwner)

    一.概念和区别 在windows系统中,每个窗口对象都对应有一个数据结构,形成一个list链表.系统的窗口管理器通过这个list来获取窗口信息和管理每个窗口.这个数据结构中有四个数据用来构建list, ...

  4. ugui SetParent在安卓上一个诡异bug

    问题描述 我的环境:Unity3D 5.3.7 出问题机型:安卓模拟器.部分低配安卓机型(比如:红米2A) 以下代码是设置某个节点的父节点,在PC.Editor.大部分手机上都是正常的,但问题机型上, ...

  5. foreach Transform 同时chils.setParent引起的bug

    Transform继承自IEnumerable,可以对它进行迭代.但当你在迭代的同时,又对child进行setParent操作时,会出现意想不到的结果. 下面是我使用foreach和getchild得 ...

  6. c# 设置桌面背景窗口 SetParent

    using System; using System.Drawing; using System.Runtime.InteropServices; using System.Windows.Forms ...

  7. Delphi SetParent 嵌入其他应用程序

    [代码]Delphi实现窗体内嵌其他应用程序窗体 实现原理是启动一个应用程序,通过ProcessID得到窗体句柄,然后对其设定父窗体句柄为本程序某控件句柄(本例是窗体内一个Panel的句柄),这样就达 ...

  8. C# SetParent将其他程序嵌入自己的程序

    模块化的开发,将模块合并到一起的时候,遇到了Mdi不能添加到其它窗口下的问题. 分两种情况: 将mdi窗口A设成普通窗口B的子控件,需要将A的TopLevel设置成false,但是Mdi窗口的TopL ...

  9. C#窗体嵌入SetParent的用法

    模块化的开发,将模块合并到一起的时候,遇到了Mdi不能添加到其它窗口下的问题. 分两种情况: 将mdi窗口A设成普通窗口B的子控件,需要将A的TopLevel设置成false,但是Mdi窗口的TopL ...

随机推荐

  1. Summary: Deep Copy vs. Shallow Copy vs. Lazy Copy

    Object copy An object copy is an action in computing where a data object has its attributes copied t ...

  2. 003-ubuntu上安装mysql

    安装如下: 1.安装服务端:# sudo apt-get  install mysql-server. 2.安装客户端:# sudo apt-get -y install mysql-server. ...

  3. 174. Dungeon Game(动态规划)

    The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. ...

  4. uva11383 转化为 二分图匹配

    给定一个n*n矩阵,每个格子里都有一个正整数w(i,j).你的任务是给每行确定一个整数row(i),没列也确定一个正整数col(i),使得对于任意格子(i,j),w(i,j) <= row(i) ...

  5. MySQL从删库到跑路(六)——SQL插入、更新、删除操作

    作者:天山老妖S 链接:http://blog.51cto.com/9291927 一.插入数据 1.为表的所有字段插入数据 使用基本的INSERT语句插入数据要求指定表名称和插入到新记录的值. IN ...

  6. Hive 体系结构介绍

    下面是Hive的架构图. 图1.1 Hive体系结构 Hive的体系结构可以分为以下几部分: (1)用户接口主要有三个:CLI,Client 和 WUI.其中最常用的是CLI,Cli启动的时候,会同时 ...

  7. Linux服务器配置---tftpserver

    安装tftp-server 1.安装tftp-server [root@localhost weijie]# yum install -y tftp-server Loaded plugins: fa ...

  8. 第一次使用crontab linux选择编辑器问题

    第一次使用crontab linux选择编辑器问题 第一次使用crontab 时,会出现no crontab for root - using an empty one“Select a editor ...

  9. Confluence5.8部分空间名称显示为问号的解决方案

    Confluence5.8部分空间名称显示为问号的解决方案 原因: 连接MySQL的时候,有没有在连接串中指定&useUnicode=true&characterEncoding=ut ...

  10. ELK之kibana6.5

    ELK之安装kibana6.5,这里采用rpm安装: https://www.elastic.co/guide/en/kibana/current/rpm.html # wget https://ar ...