Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
'==== bas module - declarations section ========
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Private Declare Function WaitForInputIdle Lib "user32" _
(ByVal hProcess As Long, +
ByVal dwMilliseconds As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" _
(ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long
Private Const INFINITE = &HFFFF
Private Const SYNCHRONIZE = &H100000
'==== bas modue - code section ====
Public Sub ShellAndWait(sAppPath As String, Optional _
iWindowStyle As VbAppWinStyle = vbMinimizedFocus, _
Optional lmsTimeOut As Long = INFINITE)
'Optional argument lmsTimeOut specifies milliseconds to wait.
'Wait forever if omitted (default).
Dim lPid As Long, hProc As Long, lTimeOut As Long
lPid = Shell(sAppPath, iWindowStyle)
hProc = OpenProcess(SYNCHRONIZE, 0&, lPid)
If hProc <> 0& Then
WaitForInputIdle hProc, INFINITE
WaitForSingleObject hProc, lmsTimeOut
CloseHandle hProc
End If
End Sub