Advertisement
Guest User

AHK install img and font

a guest
Aug 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     AUTO_RUN SECTION — TOP OF SCRIPT
  3. */
  4. SetWorkingDir %A_ScriptDir%     ; to make a script unconditionally use its own folder as its working directory
  5. #Include %A_ScriptDir%          ; changes the working directory for subsequent #Includes and FileInstalls
  6.  
  7. /*
  8.     CHECK FILES AND INSTALLATION BEFORE LAUNCHING APP
  9. */
  10. ; CREATE MISSING FOLDERS
  11. IfNotExist, resources\img\
  12.     {  
  13.     FileCreateDir, resources\img\
  14.     }
  15. ; CREATE MISSING FILES
  16. if  (!FileExist("resources\img\myimg.png"))
  17.     {
  18.     FileInstall, resources\img\myimg.png, resources\img\myimg.png, 1
  19.     }
  20. if  (!FileExist("resources\font\segoeui.ttf"))
  21.     {
  22.     FileInstall, resources\font\segoeui.ttf, resources\font\segoeui.ttf,    1
  23.     }
  24. ; LOAD FONT
  25. DllCall("GDI32.DLL\AddFontResourceEx", Str,"resources\font\segoeui.ttf",UInt,(FR_PRIVATE:=0x10), Int,0)
  26.  
  27. /*
  28.     INSERT REST OF SCRIPT BELOW
  29. */
  30.  
  31.  
  32. /*
  33.     USE THE FOLLOWING TO UNLOAD FONT WHEN YOU EXITAPP :
  34.     ; Example
  35.     DllCall("GDI32.DLL\RemoveFontResourceEx",Str,"res\fnt\segoeui.ttf",UInt,(FR_PRIVATE:=0x10),Int,0)
  36.     ExitApp
  37. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement