如何从HANDLE获得CWnd * [英] How to get CWnd* from HANDLE

查看:186
本文介绍了如何从HANDLE获得CWnd *的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ShellExecuteEx从MFC应用程序调用Excel应用程序。我有一个SHELLEXECUTEINFO结构的hProcess,它是一个HANDLE类型。在调用Excel之后,我将再显示一个应该是Excel的子对话框。要将Excel设置为父级,我需要使用Excel的CWnd *但是我有HANDLE的Excel处理。如何获得CWnd *?如果它已经解决了某个链接,我会。我已经尝试过EnumWindows,但不知道给LPARAM带来什么。

提前谢谢。

I am invoking Excel application from MFC application using ShellExecuteEx. I have hProcess of SHELLEXECUTEINFO struct which is a HANDLE type. After Invoking Excel, I am displaying one more dialog which should be child of Excel. For Setting Excel as parent I need CWnd* of Excel but I have HANDLE of Excel process. How to get CWnd* ? If it is already solved somehwhere a link will me. I have tried EnumWindows but don't know what to give for LPARAM.
Thanks in advance.

推荐答案

这不是得到 。与许多典型的MFC类一样,这个类只是一个围绕通过其 HWND 引用的窗口对象的C ++包装器。



这里: https://msdn.microsoft.com/en-us/library/22x4kb1k.aspx [ ^ ]。



请养成一个习惯,自己在文档中查找所有内容。这个论坛更多的是真正的问题,很难或者甚至很简单,但是真的。



-SA
It's not "to get". This class, as many typical MFC classes, is a mere C++ wrapper around a window object referenced via its HWND.

Here: https://msdn.microsoft.com/en-us/library/22x4kb1k.aspx[^].

Please, get a habit to find everything in documentation by yourself. This forum is more for real problems, hard or maybe even very simple, but real.

—SA

这篇关于如何从HANDLE获得CWnd *的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆