05/08/09 13:27
fusebyte
Tentar non nuoce.
A questo punto conviene fare una DLL in NET e poi richiamare esternamente (con quale comando?) l'exe desiderato in quel momento.
Come dovrebbe essere modificato il tuo codice per fare questo?
Ciao
A questo punto conviene fare una DLL in NET e poi richiamare esternamente (con quale comando?) l'exe desiderato in quel momento.
Imports System.Runtime.InteropServices Public Class Form1 <DllImport("user32.dll")> _ Public Shared Function FindWindow(ByVal ZeroOnly As IntPtr, ByVal lpWindowName As String) As IntPtr End Function <DllImport("user32.dll")> _ Public Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr End Function Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim p As New Process p.StartInfo.FileName = "notepad.exe" p.Start() 'per far partire il processo Threading.Thread.Sleep(2000) 'attendo che il processo si apra Dim winh As New IntPtr winh = FindWindow(winh, "Senza nome - Blocco note") 'Ottengo l'handle con FindWindow SetParent(winh, Me.Handle) 'Setto il Form padre Con SetParent End Sub End Class
Come dovrebbe essere modificato il tuo codice per fare questo?
Ciao
aaa