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.
Option Compare Database
Option Explicit
Public Const SC_CLOSE = &HF060
Public Const MF_BYCOMMAND = &H0
Declare Function GetActiveWindow Lib "user32" () As Integer
Public Declare Function GetSystemMenu Lib "user32" _
(ByVal hWnd As Long, ByVal bRevert As Long) As Long
Public Declare Function DeleteMenu Lib "user32" _
(ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
Public Function DisableX()
Dim tmp As Long
tmp = GetActiveWindow()
Dim hMenu As Long
hMenu = GetSystemMenu(tmp, 0&)
If hMenu Then
DeleteMenu hMenu, SC_CLOSE, MF_BYCOMMAND
DrawMenuBar (tmp)
End If
End Function
Public Function RestoreX()
Dim hMenu As Long
Dim tmp As Long
tmp = GetActiveWindow()
hMenu = GetSystemMenu(tmp, 1)
DrawMenuBar (tmp)
End Function
[\code]
Public Declare Function GetActiveWindow Lib "user32" Alias "GetActiveWindow" () As Long