Imports System.Diagnostics
Imports System.Runtime.InteropServices
Public Class Form1
Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
<DllImport("user32.dll")> Public Shared Function SetParent(ByVal hwndChild As IntPtr, ByVal hwndNewParent As IntPtr) As Integer
End Function
Public Function wait(x As Integer)
System.Threading.Thread.Sleep(x)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Process1 As New Process
Process1.StartInfo.FileName = "C:\Runique.jar"
Process1.Start()
For x = 1 To 20
wait(100)
SetParent(Process1.MainWindowHandle, PictureBox1.Handle)
Next
End Sub
当我运行这个时,我的process1正在图片框的右下角创建 如何使其适合我的图片框?我该如何让它变得不可移动?