【发布时间】:2018-10-30 15:55:10
【问题描述】:
所以我有一个我正在使用的方法,我可以将 powerpoint 集成到一个面板中。我使用 FindWindow 和 SetParent 函数来实现这一点:
Dim proc as integer
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As Long) As Long
Private Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As Integer
Public Sub embed_Window()
Do Until proc <> 0
proc = FindWindow(vbNullString, window_name)
Loop
SetParent(proc, Panel1.Handle)
End Sub
这部分可以很好地将另一个窗口嵌入到我的面板控件中。我的问题是,如何关闭面板中的窗口?我不能再使用 FindWindow 方法,因为它不再是任务栏中的窗口。
【问题讨论】:
-
proc和process应该是同一个变量吗?它们是如何声明的? -
@OlivierJacot-Descombes 是的,它们是一样的。对不起,一个错字,但我已经编辑了我的问题