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.
Const ASSOCF_INIT_NOREMAPCLSID = &H1 'do not remap clsids to progids
Const ASSOCF_INIT_BYEXENAME = &H2 'executable is being passed in
Const ASSOCF_OPEN_BYEXENAME = &H2 'executable is being passed in
Const ASSOCF_INIT_DEFAULTTOSTAR = &H4 'treat "*" as the BaseClass
Const ASSOCF_INIT_DEFAULTTOFOLDER = &H8 'treat "Folder" as the BaseClass
Const ASSOCF_NOUSERSETTINGS = &H10 'dont use HKCU
Const ASSOCF_NOTRUNCATE = &H20 'dont truncate the return string
Const ASSOCF_VERIFY = &H40 'verify data is accurate (DISK HITS)
Const ASSOCF_REMAPRUNDLL = &H80 'actually gets info about rundlls target if applicable
Const ASSOCF_NOFIXUPS = &H100 'attempt to fix errors if found
Const ASSOCF_IGNOREBASECLASS = &H200 'dont recurse into the baseclass
Const ASSOCSTR_COMMAND = 1 'return the shell\verb\command string
Const ASSOCSTR_EXECUTABLE = 2 'return the the executable part of command string
Const S_OK = 0
Const E_POINTER = &H80004003
Declare Function AssocQueryString Lib "shlwapi.dll" _
Alias "AssocQueryStringA" (Byval flags As Long, _
Byval pstr As Long, Byval pszAssoc As String, _
Byval pszExtra As String, Byval pszOut As String, _
Byval pcchOut As Long) As Long
Function fGetAppPath(Byval strExt As String) As String
'--- Returns the path to an executable or an empty string if an error occurs
'--- Input
' strExt is the three character file extension associated with the executable
Dim lngRtn As Long
Dim lngBuffLen As Long
Dim strAppPath As String
Dim lngFlags As Long
'Check strExt isn't empty
If strExt = vbNullString Then
Exit Function
End If
'Set the flags
lngFlags = ASSOCF_NOTRUNCATE Or ASSOCF_REMAPRUNDLL
'Null terminate the file extension
strExt = "." & strExt & Chr$(0)
'Size the buffer for the return value
strAppPath = Space(255)
lngBuffLen = 255
'Get the exe path
lngRtn = AssocQueryString(lngFlags, ASSOCSTR_EXECUTABLE, _
strExt, "", strAppPath, lngBuffLen)
'Check the result
Select Case lngRtn
Case S_OK
'Success, do nothing
Case E_POINTER
'Buffer was too small - resize it and try again
strAppPath = Space(lngBuffLen)
lngRtn = AssocQueryString(lngFlags, ASSOCSTR_EXECUTABLE, _
strExt, "", strAppPath, lngBuffLen)
Case Else
'An error occurred - exit
Exit Function
End Select
'Strip the terminating null char and remaining spaces
fGetAppPath = Left$(strAppPath, Instr(1, strAppPath, Chr$(0)) -1)
End Function