让一个应用程序在指定的窗体中运行 20
比如我现在有一个form1的窗体上面有一个按钮,用shell(“应用程序的路径”)(请已QQ或游戏为列)但点这个按钮后QQ就会出现在这个form1窗体中当有对话框时,对话...
比如我现在有一个form1的窗体上面有一个按钮,用shell(“应用程序的路径”)(请已QQ或游戏为列)但点这个按钮后QQ就会出现在这个form1窗体中当有对话框时,对话框也会在这个窗体中显示。请给源码!!!!!!!!
展开
展开全部
以计算器程序为例,建Command1。代码如下 。
=====================
Option Explicit
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Shell "calc"
SetParent FindWindow("SciCalc", vbNullString), hWnd
End Sub
=====================
Option Explicit
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
Shell "calc"
SetParent FindWindow("SciCalc", vbNullString), hWnd
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询