vanheartnet

Standard Autoshutdown

Jul 11th, 2021 (edited)
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.97 KB | None | 0 0
  1.  
  2. ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
  3. ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
  4. ;@Ahk2Exe-Set FileDescription, Windows Application
  5. ;@Ahk2Exe-Set FileVersion, 2.2.0.3
  6. ;@Ahk2Exe-SetInternalName Standard Autoshutdown
  7. ;@Ahk2Exe-SetName Standard Autoshutdown
  8. ;@Ahk2Exe-SetOrigFileName Standard Autoshutdown
  9. ;@Ahk2Exe-Set ProductName, Standard Autoshutdown
  10. ;@Ahk2Exe-Set ProductVersion, 2.2.0.3
  11. ;@Ahk2Exe-Set Description, Standard Autoshutdown
  12. ;@Ahk2Exe-Set Comments, Software Created by : VANHEARTNET
  13. ;@Ahk2Exe-Obey U_au, = "%A_IsUnicode%" ? 2 : 1 ; Script ANSI or Unicode?
  14. ;@Ahk2Exe-PostExec "BinMod.exe" "%A_WorkFileName%"
  15. ;@Ahk2Exe-Cont "%U_au%2.>AUTOHOTKEY SCRIPT<.01VANHEARTNET "
  16. ;@Ahk2Exe-SetMainIcon icon1.ico
  17. ;@Ahk2Exe-AddResource Icon1.ico, 160 ; Replaces 'H on blue'
  18. ;@Ahk2Exe-AddResource Icon1.ico, 206 ; Replaces 'S on green'
  19. ;@Ahk2Exe-AddResource Icon1.ico, 207 ; Replaces 'H on red'
  20. ;@Ahk2Exe-AddResource Icon1.ico, 208 ; Replaces 'S on red'
  21.  
  22.  
  23. #SingleInstance,Ignore
  24. ;~ #SingleInstance,Force
  25. #Persistent
  26. #NoEnv
  27. Menu,tray, NoStandard
  28. Menu, Tray, Tip, VANHEARTNET
  29. Menu, Tray, Add, Menu,Settings
  30. ;~ Menu, Tray, Add, Exit,Exit1
  31. SetWorkingDir, %A_ScriptDir%
  32. SetBatchLines, 20ms
  33. #MaxHotkeysPerInterval 99000000
  34. #HotkeyInterval 99000000
  35. #KeyHistory 0
  36. ListLines Off
  37. Process, Priority, , A
  38. SetKeyDelay, -1, -1
  39. SetMouseDelay, -1
  40. SetDefaultMouseSpeed, 0
  41. SetWinDelay, -1
  42. SetControlDelay, -1
  43. DetectHiddenWindows, On
  44. SetTitleMatchMode, 3
  45. SendMode Input
  46. #Include <Class_CustomFont>
  47. #Include <Gdip_All>
  48. #Include <GdipHelper>
  49. ;~ OnExit("ExitFunc")
  50.  
  51. pToken:=Gdip_Startup()
  52. Global Idle:=False, Poweroff:=0, SDTimer:=0, Window1:=[], LX , LY , Button1:=[] , HB_Button:=[] ,Switch1:=[] , Radio1:=[] , WW:=0
  53. SH:=A_ScreenHeight
  54. SW:=A_ScreenWidth
  55.  
  56. if not A_IsAdmin
  57. {
  58. Run, *RunAs "%A_ScriptFullpath%"
  59. ExitApp
  60. }
  61.  
  62. Default_Shutdown=
  63. (
  64. [Settings]
  65. Shutdown=0
  66. Wallpaper=0
  67. Taskmanager=0
  68. Idle=100
  69. Locktime=10
  70. Sound=0
  71. CRA=0
  72. Password=admin
  73. Antikill=0
  74. Antidelete=0
  75. ShowIcon=0
  76. )
  77. ;~ Antidelete:=0
  78. IfNotExist,%A_Appdata%\Fonts
  79. FileCreateDir,%A_Appdata%\Fonts
  80. IfNotExist,%A_Appdata%\Fonts\Pixel LCD-7.ttf
  81. FileInstall,Pixel LCD-7.ttf,%A_Appdata%\Fonts\Pixel LCD-7.ttf,1
  82. IfNotExist, Option.ini
  83. {
  84. FileAppend,% Default_Shutdown , Option.ini:VAN:$data
  85. FileSetAttrib,+H, Option.ini
  86. }
  87. IfExist, C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk
  88. Startup:=1
  89. else
  90. Startup:=0
  91. ;~ ######################### READ FILES ############################################################
  92. gosub, ReadSettings
  93. if(Shutdown=1)
  94. Lock1:=0
  95. else
  96. Lock1:=1
  97. ;~ #################################################################################################
  98. font1 := New CustomFont( A_AppData "\Fonts\Pixel LCD-7.ttf")
  99. Gui,1:+AlwaysOntop -Caption
  100. Window1[1]:=New Window_1( x:=0, y:=0, w:=SW, h:=SH, Window:=1, Option:="-DPIScale +AlwaysOntop +Toolwindow -Caption", Title:="Lockdown")
  101. if(Wallpaper=1)
  102. {
  103. IfExist, Wallpaper1.png
  104. Gui,1:Add,Picture,% "x" 15 " y" 15 " w" SW-30 " h" SH-28 " vWallpaper", Wallpaper1.png
  105. }
  106. LX:=SW-220
  107. LY:=SH-135
  108. Window1[2]:=New Window_1( x:=5, y:=45, w:=200, h:=135, Window:=2, Option:="-DPIScale +AlwaysOntop +Toolwindow -Caption +Owner1", Title:="TIMER CODE", PCNUM:=PCNUM)
  109. Window1[2].Draw_Logo()
  110. Locki:=Formatseconds(Locktime)
  111. Gui,2:Color,222222,333333
  112. Gui,2:Add,Groupbox,x3 y0 w194 h40,
  113. Gui,2:Font,
  114. Gui,2:Font,s28 cLime, Pixel LCD7
  115. Gui,2:Add,Text,x3 y6 w200 Center BackgroundTrans vtimer1, % Locki
  116. Button1.Push( New SwitchName(x:=5, y:=80, w:=190, h:= 30, state:=0, BG_Color:="222222", Font_Size:=20, Text1:="Youtube", Text2:="UNLOCK", Window:="2", Label:="Unlock"))
  117.  
  118. Gui,3:Color,222222,E2A0EC
  119. Gui,3:Font,s16
  120. Window1[3]:=New Window_1( x:=0, y:=0, w:=300, h:=100, Window:=3, Option:="-DPIScale +AlwaysOntop +Toolwindow +Owner1 -Caption ", Title:="PasswordMenu")
  121. ;~ Window1[3].Draw_Password()
  122. Window1[3].Draw_Window2()
  123. Gui,3:Add, Edit, x30 y28 w160 h30 Password limit16 Border Center -E0x200 r1 vEditPass,
  124. Button1.Push( New SwitchName(x:=200, y:=30, w:=70, h:= 30, state:=0, BG_Color:="222222", Font_Size:=20, Text1:="OK", Text2:="OK", Window:="3", Label:="PasswordEnter"))
  125.  
  126. Window1[4]:=New Window_1( x:=0, y:=0, w:=356, h:=480, Window:=4, Option:="-DPIScale +AlwaysOntop +Toolwindow +Owner1 -Caption ", Title:="MenuSettings")
  127. Window1[4].Draw_Menu_1()
  128. Radio1.Push( New Radio_01( x:=30, y:=70, w:= 25, h:= 25, state:=Shutdown, BG_Color:="222222", Enabled_Color:="FF00FF" , Window:="4", Label:="Radio1"))
  129. Radio1.Push( New Radio_01( x:=170, y:=70, w:= 25, h:= 25, state:=Lock1, BG_Color:="222222", Enabled_Color:="FF00FF" , Window:="4", Label:="Radio2"))
  130. Gui,4:Color,222222,E2A0EC
  131. Gui,4:Font,
  132. Gui,4:Font,s8 cFFFF89 italic , Pixel LCD7
  133. Gui,4:Add,Text,x65 y78 h25 BackgroundTrans gRadio1, Shutdown
  134. Gui,4:Add,Text,x200 y78 h25 BackgroundTrans gRadio2, Lock
  135. Gui,4:Font,
  136. Gui,4:Font,s10 cFFFF89 , Pixel LCD7
  137. Gui,4:Add,Text,x30 y328 h25 BackgroundTrans, IDLE TIME
  138. Gui,4:Add,Text,x30 y+8 h25 BackgroundTrans, LOCKTIME
  139. Gui,4:Add,Text,x30 y+8 h25 BackgroundTrans, PASSWORD
  140. Switch1.Push( New Switch_1(x:=40, y:=100, w:=100, h:=25,state:=Wallpaper, BG:="222222", Window:="4", Label:="Switch1"))
  141. Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=Taskmanager, BG:="222222", Window:="4", Label:="Switch1"))
  142. Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=Sound, BG:="222222", Window:="4", Label:="Switch1"))
  143. Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=CRA, BG:="222222", Window:="4", Label:="Switch1"))
  144. Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=Antikill, BG:="222222", Window:="4", Label:="Switch1"))
  145. Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=Startup, BG:="222222", Window:="4", Label:="Switch1"))
  146. Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=ShowIcon, BG:="222222", Window:="4", Label:="Switch1"))
  147. Gui,4:Font,
  148. Gui,4:Font, s12 bold
  149. Gui,4:Add,Edit, x120 y320 w50 Center r1 vEditIdleTime Number limit5 gIdle_Timer vIdle_Timer, % Idle_Time
  150. Gui,4:Add,Edit, x120 y+5 w50 Center r1 vEditLocktime Number limit5 gLock_Timer vLock_Timer, % Locktime
  151. Gui,4:Add,Edit, x120 y+5 w160 Center r1 limit16 vEditPassword gEditPassword Password, Password
  152. Gui,4:Font,
  153. Gui,4:Font,s8 cFFFFFF Bold
  154. Gui,4:Add,Text,x10 y8 w335 h48 BackgroundTrans gMove, ;10 , 8 , 335 , 48
  155. Gui,4:Add,Text,x105 y105 w200 h25 BackgroundTrans, Enable Wallpaper
  156. Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Disable Task Manager
  157. Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Disable Sound
  158. Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Close Listed Process
  159. Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Enable AntiKill
  160. Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Run On Startup
  161. Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Show Tray Icon
  162. Gui,4:Font,
  163. Gui,4:Font,s8 c00FF00 Bold
  164. Gui,4:Add,Text,x180 y330 h25 BackgroundTrans, Secs
  165. Gui,4:Add,Text,x180 y+5 h25 BackgroundTrans, Secs
  166. if(Antikill=1)
  167. SetTimer, AntiKill_Timer , 300
  168.  
  169. ;~ HB_Button.Push( New HB_Flat_Rounded_Button_Type_1( x:= 230, y:=435, w := 100, h := 30 , Button_Color := "FF00FF" , Button_Background_Color := "222222" , Text := "Exit" , Font := "Broadway" , Font_Size := 14 " Bold" , Font_Color_Top := BG4 , Font_Color_Bottom := "FF00FF" , Window := "4" , Label := "Exit1" , Default_Button := 1 , Roundness:=8, HoverColor:="ff0000", HoverColor2:="404040",BColor:="404040",TextHover:="FFFF00", Option:="") )
  170. HB_Button.Push( New HB_Flat_Rounded_Button_Type_1( x:= 20, y:=430, w:=315, h := 35 , Button_Color := "FF00FF" , Button_Background_Color := "222222" , Text := "Exit" , Font := "Broadway" , Font_Size := 14 " Bold" , Font_Color_Top := BG4 , Font_Color_Bottom := "FF00FF" , Window := "4" , Label := "Exit1" , Default_Button := 1 , Roundness:=3, HoverColor:="ff0000", HoverColor2:="404040",BColor:="404040",TextHover:="FFFF00", Option:="") )
  171.  
  172. Idle_Time:=(Idle_Time*1000)
  173. SetTimer, LockTimer, 200
  174. SetTimer, ShutdownTimer, 1000
  175. SetTimer, HB_Button_Hover , 50
  176. SetTimer, HB_Button_Hover2 , 50
  177. Loop,%A_ScriptDir%\*.png,1
  178. {
  179. WallpaperNum:=A_Index
  180. if(A_Index>=2)
  181. {
  182. SetTimer, Slider , 5000
  183. WW:=1
  184. ;~ Break 1
  185.  
  186. }
  187. }
  188. ;~ ######################## FUNC #######################
  189. If(Taskmanager=1)
  190. {
  191. SetRegView, 64
  192. RegWrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableTaskMgr,1
  193. }
  194. else
  195. {
  196. SetRegView, 64
  197. RegWrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableTaskMgr,0
  198. }
  199. if(CRA=1)
  200. {
  201. IfNotExist,Processlist.txt
  202. FileAppend,,Processlist.txt
  203. SeTtimer, Processlist , 1000
  204. }
  205. if(ShowIcon=0)
  206. SetTimer , koko , 1000
  207. return
  208.  
  209. koko:
  210. TrayIcon++
  211. if(TrayIcon>=5){
  212. Menu,tray, NoIcon
  213. TrayIcon:=""
  214. SetTimer, koko , Delete
  215. }
  216. return
  217. Slider:
  218. WW++
  219. IfExist, Wallpaper%WW%.png
  220. GuiControl, 1:, Wallpaper , Wallpaper%WW%.png
  221. ;~ if(WW>=WallpaperNum)
  222. ;~ WW:=0
  223. (WW>=WallpaperNum)?(WW:=0)
  224.  
  225. return
  226. EditPassword:
  227. Gui,4:Submit,Nohide
  228. IniWrite,% EditPassword , Option.ini:VAN:$data , SETTINGS , Password
  229. return
  230. Radio2:
  231. if(Radio1[2].state=0)
  232. {
  233. Radio1[2].state:=1
  234. Radio1[1].state:=0
  235. Radio1[2].Draw_Bitmap_ON()
  236. Radio1[1].Draw_Bitmap_OFF()
  237. Guicontrol,4:Enable,EditLocktime
  238. IniWrite,0,Option.ini:VAN:$data,SETTINGS,Shutdown
  239. }
  240. return
  241. Radio1:
  242. if(Radio1[1].state=0)
  243. {
  244. Radio1[1].state:=1
  245. Radio1[2].state:=0
  246. Radio1[1].Draw_Bitmap_ON()
  247. Radio1[2].Draw_Bitmap_OFF()
  248. Locktime:=0
  249. Guicontrol,4:,EditLocktime,% Locktime
  250. Guicontrol,4:Disable,EditLocktime
  251. IniWrite,1,Option.ini:VAN:$data,SETTINGS,Shutdown
  252. }
  253. return
  254. Idle_Timer:
  255. Gui,4:Submit,Nohide
  256. IniWrite,% Idle_Timer,Option.ini:VAN:$data,SETTINGS,Idle
  257. return
  258. Lock_Timer:
  259. Gui,4:Submit,Nohide
  260. IniWrite,% Lock_Timer,Option.ini:VAN:$data,SETTINGS,Locktime
  261. return
  262. Switch1:
  263. if(Radio1[1].state=1)
  264. return
  265. GuiControl , % Switch1[ A_GuiControl ].Window ": Focus" , % Switch1[ A_GuiControl ].Hwnd
  266. SoundBeep, 8000
  267. if( Switch1[ A_GuiControl ].state=0){
  268. Switch1[ A_GuiControl ].Draw_Switch_ON()
  269. Switch1[ A_GuiControl ].state:=1
  270. }else{
  271. Switch1[ A_GuiControl ].Draw_Switch_OFF()
  272. Switch1[ A_GuiControl ].state:=0
  273. }
  274. ;~ ######################## Func #################
  275. if(A_GuiControl=1)
  276. {
  277. IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,Wallpaper
  278. }
  279. else if(A_GuiControl=2)
  280. {
  281. IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,Taskmanager
  282. }
  283. else if(A_GuiControl=3)
  284. {
  285. IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,Sound
  286. }
  287. else if(A_GuiControl=4)
  288. {
  289. IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,CRA
  290. }
  291. else if(A_GuiControl=5)
  292. {
  293. IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,Antikill
  294.  
  295. }
  296. else if(A_GuiControl=6)
  297. {
  298. if(Switch1[ A_GuiControl ].state=1)
  299. {
  300. IfNotExist,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk
  301. {
  302. FileCreateShortcut,%A_ScriptDir%\%A_ScriptName%,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk,,
  303. }
  304. }
  305. else
  306. {
  307. IfExist,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk
  308. {
  309. FileDelete,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk
  310. }
  311. }
  312. }
  313. else if(A_GuiControl=7)
  314. {
  315. IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,ShowIcon
  316.  
  317. }
  318. return
  319.  
  320. Move:
  321. PostMessage,0xA1,2
  322. return
  323.  
  324. Settings:
  325. Gui,3:Show,w300 h100, PasswordMenu
  326. return
  327. PasswordEnter:
  328. SoundBeep, 5000
  329. Button1[A_GuiControl ].Draw_Bitmap_OFF()
  330. Sleep 200
  331. Button1[A_GuiControl].Draw_Bitmap_ON()
  332. sleep 200
  333. Gui,3:Hide
  334. GuiControl , % Switch1[ A_GuiControl ].Window ": Focus" , % Switch1[ A_GuiControl ].Hwnd
  335. IfNotExist,Option.ini
  336. return
  337. Gui,3:Submit,Nohide
  338. GuiControl,3:,EditPass,
  339. if(EditPass not ==Password)
  340. return
  341. Gui,4:Show,% "w" Window1[4].w " h" Window1[4].h , % Window1[4].Title
  342. return
  343. Processlist(){
  344. IfNotExist,Processlist.txt
  345. SetTimer, Processlist, Off
  346. Loop,read,Processlist.txt
  347. {
  348. Loop,parse,A_LoopReadLine,`n
  349. {
  350. process,exist,% A_Loopfield
  351. {
  352. If(Errorlevel!=0)
  353. {
  354. Process,close,% A_LoopField
  355. }
  356. }
  357. }
  358. }
  359. }
  360. LockTimer:
  361. IfWinActive, MenuSettings
  362. return
  363. WInget, Style1,Style, MenuSettings
  364. if(Style1="0x940A0000")
  365. return
  366. IfGreater,A_TimeIdle, % Idle_Time
  367. {
  368. if(Shutdown=1){
  369. Shutdown,5
  370. goto, Exit1
  371. }
  372. else
  373. Idle:=True
  374. }
  375. if(Idle=True)
  376. {
  377. IfWinNotActive, Lockdown
  378. {
  379. Gui,1:Show,x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%, Lockdown
  380. Gui,2:Show,x%LX% y%LY% w200 h115, TIMER CODE
  381. WinActivate, Lockdown
  382. if(Sound=1){
  383. SoundGet,SOUNDSTAT,,Volume,
  384. if(SOUNDSTAT>10)
  385. SoundSet,1,,Volume
  386. }
  387. }
  388. }
  389. return
  390.  
  391.  
  392. ReadSettings:
  393. IniRead,Idle_Time,Option.ini:VAN:$data,SETTINGS,Idle
  394. IniRead,Password,Option.ini:VAN:$data,SETTINGS,Password
  395. IniRead,Wallpaper,Option.ini:VAN:$data,SETTINGS,Wallpaper
  396. IniRead,Locktime,Option.ini:VAN:$data,SETTINGS,Locktime
  397. IniRead,Sound,Option.ini:VAN:$data,SETTINGS,Sound
  398. IniRead,Shutdown,Option.ini:VAN:$data,SETTINGS,Shutdown
  399. IniRead,CRA,Option.ini:VAN:$data,SETTINGS,CRA
  400. IniRead,Taskmanager,Option.ini:VAN:$data,SETTINGS,Taskmanager
  401. IniRead,Antikill,Option.ini:VAN:$data,SETTINGS,Antikill
  402. IniRead,ShowIcon,Option.ini:VAN:$data,SETTINGS,ShowIcon
  403. return
  404. Formatseconds(Locktime)
  405. {
  406. time = 19990101
  407. time += %Locktime% , Seconds
  408. FormatTime , mmss , %time% , mm:ss
  409. return mmss
  410. ;~ return Locktime //3600 ":" mmss
  411. }
  412. ShutdownTimer:
  413. if(Idle=True)
  414. {
  415. IfWinNotActive, Lockdown
  416. WinActivate
  417. Locktime--
  418. Locki:=Formatseconds(Locktime)
  419. GuiControl,2:,timer1,% Locki
  420. if(Locktime=0){
  421. SetTimer, ShutdownTimer , Off
  422. Shutdown, 5
  423. goto, Exit1
  424. }
  425. if(Locktime=10)
  426. GuiControl,2:+cred,timer1
  427. }
  428. return
  429.  
  430. AntiKill_Timer(){
  431. Process , exist , vnhost.exe
  432. if(Errorlevel=0)
  433. {
  434. IfExist,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.exe
  435. {
  436. Run, cmd.exe /c "C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.exe",,Hide
  437. }
  438. else
  439. {
  440. FileInstall,vnhost.exe,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.exe,1
  441. Sleep,100
  442. Run, cmd.exe /c "C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.exe",,Hide
  443. }
  444. IfNotExist,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vanhost.lnk
  445. {
  446. StringReplace,SPath,A_ScriptFullpath,\%A_ScriptName%,,All
  447. FileCreateShortcut,%A_ScriptFullpath%,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vanhost.lnk,%SPath%
  448. }
  449. }
  450. }
  451. Unlock:
  452. Button1[A_GuiControl ].Draw_Bitmap_OFF()
  453. Sleep 20
  454. Button1[A_GuiControl].Draw_Bitmap_ON()
  455. sleep 100
  456. SoundSet,100,,Volume
  457. Reload
  458. SDTimer:=0
  459. Idle:=False
  460. Poweroff:=0
  461. ShutdownTimer:=false
  462. return
  463.  
  464. 4GuiContextMenu:
  465. Reload
  466. return
  467.  
  468. ;~ Delete::
  469. ;~ Gui,4:Show,% "w" Window1[4].w " h" Window1[4].h , % Window1[4].Title
  470. ;~ return
  471. ;~ Esc::
  472. Exit1:
  473. Process,close,vnhost.exe
  474. ExitApp
  475.  
  476.  
  477. Class SwitchName{
  478. __New( x:=10, y:=10, w:= 100, h:= 30, state:=0, BG_Color:="222222", Font_Size:=20, Text1:="SwitchON", Text2:="SwitchOFF", Window:="1", Label:="SwitchC"){
  479. This.X:=x
  480. This.Y:=y
  481. This.W:=w
  482. This.H:=h
  483. This.Window:=Window
  484. This.State:=state
  485. This.Font_Size := Font_Size
  486. This.BG_Color:= "0xFF" BG_Color
  487. This.Text1:=Text1
  488. This.Text2:=Text2
  489. This.Label:=Label
  490. This.Create_Switch_OFF()
  491. This.Create_Switch_ON()
  492. This.Create_Switch_HOVER()
  493. This.Adding_Control()
  494. sleep 20
  495. (This.State=0)?(This.Draw_Bitmap_OFF()):(This.Draw_Bitmap_ON())
  496. }
  497. Adding_Control(){
  498. static
  499. num := Button1.Length()+1
  500. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  501. This.Number := Num , This.Hwnd := Hwnd
  502. }
  503. Create_Switch_OFF(){
  504. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  505. G := Gdip_GraphicsFromImage( pBitmap )
  506. Gdip_SetSmoothingMode( G , 4 )
  507. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  508. Gdip_FillRectangle( G , Brush , -1 , -1 , This.w+2 , This.h+2 )
  509. Gdip_DeleteBrush( Brush )
  510. Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
  511. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
  512. Gdip_DeleteBrush( Brush )
  513. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  514. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
  515. Gdip_DeleteBrush( Brush )
  516. ;Text
  517. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  518. ;Text
  519. Gdip_TextToGraphics( G , This.Text1 , "s10 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w-10, This.h-10 )
  520. Gdip_DeleteBrush( Brush )
  521. ;Text
  522. Brush := Gdip_BrushCreateSolid( "0xFF888888" )
  523. ;Text
  524. Gdip_TextToGraphics( G , This.Text2 , "s10 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w-10 , This.h-10 )
  525. Gdip_DeleteBrush( Brush )
  526. Gdip_DeleteGraphics( G )
  527. This.Switch_OFF := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  528. Gdip_DisposeImage(pBitmap)
  529. }
  530. Create_Switch_ON(){
  531. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  532. G := Gdip_GraphicsFromImage( pBitmap )
  533. Gdip_SetSmoothingMode( G , 4 )
  534. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  535. Gdip_FillRectangle( G , Brush , -6 , -1 , This.w+2 , This.h+2 )
  536. Gdip_DeleteBrush( Brush )
  537. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  538. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
  539. Gdip_DeleteBrush( Brush )
  540. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  541. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
  542. Gdip_DeleteBrush( Brush )
  543. ;Text
  544. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  545. ;Text
  546. Gdip_TextToGraphics( G , This.Text1 , "s12 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w , This.h-10 )
  547. Gdip_DeleteBrush( Brush )
  548. ;Text
  549. Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
  550. ;Text
  551. Gdip_TextToGraphics( G , This.Text2 , "s12 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w , This.h-10 )
  552. Gdip_DeleteBrush( Brush )
  553. Gdip_DeleteGraphics( G )
  554. This.Switch_ON := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  555. Gdip_DisposeImage(pBitmap)
  556. }
  557. Create_Switch_HOVER(){
  558. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  559. G := Gdip_GraphicsFromImage( pBitmap )
  560. Gdip_SetSmoothingMode( G , 4 )
  561. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  562. Gdip_FillRectangle( G , Brush , -6 , -1 , This.w+2 , This.h+2 )
  563. Gdip_DeleteBrush( Brush )
  564. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  565. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
  566. Gdip_DeleteBrush( Brush )
  567. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  568. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
  569. Gdip_DeleteBrush( Brush )
  570. ;Text
  571. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  572. ;Text
  573. Gdip_TextToGraphics( G , This.Text1 , "s12 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w , This.h-10 )
  574. Gdip_DeleteBrush( Brush )
  575. Brush := Gdip_BrushCreateSolid( "0xFF00FFFF" )
  576. ;Text
  577. Gdip_TextToGraphics( G , This.Text2 , "s12 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w , This.h-10 )
  578. Gdip_DeleteBrush( Brush )
  579. Gdip_DeleteGraphics( G )
  580. This.Switch_Hover := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  581. Gdip_DisposeImage(pBitmap)
  582. }
  583. Draw_Bitmap_OFF(){
  584. SetImage( This.Hwnd , This.Switch_OFF )
  585. }
  586. Draw_Bitmap_ON(){
  587. SetImage( This.Hwnd , This.Switch_ON )
  588. }
  589. Draw_Bitmap_Hover(){
  590. SetImage( This.Hwnd , This.Switch_Hover )
  591. }
  592. }
  593.  
  594. ;Add the hover fuction to the bottom of your script (or go lib route if you know how to)
  595. HB_Button_Hover(){
  596. Static Index
  597. global Hover_On
  598. MouseGetPos,,,, ctrl , 2
  599. if( ! Hover_On && ctrl ){
  600. loop , % Button1.Length()
  601. if( ctrl = Button1[ A_Index ].hwnd )
  602. {
  603. if(Button1[A_Index].state=0)
  604. Button1[ A_Index ].Draw_Bitmap_Hover() , Index := A_Index , Hover_On := 1 , break
  605. else
  606. Button1[ A_Index ].Draw_Bitmap_Hover() , Index := A_Index , Hover_On := 0 , break
  607. if(Hover_On=1)
  608. SoundBeep,200
  609. }
  610. }else if( Hover_On = 1 )
  611. if( ctrl != Button1[ Index ].Hwnd )
  612. Button1[ Index ].Draw_Bitmap_OFF() , Hover_On := 0
  613. }
  614.  
  615. Class Window_1{
  616. __New( x:=10, y:=10, w:=602, h:=402, Window:=1, Option:="-DPIScale +AlwaysOntop -Caption +E0x10", Title:="Sample Window", PCNUM:="PCNUM"){
  617. This.X:=x,This.Y:=y,This.W:=w,This.H:=h,This.Window:=Window,This.Option:=Option,This.Title:=Title,This.PCNUM:=PCNUM,This.Create_BANNER2(),This.Create_Window(),This.Create_Window2(),This.Create_Window3(),This.Create_Logo(),This.Create_Admin(),This.Add_Window(),This.Create_Banner1(), This.Create_Menu_1(), This.Create_Password(),sleep 20,This.Draw_Window1()
  618. ;~ This.Draw_Menu_1(), This.Draw_Password()
  619. }
  620. Add_Window(){
  621. static
  622. Num:=Window1.Length()+1
  623. Gui, % This.Window " :" This.Option
  624. Gui, % This.Window ":Add" , Picture,% "x" This.X " y" This.Y " w" This.W " h" This.H " v" Num " hwndhwnd 0xE"
  625. This.Number := Num , This.Hwnd := Hwnd
  626. }
  627. Create_Window(){
  628. pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;500,500
  629. G := Gdip_GraphicsFromImage( pBitmap )
  630. Gdip_SetSmoothingMode( G , 4 )
  631. Brush := Gdip_BrushCreateHatch( "0xFF000000" , "0xFF404040" , 39 )
  632. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W , This.H )
  633. Gdip_DeleteBrush( Brush )
  634. Brush := Gdip_BrushCreateHatch( "0xFF333333" , "0xFF000000" , 39 )
  635. Pen := Gdip_CreatePenFromBrush( Brush , 8 )
  636. Gdip_DeleteBrush( Brush )
  637. Gdip_DrawRectangle( G , Pen , This.X+2 , This.Y+2 , This.W-4 , This.H-4 )
  638. Gdip_DeletePen( Pen )
  639. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF404040" , 1 )
  640. Pen := Gdip_CreatePenFromBrush( Brush , 5 )
  641. Gdip_DeleteBrush( Brush )
  642. Gdip_DrawRectangle( G , Pen , This.X+10 , This.Y+10 , This.W-20 , This.H-20 )
  643. Gdip_DeletePen( Pen )
  644. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF333333" , "0xFF222222" , 1 )
  645. Gdip_FillRoundedRectangle( G , Brush , This.W-210 , This.H-50 , 190 , 30 , 5 )
  646. Gdip_DeleteBrush( Brush )
  647. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 50 , 50 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
  648. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  649. Gdip_DeleteBrush( Brush )
  650. Gdip_DrawRoundedRectangle( G , Pen , This.W-210 , This.H-50 , 190 , 30 , 5 )
  651. Gdip_DeletePen( Pen )
  652. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
  653. Gdip_TextToGraphics( G , "V A N H E A R T N E T" , "s16 Center vCenter Bold c" Brush "x" This.W-228 " y" This.H-45 , "Segoe UI" , 225 , 20 ) ;x273 y455
  654. Gdip_DeleteBrush( Brush )
  655. This.Draw_1 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  656. Gdip_DisposeImage(pBitmap)
  657. }
  658. Create_Logo(){
  659. pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ; 300, 80
  660. G := Gdip_GraphicsFromImage( pBitmap )
  661. Gdip_SetSmoothingMode( G , 4 )
  662. Brush := Gdip_CreateLineBrush( 20 , 20 , 100 , 100 , "0xFF333333" , "0xFF222222" , 1 )
  663. Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , 190 , 30 , 5 )
  664. Gdip_DeleteBrush( Brush )
  665. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 50 , 50 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
  666. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  667. Gdip_DeleteBrush( Brush )
  668. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , 190 , 30 , 5 )
  669. Gdip_DeletePen( Pen )
  670. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
  671. Gdip_TextToGraphics( G , "V A N H E A R T N E T" , "s16 Center vCenter Bold c" Brush "x" 0 " y" 5 , "Segoe UI" , 190 , 20 ) ;x273 y455
  672. Gdip_DeleteBrush( Brush )
  673. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 50 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
  674. Gdip_TextToGraphics( G , "V A N H E A R T N E T" , "s16 Center vCenter Bold c" Brush "x" 3 " y" 5 , "Segoe UI" , 190 , 20 ) ;x273 y455
  675. Gdip_DeleteBrush( Brush )
  676. This.Draw_4 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  677. Gdip_DisposeImage(pBitmap)
  678. }
  679. Create_Window2(){
  680. pBitmap:=Gdip_CreateBitmap( 300 , 100 )
  681. G := Gdip_GraphicsFromImage( pBitmap )
  682. Gdip_SetSmoothingMode( G , 4 )
  683. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  684. Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 102 )
  685. Gdip_DeleteBrush( Brush )
  686. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  687. Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , 299 , 99 , 8 )
  688. Gdip_DeleteBrush( Brush )
  689. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFC4136" , "0xFF733D59" , 1 )
  690. Pen := Gdip_CreatePenFromBrush( Brush , 5 )
  691. Gdip_DeleteBrush( Brush )
  692. Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 296 , 96 , 8 )
  693. Gdip_DeletePen( Pen )
  694.  
  695. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  696. Gdip_TextToGraphics( G , "PASSWORD" , "s12 Center vCenter Bold c" Brush " x18 y53" , "Arial Black" , 100 , 50 )
  697. Gdip_DeleteBrush( Brush )
  698. Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
  699. Gdip_TextToGraphics( G , "PASSWORD" , "s12 Center vCenter Bold c" Brush " x19 y52" , "Arial Black" , 100 , 50 )
  700. Gdip_DeleteBrush( Brush )
  701. Pen := Gdip_CreatePen( "0xFF222222" , 5 )
  702. Gdip_DrawLine( G , Pen , 115 , 75 , 253 , 75 )
  703. Gdip_DeletePen( Pen )
  704. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF00FF" , "0xFF00FF00" , 1 , 1 )
  705. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  706. Gdip_DeleteBrush( Brush )
  707. Gdip_DrawLine( G , Pen , 120 , 75 , 250 , 75 )
  708. Gdip_DeletePen( Pen )
  709. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  710. Gdip_FillRectangle( G , Brush , 26 , 22 , 248 , 45 )
  711. Gdip_DeleteBrush( Brush )
  712. Gdip_DeleteGraphics( G )
  713.  
  714. This.Draw_2 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  715. Gdip_DisposeImage(pBitmap)
  716. }
  717. ;~ Create_Window2(){
  718. ;~ pBitmap:=Gdip_CreateBitmap( 400 , 150 )
  719. ;~ G := Gdip_GraphicsFromImage( pBitmap )
  720. ;~ Gdip_SetSmoothingMode( G , 4 )
  721. ;~ Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  722. ;~ Gdip_FillRectangle( G , Brush , -1 , -1 , 402 , 152 )
  723. ;~ Gdip_DeleteBrush( Brush )
  724. ;~ Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  725. ;~ Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , 399 , 149 , 8 )
  726. ;~ Gdip_DeleteBrush( Brush )
  727. ;~ Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFC4136" , "0xFF733D59" , 1 )
  728. ;~ Pen := Gdip_CreatePenFromBrush( Brush , 5 )
  729. ;~ Gdip_DeleteBrush( Brush )
  730. ;~ Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 396 , 146 , 8 )
  731. ;~ Gdip_DeletePen( Pen )
  732. ;~ This.Draw_2 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  733. ;~ Gdip_DisposeImage(pBitmap)
  734. ;~ }
  735. Create_Window3(){
  736. pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;300 , 600
  737. G := Gdip_GraphicsFromImage( pBitmap )
  738. Gdip_SetSmoothingMode( G , 4 )
  739. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  740. Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , This.W , This.H , 10 )
  741. Gdip_DeleteBrush( Brush )
  742. Pen := Gdip_CreatePen( "0xFFFF0000" , 3 )
  743. Gdip_DrawRoundedRectangle( G , Pen , 1 , 1 , This.W-3 , This.H-3 , 10 )
  744. Gdip_DeletePen( Pen )
  745. Pen := Gdip_CreatePen( "0xFF000000" , 2 )
  746. Gdip_DrawRoundedRectangle( G , Pen , 1 , 1 , This.W-3 , This.H-3 , 10 )
  747. Gdip_DeletePen( Pen )
  748. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF333333" , "0xFF222222" , 1 )
  749. Gdip_FillRoundedRectangle( G , Brush , 20 , 10 , 260 , 30 , 6 )
  750. Gdip_DeleteBrush( Brush )
  751. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF0000FF" , "0xFFFFFFFF" , 1 )
  752. Pen := Gdip_CreatePenFromBrush( Brush , 1 )
  753. Gdip_DeleteBrush( Brush )
  754. Gdip_DrawRoundedRectangle( G , Pen , 20 , 10 , 260 , 30 , 5 )
  755. Gdip_DeletePen( Pen )
  756. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  757. Gdip_TextToGraphics( G , "S E T T I N G S" , "s16 Center vCenter Bold c" Brush " x19 y10" , "Segoe UI" , 260 , 30 )
  758. Gdip_DeleteBrush( Brush )
  759. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  760. Gdip_TextToGraphics( G , "S E T T I N G S" , "s16 Center vCenter Bold c" Brush " x18 y11" , "Segoe UI" , 260 , 30 )
  761. Gdip_DeleteBrush( Brush )
  762. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  763. Gdip_TextToGraphics( G , "S E T T I N G S" , "s16 Center vCenter Bold c" Brush " x21 y12" , "Segoe UI" , 260 , 30 )
  764. Gdip_DeleteBrush( Brush )
  765. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFFFF00" , "0xFF404040" , 1 , 1 )
  766. Gdip_TextToGraphics( G , "S E T T I N G S" , "s16 Center vCenter Bold c" Brush " x20 y11" , "Segoe UI" , 260 , 30 )
  767. Gdip_DeleteBrush( Brush )
  768. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  769. Gdip_FillRoundedRectangle( G , Brush , 10 , 62 , 278 , This.H-70 , 3 )
  770. Gdip_DeleteBrush( Brush )
  771. Pen := Gdip_CreatePen( "0xFF888888" , 3 )
  772. Gdip_DrawRoundedRectangle( G , Pen , 10 , 62 , 278 , This.H-70 , 2 )
  773. Gdip_DeletePen( Pen )
  774. This.Draw_3 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  775. Gdip_DisposeImage(pBitmap)
  776. }
  777. Create_Admin(){
  778. pBitmap:=Gdip_CreateBitmap( 400 , 220 )
  779. G := Gdip_GraphicsFromImage( pBitmap )
  780. Gdip_SetSmoothingMode( G , 4 )
  781. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  782. Gdip_FillRectangle( G , Brush , -1 , -1 , 402 , 222 )
  783. Gdip_DeleteBrush( Brush )
  784. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  785. Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , 399 , 219 , 8 )
  786. Gdip_DeleteBrush( Brush )
  787. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFC4136" , "0xFF733D59" , 1 )
  788. Pen := Gdip_CreatePenFromBrush( Brush , 5 )
  789. Gdip_DeleteBrush( Brush )
  790. Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 396 , 216 , 8 )
  791. Gdip_DeletePen( Pen )
  792. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  793. Gdip_TextToGraphics( G , "OLD PASS" , "S16 Right vCenter Bold c" Brush " x9 y69" , "Segoe UI" , 130 , 50 )
  794. Gdip_DeleteBrush( Brush )
  795. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  796. Gdip_TextToGraphics( G , "OLD PASS" , "S16 Right vCenter Bold c" Brush " x4 y65" , "Segoe UI" , 130 , 50 )
  797. Gdip_DeleteBrush( Brush )
  798. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  799. Gdip_TextToGraphics( G , "OLD PASS" , "S16 Right vCenter Bold c" Brush " x7 y67" , "Segoe UI" , 130 , 50 )
  800. Gdip_DeleteBrush( Brush )
  801. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  802. Gdip_TextToGraphics( G , "NEW PASS" , "S16 Right vCenter Bold c" Brush " x4 y95" , "Segoe UI" , 130 , 50 )
  803. Gdip_DeleteBrush( Brush )
  804. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  805. Gdip_TextToGraphics( G , "NEW PASS" , "S16 Right vCenter Bold c" Brush " x8 y100" , "Segoe UI" , 130 , 50 )
  806. Gdip_DeleteBrush( Brush )
  807. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  808. Gdip_TextToGraphics( G , "NEW PASS" , "S16 Right vCenter Bold c" Brush " x7 y97" , "Segoe UI" , 130 , 50 )
  809. Gdip_DeleteBrush( Brush )
  810. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  811. Gdip_TextToGraphics( G , "CONFIRM PASS" , "S16 Right vCenter Bold c" Brush " x4 y124" , "Segoe UI" , 130 , 50 )
  812. Gdip_DeleteBrush( Brush )
  813. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  814. Gdip_TextToGraphics( G , "CONFIRM PASS" , "S16 Right vCenter Bold c" Brush " x8 y129" , "Segoe UI" , 130 , 50 )
  815. Gdip_DeleteBrush( Brush )
  816. Brush := Gdip_BrushCreateSolid( "0xFFff0000" )
  817. Gdip_TextToGraphics( G , "CONFIRM PASS" , "S16 Right vCenter Bold c" Brush " x7 y126" , "Segoe UI" , 130 , 50 )
  818. Gdip_DeleteBrush( Brush )
  819. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  820. Gdip_TextToGraphics( G , "OLD USER" , "S16 Right vCenter Bold c" Brush " x5 y7" , "Segoe UI" , 130 , 50 )
  821. Gdip_DeleteBrush( Brush )
  822. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  823. Gdip_TextToGraphics( G , "OLD USER" , "S16 Right vCenter Bold c" Brush " x8 y11" , "Segoe UI" , 130 , 50 )
  824. Gdip_DeleteBrush( Brush )
  825. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  826. Gdip_TextToGraphics( G , "OLD USER" , "S16 Right vCenter Bold c" Brush " x7 y8" , "Segoe UI" , 130 , 50 )
  827. Gdip_DeleteBrush( Brush )
  828. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  829. Gdip_TextToGraphics( G , "NEW USER" , "S16 Right vCenter Bold c" Brush " x4 y36" , "Segoe UI" , 130 , 50 )
  830. Gdip_DeleteBrush( Brush )
  831. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  832. Gdip_TextToGraphics( G , "NEW USER" , "S16 Right vCenter Bold c" Brush " x8 y41" , "Segoe UI" , 130 , 50 )
  833. Gdip_DeleteBrush( Brush )
  834. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  835. Gdip_TextToGraphics( G , "NEW USER" , "S16 Right vCenter Bold c" Brush " x7 y38" , "Segoe UI" , 130 , 50 )
  836. Gdip_DeleteBrush( Brush )
  837. Gdip_DeleteGraphics( G )
  838. This.Draw_5 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  839. Gdip_DisposeImage(pBitmap)
  840. }
  841. Create_Banner1(){
  842. pBitmap:=Gdip_CreateBitmap( This.W , This.H )
  843. G := Gdip_GraphicsFromImage( pBitmap )
  844. Gdip_SetSmoothingMode( G , 4 )
  845. Brush := Gdip_CreateLineBrushFromRect( 0 , 120 , 100 , 100 , "0xFFFF0000" , "0xFF000000" , 1 , 1 )
  846. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  847. Gdip_DeleteBrush( Brush )
  848. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  849. Gdip_FillRectangle( G , Brush , -1 , 5 , This.W-13 , This.H-10 )
  850. Gdip_DeleteBrush( Brush )
  851. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 , 1 )
  852. Pen := Gdip_CreatePenFromBrush( Brush , 1 )
  853. Gdip_DeleteBrush( Brush )
  854. Gdip_DrawRectangle( G , Pen , -1 , 5 , This.W-13 , This.H-10 )
  855. Gdip_DeletePen( Pen )
  856. This.Draw_6 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  857. Gdip_DisposeImage(pBitmap)
  858. }
  859. Create_BANNER2(){
  860. pBitmap:=Gdip_CreateBitmap( 300 , 250 )
  861. G := Gdip_GraphicsFromImage( pBitmap )
  862. Gdip_SetSmoothingMode( G , 4 )
  863. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  864. Gdip_FillRectangle( G , Brush , 15 , 8 , 270 , 230 )
  865. Gdip_DeleteBrush( Brush )
  866. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  867. Gdip_FillRectangle( G , Brush , 25 , 20 , 251 , 200 )
  868. Gdip_DeleteBrush( Brush )
  869. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFFFFFF" , "0xFF00FF00" , 1 )
  870. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  871. Gdip_DeleteBrush( Brush )
  872. Gdip_DrawRectangle( G , Pen , 25 , 20 , 251 , 200 )
  873. Gdip_DeletePen( Pen )
  874. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 )
  875. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  876. Gdip_DeleteBrush( Brush )
  877. Gdip_DrawRectangle( G , Pen , 15 , 8 , 270 , 228 )
  878. Gdip_DeletePen( Pen )
  879. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  880. Gdip_TextToGraphics( G , This.PCNUM , "s90 Center vCenter Bold Underline c" Brush " x1 y65" , "Segoe UI" , 300 , 50 )
  881. Gdip_DeleteBrush( Brush )
  882. Brush := Gdip_CreateLineBrushFromRect( 139 , 91 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 , 1 )
  883. Gdip_TextToGraphics( G , This.PCNUM , "s90 Center vCenter Bold c" Brush " x1 y55" , "Segoe UI" , 300 , 50 )
  884. Gdip_DeleteBrush( Brush )
  885. Brush := Gdip_BrushCreateSolid( "0xFF666666" )
  886. Gdip_TextToGraphics( G , "SHUTTING DOWN IN..." , "s20 Center vCenter Bold c" Brush " x0 y162" , "Segoe UI" , 300 , 50 )
  887. Gdip_DeleteBrush( Brush )
  888. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  889. Gdip_TextToGraphics( G , "SHUTTING DOWN IN..." , "s20 Center vCenter Bold c" Brush " x2 y160" , "Segoe UI" , 300 , 50 )
  890. Gdip_DeleteBrush( Brush )
  891. Gdip_DeleteGraphics( G )
  892. This.Draw_7 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  893. Gdip_DisposeImage(pBitmap)
  894. }
  895. Create_Password(){
  896. pBitmap:=Gdip_CreateBitmap( 300 , 100 )
  897. G := Gdip_GraphicsFromImage( pBitmap )
  898. Gdip_SetSmoothingMode( G , 4 )
  899. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  900. Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 102 )
  901. Gdip_DeleteBrush( Brush )
  902. Pen := Gdip_CreatePen( "0xFFFF00ff" , 3 )
  903. Gdip_DrawRectangle( G , Pen , 0 , 0 , 299 , 99 )
  904. Gdip_DeletePen( Pen )
  905. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF00ff" , "0xFF222222" , 1 )
  906. Gdip_FillRoundedRectangle( G , Brush , 15 , 10 , 270 , 80 , 8 )
  907. Gdip_DeleteBrush( Brush )
  908. Brush := Gdip_BrushCreateHatch( "0xFFFF00FF" , "0xFF220022" , 50 )
  909. Pen := Gdip_CreatePenFromBrush( Brush , 10 )
  910. Gdip_DeleteBrush( Brush )
  911. Gdip_DrawRoundedRectangle( G , Pen , 15 , 10 , 270 , 80 , 5 )
  912. Gdip_DeletePen( Pen )
  913. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  914. Gdip_TextToGraphics( G , "PASSWORD" , "s12 Center vCenter Bold c" Brush " x18 y53" , "Arial Black" , 100 , 50 )
  915. Gdip_DeleteBrush( Brush )
  916. Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
  917. Gdip_TextToGraphics( G , "PASSWORD" , "s12 Center vCenter Bold c" Brush " x19 y52" , "Arial Black" , 100 , 50 )
  918. Gdip_DeleteBrush( Brush )
  919. Pen := Gdip_CreatePen( "0xFF222222" , 5 )
  920. Gdip_DrawLine( G , Pen , 115 , 75 , 253 , 75 )
  921. Gdip_DeletePen( Pen )
  922. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF00FF" , "0xFF00FF00" , 1 , 1 )
  923. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  924. Gdip_DeleteBrush( Brush )
  925. Gdip_DrawLine( G , Pen , 120 , 75 , 250 , 75 )
  926. Gdip_DeletePen( Pen )
  927. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  928. Gdip_FillRectangle( G , Brush , 26 , 22 , 248 , 45 )
  929. Gdip_DeleteBrush( Brush )
  930. Gdip_DeleteGraphics( G )
  931. This.Draw_9 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  932. Gdip_DisposeImage(pBitmap)
  933. }
  934.  
  935. ;~ ################################### STANDARD AUTOSHUTDOWN ######################################################################
  936. Create_Menu_1(){
  937. ;Bitmap Created Using: HB Bitmap Maker
  938. pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;356 , 430
  939. G := Gdip_GraphicsFromImage( pBitmap )
  940. Gdip_SetSmoothingMode( G , 4 )
  941. ;BG
  942. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  943. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W-4 , This.H-28 )
  944. Gdip_DeleteBrush( Brush )
  945. ;HATCH
  946. Brush := Gdip_BrushCreateHatch( "0xFF888888" , "0xFF222222" , 40 )
  947. Gdip_FillRectangle( G , Brush , 5 , 5 , This.W-6 , This.H-10 )
  948. Gdip_DeleteBrush( Brush )
  949. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF00FF" , "0xFF888888" , 1 , 1 )
  950. Pen := Gdip_CreatePenFromBrush( Brush , 8 )
  951. Gdip_DeleteBrush( Brush )
  952. Gdip_DrawRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-1)
  953. Gdip_DeletePen( Pen )
  954. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  955. Gdip_FillRoundedRectangle( G , Brush , 10 , 60 , This.W-21 , This.H-70 , 8 )
  956. Gdip_DeleteBrush( Brush )
  957. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF00FF" , "0xFF452559" , 1 , 1 )
  958. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  959. Gdip_DeleteBrush( Brush )
  960. Gdip_DrawRoundedRectangle( G , Pen , 10 , 60 , This.W-21 , This.H-70 , 5 )
  961. Gdip_DeletePen( Pen )
  962. Brush := Gdip_BrushCreateSolid( "0xFF813FA9" )
  963. Gdip_FillRoundedRectangle( G , Brush , 10 , 8 , 335 , 48 , 5 )
  964. Gdip_DeleteBrush( Brush )
  965. Brush := Gdip_CreateLineBrushFromRect( 15 , 56 , 100 , 100 , "0xFF222222" , "0xFFFF00FF" , 1 , 1 )
  966. Pen := Gdip_CreatePenFromBrush( Brush , 6 )
  967. Gdip_DeleteBrush( Brush )
  968. Gdip_DrawRoundedRectangle( G , Pen , 10 , 8 , 335 , 48 , 5 )
  969. Gdip_DeletePen( Pen )
  970. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  971. Gdip_TextToGraphics( G , "STANDARD AUTOSHUTDOWN" , "s12 Center vCenter Bold c" Brush " x28 y10" , "Arial Black" , 250 , 50 )
  972. Gdip_DeleteBrush( Brush )
  973. Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
  974. Gdip_TextToGraphics( G , "STANDARD AUTOSHUTDOWN" , "s12 Center vCenter Bold c" Brush " x27 y9" , "Arial Black" , 250 , 50 )
  975. Gdip_DeleteBrush( Brush )
  976. Pen := Gdip_CreatePen( "0xFF222222" , 4 )
  977. Gdip_DrawLine( G , Pen , 20 , 19 , 280 , 19 )
  978. Gdip_DeletePen( Pen )
  979. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFFFF00FF" , 1 )
  980. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  981. Gdip_DeleteBrush( Brush )
  982. Gdip_DrawLine( G , Pen , 20 , 20 , 280 , 20 )
  983. Gdip_DeletePen( Pen )
  984. Gdip_DeleteGraphics( G )
  985. This.Draw_8 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  986. Gdip_DisposeImage(pBitmap)
  987. }
  988. Draw_Window1(){
  989. SetImage( This.Hwnd , This.Draw_1 )
  990. }
  991. Draw_Window2(){
  992. SetImage( This.Hwnd , This.Draw_2 )
  993. }
  994. Draw_Window3(){
  995. SetImage( This.Hwnd , This.Draw_3 )
  996. }
  997. Draw_Logo(){
  998. SetImage( This.Hwnd , This.Draw_4 )
  999. }
  1000. Draw_Admin(){
  1001. SetImage( This.Hwnd , This.Draw_5 )
  1002. }
  1003. Draw_BANNER1(){
  1004. SetImage( This.Hwnd , This.Draw_6 )
  1005. }
  1006. Draw_BANNER2(){
  1007. SetImage( This.Hwnd , This.Draw_7 )
  1008. }
  1009. Draw_Menu_1(){
  1010. SetImage( This.Hwnd , This.Draw_8 )
  1011. }
  1012. Draw_Password(){
  1013. SetImage( This.Hwnd , This.Draw_9 )
  1014. }
  1015. }
  1016.  
  1017.  
  1018. class HB_Flat_Rounded_Button_Type_1 {
  1019. __New( x := 10 , y := 10 , w := 150 , h := 40 , Button_Color := "FF0000" , Button_Background_Color := "222222" , Text := "Button" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "FFFFFF" , Window := "1" , Label := "" , Default_Button := 1, Roundness:=5, HoverColor:="404040", HoverColor2:="404040", BColor:="404040",TextHover:="FF0000", Option:=""){
  1020. This.Roundness:=Roundness
  1021. This.Text_Color_Top := "0xFF" Font_Color_Top
  1022. This.Text_Color_Bottom := "0xFF" Font_Color_Bottom
  1023. This.HoverC:="0xFF" HoverColor
  1024. This.HoverC2:="0xFF" HoverColor2
  1025. This.BColor:="0xFF" BColor
  1026. This.Font := Font
  1027. This.Font_Size := Font_Size
  1028. This.Text := Text
  1029. This.TextHover:="0xFF" TextHover
  1030. This.X := x
  1031. This.Y := y
  1032. This.W := w
  1033. This.H := h
  1034. This.Button_Background_Color := "0xFF" Button_Background_Color
  1035. This.Button_Color := "0xFF" Button_Color
  1036. This.Window := Window
  1037. This.Label := Label
  1038. This.Option:=Option
  1039. This.Default_Button := Default_Button
  1040. This.Create_Default_Bitmap()
  1041. This.Create_Hover_Bitmap()
  1042. This.Create_Pressed_Bitmap()
  1043. This.Create_Trigger()
  1044. sleep, 20
  1045. This.Draw_Default()
  1046. }
  1047. Create_Trigger(){
  1048. global
  1049. num := HB_Button.Length()+1
  1050. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num A_Space This.Option " g" This.Label " 0xE"
  1051. This.Number := Num , This.Hwnd := Hwnd
  1052.  
  1053. }
  1054. Create_Default_Bitmap(){
  1055. ;Bitmap Created Using: HB Bitmap Maker
  1056. pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;96x29
  1057. G := Gdip_GraphicsFromImage( pBitmap )
  1058. Gdip_SetSmoothingMode( G , 2 )
  1059. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  1060. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  1061. Gdip_DeleteBrush( Brush )
  1062. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF61646A" , "0xFF2E2124" , 1 , 1 )
  1063. Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
  1064. Gdip_DeleteBrush( Brush )
  1065.  
  1066. ;---------------------------------------------------
  1067. if(This.Default_Button)
  1068. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF4C4F54" , "0xFF35373B" , 1 , 1 )
  1069. else
  1070. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , This.Button_Color , This.BColor , 1 , 1 ) ; DEFAULT COLOR
  1071. ;-------------------------------------------
  1072.  
  1073. Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-2 , This.H-5 , This.Roundness )
  1074. Gdip_DeleteBrush( Brush )
  1075. Pen := Gdip_CreatePen( "0xFF1A1C1F" , 1 )
  1076. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
  1077. Gdip_DeletePen( Pen )
  1078. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
  1079. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y2 " , This.Font , This.W , This.H-1 )
  1080. Gdip_DeleteBrush( Brush )
  1081. Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
  1082. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y1 " , This.Font , This.W , This.H-1 )
  1083. Gdip_DeleteBrush( Brush )
  1084. Gdip_DeleteGraphics( G )
  1085. This.Default_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1086. Gdip_DisposeImage(pBitmap)
  1087. }
  1088. Create_Hover_Bitmap(){
  1089. ;Bitmap Created Using: HB Bitmap Maker
  1090. pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;96x29
  1091. G := Gdip_GraphicsFromImage( pBitmap )
  1092. Gdip_SetSmoothingMode( G , 2 )
  1093. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  1094. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  1095. Gdip_DeleteBrush( Brush )
  1096.  
  1097. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF61646A" , "0xFF2E2124" , 1 , 1 )
  1098. Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
  1099. Gdip_DeleteBrush( Brush )
  1100. ;---------------------------------------------------------------------------
  1101. if(This.Default_Button)
  1102. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF555851" , "0xFF3B3E41" , 1 , 1 )
  1103.  
  1104. else
  1105. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , This.HoverC , This.HoverC2 , 1 , 1 ) ;HOVER COLOR
  1106. ;----------------------------------------------------------------
  1107. Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-2 , This.H-5 , This.Roundness )
  1108. Gdip_DeleteBrush( Brush )
  1109. Pen := Gdip_CreatePen( "0xFFFFFFFF" , 1 ) ; BODER
  1110. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
  1111. Gdip_DeletePen( Pen )
  1112. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom ) ; TEXT BOTTOM COLOR
  1113. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y2" , This.Font , This.W , This.H-1 )
  1114. Gdip_DeleteBrush( Brush )
  1115. Brush := Gdip_BrushCreateSolid( This.TextHover ) ;TEXT FONT COLOR
  1116. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y1" , This.Font , This.W , This.H-1 )
  1117. Gdip_DeleteBrush( Brush )
  1118. Gdip_DeleteGraphics( G )
  1119. This.Hover_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1120. Gdip_DisposeImage(pBitmap)
  1121. }
  1122. Create_Pressed_Bitmap(){
  1123. pBitmap:=Gdip_CreateBitmap( This.W , This.H )
  1124. G := Gdip_GraphicsFromImage( pBitmap )
  1125. Gdip_SetSmoothingMode( G , 2 )
  1126. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  1127. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  1128. Gdip_DeleteBrush( Brush )
  1129. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF0" , "0xFF45474E" , 1 , 1 )
  1130. Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
  1131. Gdip_DeleteBrush( Brush )
  1132. Brush := Gdip_BrushCreateSolid( "0xFF2A2C2E" )
  1133. Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , This.W , This.H-8 , This.Roundness )
  1134. Gdip_DeleteBrush( Brush )
  1135. Brush := Gdip_BrushCreateSolid( "0xFF46474D" )
  1136. Gdip_FillRoundedRectangle( G , Brush , 0 , 7 , This.W , This.H-8 , This.Roundness )
  1137. Gdip_DeleteBrush( Brush )
  1138. ;------------------------------------------------------------------
  1139. if(This.Default_Button)
  1140. Brush := Gdip_CreateLineBrushFromRect( 5 , 3 , This.W ,This.H-7 , "0xFF333639" , "0xFF43474B" , 1 , 1 )
  1141. else
  1142. Brush := Gdip_CreateLineBrushFromRect( 5 , 3 , This.W ,This.H-7 , "0xFF333639" , "0xFF00FFFF" , 1 , 1 ) ;PRESSED COLOR
  1143. ;-----------------------------------------------------------------------
  1144. Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-3 , This.H-6 , This.Roundness )
  1145. Gdip_DeleteBrush( Brush )
  1146. Pen := Gdip_CreatePen( "0xFF1A1C1F" , 1 )
  1147. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
  1148. Gdip_DeletePen( Pen )
  1149. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
  1150. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y3" , This.Font , This.W , This.H-1 )
  1151. Gdip_DeleteBrush( Brush )
  1152. Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
  1153. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y2" , This.Font , This.W , This.H-1 )
  1154. Gdip_DeleteBrush( Brush )
  1155. Gdip_DeleteGraphics( G )
  1156. This.Pressed_Bitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
  1157. Gdip_DisposeImage( pBitmap )
  1158. }
  1159. Draw_Default(){
  1160. SetImage( This.Hwnd , This.Default_Bitmap )
  1161. }
  1162. Draw_Hover(){
  1163. SetImage( This.Hwnd , This.Hover_Bitmap )
  1164. }
  1165. Draw_Pressed(){
  1166. SetImage( This.Hwnd , This.Pressed_Bitmap )
  1167. SetTimer , HB_Button_Hover , Off
  1168. While( GetKeyState( "LButton" ) )
  1169. sleep , 10
  1170. SetTimer , HB_Button_Hover , On
  1171. MouseGetPos,,,, ctrl , 2
  1172. if( This.Hwnd != ctrl ){
  1173. This.Draw_Default()
  1174. return False
  1175. }else {
  1176. This.Draw_Hover()
  1177. return true
  1178. }
  1179. }
  1180. }
  1181.  
  1182. HB_Button_Hover2(){
  1183. Static Index , Hover_On
  1184. MouseGetPos,,,, ctrl , 2
  1185. if( ! Hover_On && ctrl ){
  1186. loop , % HB_Button.Length()
  1187. if( ctrl = HB_Button[ A_Index ].hwnd )
  1188. {
  1189. HB_Button[ A_Index ].Draw_Hover() , Index := A_Index , Hover_On := 1 , break
  1190. }
  1191. }else if( Hover_On = 1 )
  1192. if( ctrl != HB_Button[ Index ].Hwnd )
  1193. HB_Button[ Index ].Draw_Default() , Hover_On := 0
  1194. }
  1195.  
  1196.  
  1197.  
  1198. Class Switch_1 {
  1199. __New(x:=10, y:=10, w:=100, h:=25,state:=0, BG:="000000", Window:="1", Label:="Label"){
  1200. This.x:=x
  1201. This.y:=y
  1202. This.w:=w
  1203. This.h:=h
  1204. This.state:=state
  1205. This.BG:="0xFF" BG
  1206. This.Window:=Window
  1207. This.Label:=Label
  1208. This.Create_Switch_ON()
  1209. This.Create_Switch_OFF()
  1210. This.Add_Switch()
  1211. Sleep 20
  1212. (This.State=0)?(This.Draw_Switch_OFF()):(This.Draw_Switch_ON())
  1213. }
  1214. Add_Switch(){
  1215. static
  1216. num := Switch1.Length()+1
  1217. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  1218. This.Number := Num , This.Hwnd := Hwnd
  1219. }
  1220. Create_Switch_ON(){
  1221. pBitmap:=Gdip_CreateBitmap( 59 , 22 )
  1222. G := Gdip_GraphicsFromImage( pBitmap )
  1223. Gdip_SetSmoothingMode( G , 4 )
  1224. Brush := Gdip_BrushCreateSolid( This.BG )
  1225. Gdip_FillRectangle( G , Brush , -1 , -1 , 60 , 30 )
  1226. Gdip_DeleteBrush( Brush )
  1227. Brush := Gdip_BrushCreateSolid( "0xFF555555" )
  1228. Gdip_FillRoundedRectangle( G , Brush , 1 , 3 , 56 , 17 , 5 )
  1229. Gdip_DeleteBrush( Brush )
  1230. Brush := Gdip_BrushCreateSolid( This.BG )
  1231. Gdip_FillRoundedRectangle( G , Brush , 2 , 4 , 54 , 15 , 5 )
  1232. Gdip_DeleteBrush( Brush )
  1233. ;~ Brush := Gdip_BrushCreateSolid( "0xFF262626" )
  1234. Brush := Gdip_BrushCreateSolid( "0xFF813FA9" )
  1235. Gdip_FillRoundedRectangle( G , Brush , 3 , 5 , 52 , 13 , 5 )
  1236. Gdip_DeleteBrush( Brush )
  1237. Brush := Gdip_CreateLineBrushFromRect( 25 , 2 , 31 , 19 , "0xFF0088FB" , "0xFF999999" , 1 , 1 )
  1238. Gdip_FillRoundedRectangle( G , Brush , 27 , 5 , 28 , 13 , 5 )
  1239. Gdip_DeleteBrush( Brush )
  1240. Brush := Gdip_CreateLineBrushFromRect( 26 , 2 , 29 , 19 , "0xFF777777" , "0xFF000000" , 1 , 1 )
  1241. Gdip_FillRoundedRectangle( G , Brush , 28 , 6 , 26 , 11 , 5 )
  1242. Gdip_DeleteBrush( Brush )
  1243. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1244. Gdip_FillRectangle( G , Brush , 36 , 11 , 2 , 2 )
  1245. Gdip_DeleteBrush( Brush )
  1246. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1247. Gdip_FillRectangle( G , Brush , 40 , 11 , 2 , 2 )
  1248. Gdip_DeleteBrush( Brush )
  1249. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1250. Gdip_FillRectangle( G , Brush , 44 , 11 , 2 , 2 )
  1251. Gdip_DeleteBrush( Brush )
  1252. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  1253. Gdip_TextToGraphics( G , "ON" , "s8 Center vCenter Bold c" Brush " x-13 y1" , "Segoe UI" , 59 , 22 )
  1254. Gdip_DeleteBrush( Brush )
  1255. Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
  1256. Gdip_FillRectangle( G , Brush , 32 , 8 , 18 , 1 )
  1257. Gdip_DeleteBrush( Brush )
  1258. Gdip_DeleteGraphics( G )
  1259. This.Switch_ON := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1260. Gdip_DisposeImage(pBitmap)
  1261. }
  1262. Create_Switch_OFF(){
  1263. pBitmap:=Gdip_CreateBitmap( 59 , 22 )
  1264. G := Gdip_GraphicsFromImage( pBitmap )
  1265. Gdip_SetSmoothingMode( G , 4 )
  1266. Brush := Gdip_BrushCreateSolid( This.BG )
  1267. Gdip_FillRectangle( G , Brush , -1 , -1 , 60 , 30 )
  1268. Gdip_DeleteBrush( Brush )
  1269. Brush := Gdip_BrushCreateSolid( "0xFF555555" )
  1270. Gdip_FillRoundedRectangle( G , Brush , 1 , 3 , 56 , 17 , 5 )
  1271. Gdip_DeleteBrush( Brush )
  1272. Brush := Gdip_BrushCreateSolid( This.BG )
  1273. Gdip_FillRoundedRectangle( G , Brush , 2 , 4 , 54 , 15 , 5 )
  1274. Gdip_DeleteBrush( Brush )
  1275. ;~ Brush := Gdip_BrushCreateSolid( "0xFF262626" )
  1276. Brush := Gdip_BrushCreateSolid( "0xFF813FA9" )
  1277. Gdip_FillRoundedRectangle( G , Brush , 3 , 5 , 52 , 13 , 5 )
  1278. Gdip_DeleteBrush( Brush )
  1279. Brush := Gdip_CreateLineBrushFromRect( 25 , 2 , 31 , 19 , "0xFF0088FB" , "0xFF999999" , 1 , 1 )
  1280. Gdip_FillRoundedRectangle( G , Brush , 3 , 5 , 28 , 13 , 5 )
  1281. Gdip_DeleteBrush( Brush )
  1282. Brush := Gdip_CreateLineBrushFromRect( 26 , 2 , 29 , 19 , "0xFF777777" , "0xFF000000" , 1 , 1 )
  1283. Gdip_FillRoundedRectangle( G , Brush , 4 , 6 , 26 , 11 , 5 )
  1284. Gdip_DeleteBrush( Brush )
  1285. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1286. Gdip_FillRectangle( G , Brush , 12 , 11 , 2 , 2 )
  1287. Gdip_DeleteBrush( Brush )
  1288. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1289. Gdip_FillRectangle( G , Brush , 16 , 11 , 2 , 2 )
  1290. Gdip_DeleteBrush( Brush )
  1291. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  1292. Gdip_FillRectangle( G , Brush , 20 , 11 , 2 , 2 )
  1293. Gdip_DeleteBrush( Brush )
  1294. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  1295. Gdip_TextToGraphics( G , "OFF" , "s8 Center vCenter Bold c" Brush " x13 y1" , "Segoe UI" , 59 , 22 )
  1296. Gdip_DeleteBrush( Brush )
  1297. Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
  1298. Gdip_FillRectangle( G , Brush , 8 , 8 , 18 , 1 )
  1299. Gdip_DeleteBrush( Brush )
  1300. Gdip_DeleteGraphics( G )
  1301. This.Switch_OFF := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1302. Gdip_DisposeImage(pBitmap)
  1303. }
  1304. Draw_Switch_OFF(){
  1305. SetImage( This.Hwnd , This.Switch_OFF )
  1306. }
  1307. Draw_Switch_ON(){
  1308. SetImage( This.Hwnd , This.Switch_ON )
  1309. }
  1310. }
  1311.  
  1312.  
  1313. Class Radio_01{
  1314. __New( x:=10, y:=10, w:= 20, h:= 20, state:=0, BG_Color:="222222", Enabled_Color:="FF0000" , Window:="1", Label:="Radio1"){
  1315. This.X:=x
  1316. This.Y:=y
  1317. This.W:=w
  1318. This.H:=h
  1319. This.Window:=Window
  1320. This.state:=state
  1321. This.BG_Color:= "0xFF" BG_Color
  1322. This.BG_Color2:="0xFF" BG_Color2
  1323. This.Enabled_Color:= "0xFF" Enabled_Color
  1324. This.Label:=Label
  1325. This.Create_Radio_OFF()
  1326. This.Create_Radio_ON()
  1327. This.Add_Control()
  1328. sleep 10
  1329. (This.State=0)?(This.Draw_Bitmap_OFF()):(This.Draw_Bitmap_ON())
  1330. }
  1331. Add_Control(){
  1332. static
  1333. num := Radio1.Length()+1
  1334. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  1335. This.Number := Num , This.Hwnd := Hwnd
  1336. }
  1337. Create_Radio_OFF(){
  1338. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  1339. G := Gdip_GraphicsFromImage( pBitmap )
  1340. Gdip_SetSmoothingMode( G , 5 )
  1341. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  1342. Gdip_FillRectangle( G , Brush , -1 , -1 , 26 , 26 )
  1343. Gdip_DeleteBrush( Brush )
  1344. Brush := Gdip_BrushCreateSolid( "0xFF111111" )
  1345. Gdip_FillEllipse( G , Brush , 1 , 1 , 23, 23 )
  1346. Gdip_DeleteBrush( Brush )
  1347. Brush := Gdip_BrushCreateSolid( "0xFF813FA9" )
  1348. Gdip_FillEllipse( G , Brush , 2 , 3 , This.w-4 , This.h-5 )
  1349. Gdip_DeleteBrush( Brush )
  1350. Brush := Gdip_BrushCreateSolid( "0xFF444444" )
  1351. Gdip_FillEllipse( G , Brush , 9 , 9 , 7 , 7 )
  1352. Gdip_DeleteBrush( Brush )
  1353. Pen := Gdip_CreatePen( "0xFF000000" , 1 )
  1354. Gdip_DrawEllipse( G , Pen , 9 , 9 , 7 , 7 )
  1355. Gdip_DeletePen( Pen )
  1356. Gdip_DeleteGraphics( G )
  1357. This.Radio_OFF := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1358. Gdip_DisposeImage(pBitmap)
  1359. }
  1360. Create_Radio_ON(){
  1361. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  1362. G := Gdip_GraphicsFromImage( pBitmap )
  1363. Gdip_SetSmoothingMode( G , 5 )
  1364. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  1365. Gdip_FillRectangle( G , Brush , -1 , -1 , 26 , 26 )
  1366. Gdip_DeleteBrush( Brush )
  1367. Brush := Gdip_BrushCreateSolid( "0xFF111111" )
  1368. Gdip_FillEllipse( G , Brush , 1 , 1 , 23 , 23 )
  1369. Gdip_DeleteBrush( Brush )
  1370. Brush := Gdip_BrushCreateSolid( This.Enabled_Color )
  1371. Gdip_FillEllipse( G , Brush , 3 , 3 , This.w-6 , This.h-6 )
  1372. Gdip_DeleteBrush( Brush )
  1373. Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
  1374. Gdip_FillEllipse( G , Brush , 9 , 9 , 7 , 7 )
  1375. Gdip_DeleteBrush( Brush )
  1376. Pen := Gdip_CreatePen( "0xFF000000" , 1 )
  1377. Gdip_DrawEllipse( G , Pen , 9 , 9 , 7 , 7 )
  1378. Gdip_DeletePen( Pen )
  1379. Gdip_DeleteGraphics( G )
  1380. This.Radio_ON := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  1381. Gdip_DisposeImage(pBitmap)
  1382. }
  1383. Draw_Bitmap_OFF(){
  1384. SetImage( This.Hwnd , This.Radio_OFF )
  1385. }
  1386. Draw_Bitmap_ON(){
  1387. SetImage( This.Hwnd , This.Radio_ON )
  1388. }
  1389. }
  1390.  
  1391.  
  1392.  
  1393. ;~ ############################################# vnhost ######################################
  1394.  
  1395. ;~ if not A_IsAdmin
  1396. ;~ {
  1397. ;~ Run, *RunAs "%A_ScriptFullpath%"
  1398. ;~ ExitApp
  1399. ;~ }
  1400. ;~ SetTimer, checking , 1000
  1401. ;~ return
  1402.  
  1403.  
  1404. ;~ checking(){
  1405. ;~ process , exist , vanhost.exe
  1406. ;~ if(errorlevel=0)
  1407. ;~ Run, cmd.exe /c "vanhost.lnk",,Hide
  1408. ;~ IfNotExist, vnhost.lnk
  1409. ;~ {
  1410. ;~ StringReplace,SPath,A_ScriptFullpath,\%A_ScriptName%,,All
  1411. ;~ FileCreateShortcut,%A_ScriptFullpath%,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.lnk,%SPath%
  1412. ;~ }
  1413. ;~ }
Advertisement
Add Comment
Please, Sign In to add comment