[Help] Embed exe to vb.net project 01-17-2014, 02:06 AM
#1
Hi
How are you?
are i can embed OpenVPN.exe to my project
How are you?
are i can embed OpenVPN.exe to my project
[Help] Embed exe to vb.net project filter_list | |
Imports System.Diagnostics
Imports System.Text
Imports System.Runtime.InteropServices
Private Declare Function SetParent Lib "user32" (ByVal hwndChild As IntPtr, ByVal hwndNewParent As IntPtr) As Integer
Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer
Private Sub run_notepad()
Dim notepad As New Process
notepad.StartInfo.FileName = "notepad.exe"
notepad.Start()
Do Until notepad.WaitForInputIdle = True
Application.DoEvents()
Loop
embed("notepad")
End Sub
Private Sub embed(byval processname as string)
For Each p As Process In Process.GetProcesses()
If (p.ProcessName.Contains(processname)) Then
Dim handle As IntPtr = p.MainWindowHandle
SetParent(handle, PictureBox1.Handle)
ShowWindow(handle, 3) ' maximize the exe to dock it. (and remove borders)
End If
Next
End Sub
Imports System.Diagnostics
Imports System.Text
Imports System.Runtime.InteropServices
Private Declare Function SetParent Lib "user32" (ByVal hwndChild As IntPtr, ByVal hwndNewParent As IntPtr) As Integer
Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer
Private Sub run_notepad()
Dim notepad As New Process
notepad.StartInfo.FileName = "notepad.exe"
notepad.Start()
Do Until notepad.WaitForInputIdle = True
Application.DoEvents()
Loop
embed("notepad")
End Sub
Private Sub embed(byval processname as string)
For Each p As Process In Process.GetProcesses()
If (p.ProcessName.Contains(processname)) Then
Dim handle As IntPtr = p.MainWindowHandle
SetParent(handle, PictureBox1.Handle)
ShowWindow(handle, 3) ' maximize the exe to dock it. (and remove borders)
End If
Next
End Sub