如何从HANDLE获得CWnd * [英] How to get CWnd* from HANDLE
问题描述
我正在使用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 itsHWND
.
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屋!