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.
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Select Case UnloadMode
Case vbFormCode, vbAppWindows, vbAppTaskManager, _
vbAppTaskManager
Cancel = False
Case vbFormControlMenu, vbFormOwner
Cancel = True
end select
End Sub
Public Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long
Public Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Public Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Public Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Public Const MF_BYPOSITION = &H400&
Public Const MF_REMOVE = &H1000&
Dim lSysMenu As Long
Dim lMenuCount As Long
lSysMenu = GetSystemMenu(Me.hWnd, False)
If (lSysMenu <> 0) Then
lMenuCount = GetMenuItemCount(lSysMenu)
If (lMenuCount > 1) Then
RemoveMenu lSysMenu, lMenuCount - 1, (MF_BYPOSITION Or MF_REMOVE)
DrawMenuBar Me.hWnd
DoEvents
End If
End If