Hi guys,

This is the sample code that I used to run another application inside a picturebox:
Code:
Imports System.Diagnostics
Imports System.Runtime.InteropServices
Public Class Form1
    <DllImport("user32.dll")> Public Shared Function SetParent(ByVal hwndChild As IntPtr, ByVal hwndNewParent As IntPtr) As Integer
    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 = "notepad.exe"
        Process1.Start()

        Do Until Process1.WaitForInputIdle = True
            Application.DoEvents()
        Loop
        SetParent(Process1.MainWindowHandle, PictureBox1.Handle)

    End Sub
End Class
Thus, I was able to host another application inside my VB2010 WindowsForm and it works fine. But the problem is, in Windows7, Windows would ask for the permission(whether you want to allow the EXE to run or not). After clicking the "Allow" button, the exe application would open on it's own window rather than as a child of the PictureBox

I think when Windows asks for the permission, it is skipping the SetParent() API call. I really appreciate any suggestions or corrections or recommendations.

Thanks in advance