|
|
|
|
|
Dicas
|
|
Visual Basic (Windows)
|
|
|
Título da Dica: Instalando uma fonte via código
|
|
|
|
Postada em 31/8/2003 por Ð@®l@n
'num módulo Public Const WM_FONTCHANGE = &H1D Public Const HWND_BROADCAST = &HFFFF&
Declare Function AddFontResource& Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFileName As String)
Declare Function SendMessageBynum& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lparam As Long)
Public Sub AddFont(File As String) Call AddFontResource(File) ' This adds the font Like arial.ttf Call SendMessageBynum(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) ' This notifies all other programs of a font change Msgbox File & " added" End sub
|
|
|
|
|