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 Declare Function CreateScalableFontResource Lib "gdi32" _
Alias "CreateScalableFontResourceA" (ByVal fHidden As Integer, ByVal _
lpszResourceFile As String, ByVal lpszFontFile As String, ByVal _
lpszCurrentPath As String) As Integer
Private Declare Function AddFontResource Lib "gdi32" Alias _
"AddFontResourceA" (ByVal lpFileName As String) As Integer
Private Declare Function RemoveFontResource Lib "gdi32" Alias _
"RemoveFontResourceA" (ByVal lpFileName As String) As Integer
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, _
ByVal lParam As Integer) As Integer
Private Const WM_FONTCHANGE = &H1D
Private Const HWND_BROADCAST = &HFFFF&
Public Shared Sub InstallFonts()
Dim fi As System.IO.FileInfo
Try
Dim res As Integer
fi = New System.IO.FileInfo("IDAutomationHC39M.ttf")
Dim fiTarget As New System.IO.FileInfo("C:\Windows\Fonts\IDAutomationHC39M.ttf")
If fiTarget.Exists Then Return
' copy the font
fi.CopyTo("C:\Windows\Fonts\IDAutomationHC39M.ttf")
' add the font
res = CreateScalableFontResource(0, "c:\IDAutomationHC39M.fot", "c:\windows\fonts\IDAutomationHC39M.ttf", String.Empty)
Dim rt As Integer = System.Runtime.InteropServices.Marshal.GetLastWin32Error()
res = AddFontResource("C:\IDAutomationHC39M.ttf")
If res > 0 Then
' alert all windows that a font was added
SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Public Shared Sub UninstallFonts()
RemoveFontResource("C:\Windows\Fonts\IDAutomationHC39M.ttf")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
InstallFonts()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Label1.Font = New Font("IDAutomationHC39M", 25)
End Sub