Sign in to follow this  
Followers 0
newsak2005

Install Fonts Manager

1 post in this topic

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("MustDeclareVars", 1)

Global $guititle = 'Install Fonts Manager'

Local $hForm = GUICreate($guititle, 363, 112, -1, 200)
GUISetIcon(@ProgramFilesDir&'\AutoIt3\Aut2Exe\Icons\AutoIt_Old4.ico', "", $hForm)
WinSetOnTop($guititle, "", 1)
Local $Input = GUICtrlCreateInput("", 16, 32, 249, 21)
GUICtrlSetBkColor(-1, 0xFFFFFF)
GUICtrlCreateLabel("Fonts Dir path", 112, 15, 70, 17)
Local $Btn_sel = GUICtrlCreateButton("Browse", 272, 32, 75, 25, $WS_GROUP)
Local $Btn_ins = GUICtrlCreateButton("Insatll", 128, 72, 75, 25, $WS_GROUP)
GUICtrlSetCursor (-1, 0)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
TraySetIcon(@ProgramFilesDir&'\AutoIt3\Aut2Exe\Icons\AutoIt_Old4.ico', "")
While 1
   Local $nMsg = GUIGetMsg()
   Switch $nMsg
      Case $GUI_EVENT_CLOSE
         GUIDelete()
         Exit
        Case $Btn_sel
          Local $dialog_text = 'Choose a folder new fonts'
            Local $source_dir = FileSelectFolder($dialog_text, "", "", "", $hForm)
         If @error = 1 Then ContinueLoop
         GUICtrlSetData($Input, $source_dir)
         GUICtrlSetState($Btn_ins, $GUI_ENABLE)
      Case $Btn_ins
            Local $dest_dir = @WindowsDir&'\Fonts'
         Local $chk_err = DirCopy($source_dir, $dest_dir, 1)
         If $chk_err = 1 Then
            MsgBox(64, "", "Installation fonts complete.", 0, $hForm)
            _reset()
         Else
            MsgBox(48, "Error!", "Cannot install fonts.", 0, $hForm)
            _reset()
         EndIf
   EndSwitch
WEnd

Func _reset()
   GUICtrlSetData($Input, "")
   GUICtrlSetState($Btn_ins, $GUI_DISABLE)
EndFunc

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0