Hallöchen liebe Community,
ich hab da ein kleines Problem.
Ich binde mithilfe folgendes Codes ein Programm in meine Form ein.
Das funktioniert auch soweit wunderbar.
Nun möchte ich allerdings dass der Border der Software verschwindet. Momentan kann ich das Programm nämlich in meiner Tabpage einfach schließen.
hat da jemand ne Idee?
ich hab da ein kleines Problem.
Ich binde mithilfe folgendes Codes ein Programm in meine Form ein.
VB.NET-Quellcode
- Imports System.Runtime.InteropServices
- Imports System.Threading
- <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)>
- Public Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
- End Function
- <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)>
- Private Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
- End Function
- <DllImport("user32.dll", SetLastError:=True)>
- Private Shared Function IsWindowVisible(ByVal hWnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
- End Function
- Private Const WM_SYSCOMMAND As Integer = 274
- Private Const SC_MAXIMIZE As Integer = 61488
- Private Sub SsC(ByVal Connection As ShellConnection)
- Dim tp As New TabPage
- tp.Text = Connection.Name
- tp.Name = Connection.Hash
- TabControl1.TabPages.Add(tp)
- Dim proc As New Process
- Dim startinf As New ProcessStartInfo
- startinf.Arguments = "-ssh " & Connection.IP & " -l " & Connection.User & " -pw " & Connection.PassWd
- startinf.FileName = "connector.exe"
- proc.StartInfo = startinf
- proc.Start()
- Thread.Sleep(500)
- SetParent(proc.MainWindowHandle, tp.Handle)
- SendMessage(proc.MainWindowHandle, WM_SYSCOMMAND, SC_MAXIMIZE, IntPtr.Zero)
- IsWindowVisible(proc.MainWindowHandle)
- End Sub
Das funktioniert auch soweit wunderbar.
Nun möchte ich allerdings dass der Border der Software verschwindet. Momentan kann ich das Programm nämlich in meiner Tabpage einfach schließen.
hat da jemand ne Idee?
Viele Frauen kamen, viele sind gegangen, eine ist geblieben 12.5.12 ich liebe dich Schatz