Hallo Liebes Forum. Ich versuche gerade einen String mit Semikolons zu übergeben. Der unten folgende Code funktioniert nicht :-). Wenn ich jedoch die System.Diagnostics.Process.Start("c:\test\main.exe " , "\test\ -vga") direkt befülle, findet er den Pfad. Wo iat mein Denkfehler?
1 | Private Sub SetApplicationAsChild(ByVal CallingApplication As String, ByVal p As System.Windows.Forms.Panel) |
2 | Try |
3 | Dim hProcess As System.Diagnostics.Process = System.Diagnostics.Process.Start(CallingApplication) |
4 | hProcess.WaitForInputIdle() |
5 | SetParent(hProcess.MainWindowHandle, p.Handle) |
6 | ShowWindow(hProcess.MainWindowHandle, SW_MAXIMIZE) |
7 | Catch ex As Exception |
8 | MessageBox.Show(ex.Message.ToString(), "Info") |
9 | End Try |
10 | End Sub |
11 | |
12 | Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click |
13 | Const APP_NAME As String = Chr(34) & "c:\test\main.exe" |
14 | Const APP_SEM As String = Chr(34) & " , " & Chr(34) |
15 | Const APP_PARAM As String = "\test\ -vga" & Chr(34) |
16 | Const APP As String = APP_NAME & APP_SEM & APP_PARAM |
17 | |
18 | 'System.Diagnostics.Process.Start("C:\Datei.exe", "-Parameter") |
19 | SetApplicationAsChild(APP, Panel1) |
20 | End Sub |