SHARE
TWEET

AHK install font and img

Pwner-Actual Aug 21st, 2019 (edited) 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     AUTORUN 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 EXAMPLE TO UNLOAD FONT WHEN YOU EXITAPP :
  34.         DllCall("GDI32.DLL\RemoveFontResourceEx",Str,"resources\font\segoeui.ttf",UInt,(FR_PRIVATE:=0x10),Int,0)
  35.         ExitApp
  36. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top