You can of course patch together the FileName and the Extension and hope for the best. Hope it helps to someone who is fighting with the same issue. The above steps are for VB2010(not sure whether it would be same for other versions also). Even when you run it from IDE, it will ask for re-opening the IDE with the Admin privilege.īTW, I assumed that you would be using VB2010. This will ask the Admin permission whenever you run the application. In this, change the following line(uncommented line): Then from the Application tab, click on the View Windows Settings button. To change this, goto the project properties(Project menu -> Properties). You could view the details here: thread at Īnd for elevating the permission, that is to ask for the Admin permission when the application starts, we need to change the requestedExecutionLevel value. EdgeMeal from had helped me in finding a workaround to this issue. Sorry for the delay in posting the solution. I think when Windows asks for the permission, it is skipping the SetParent() API call. After clicking the "Allow" button, the exe application would open on it's own window rather than as a child of the PictureBox But the problem is, in Windows7, Windows would ask for the permission(whether you want to allow the EXE to run or not). Thus, I was able to host another application inside my VB2010 WindowsForm and it works fine. SetParent(Process1.MainWindowHandle, PictureBox1.Handle)
= "notepad.exe"ĭo Until Process1.WaitForInputIdle = True Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Public Shared Function SetParent(ByVal hwndChild As IntPtr, ByVal hwndNewParent As IntPtr) As Integer This is the sample code that I used to run another application inside a picturebox: Imports System.Diagnostics