Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
Imports System.Runtime.InteropServices
Public Class FormEins
Public Class Win32Api
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Public Shared Function ShowWindow( _
ByVal hWnd As IntPtr, _
ByVal nCmdShow As Integer) As Boolean
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Public Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
End Function
Public Const SW_MAXIMIZE As Int32 = 3
End Class
Private Sub SetApplicationAsChild(ByVal CallingApplication As String, _
ByVal p As System.Windows.Forms.Panel)
Try
Dim hProcess As System.Diagnostics.Process = System.Diagnostics.Process.Start(CallingApplication)
hProcess.WaitForInputIdle()
Win32Api.SetParent(hProcess.MainWindowHandle, p.Handle)
Win32Api.ShowWindow(hProcess.MainWindowHandle, Win32Api.SW_MAXIMIZE)
Catch ex As Exception
MessageBox.Show(ex.Message.ToString(), "Info")
End Try
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Const APP_NAME As String = "notepad.exe"
SetApplicationAsChild(APP_NAME, Panel1)
End Sub
End Class