16,721
社区成员




Public Class Form1
Public aa As New Process
Public RunfilenName As String = "D:\1.exe"
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hwnd As IntPtr
aa.StartInfo.FileName = RunfilenName
aa.Start()
hwnd = aa.Id
'Dim i As Int16 = 0
'Do While 0 = hwnd And i < 500
' System.Threading.Thread.Sleep(10)
' hwnd = aa.Id
' i += 1
'Loop
Me.Text = hwnd.ToString
MsgBox(hwnd.ToString)
'能取出值的。是你上面的代碼有問題。都不知道你上面的代碼用來做什麽。
End Sub
End Class