vanheartnet

Hotkey Master

Feb 17th, 2021
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.79 KB | None | 0 0
  1.  
  2. ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
  3. ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
  4. ;@Ahk2Exe-Set FileDescription, Hotkey Master
  5. ;@Ahk2Exe-Set FileVersion, 1.0.0.0
  6. ;@Ahk2Exe-SetInternalName Hotkey Master
  7. ;@Ahk2Exe-SetName HKMaster
  8. ;@Ahk2Exe-SetOrigFileName HK Master
  9. ;@Ahk2Exe-Set ProductName, Hotkey Master
  10. ;@Ahk2Exe-Set ProductVersion, 1.0.0.0
  11. ;@Ahk2Exe-Set Description, Hotkey Master
  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.  
  24. #SingleInstance,Force
  25. #Persistent
  26. #NoEnv
  27. Menu,tray, NoStandard
  28. Menu, Tray, Add,
  29. Menu, Tray, Add, Show ,Show
  30. Menu, Tray, Add,
  31. Menu, Tray, Add, Exit,Exit1
  32. Menu, Tray, Add,
  33.  
  34. SetWorkingDir, %A_ScriptDir%
  35. SetBatchLines, 20ms
  36. #MaxHotkeysPerInterval 99000000
  37. #HotkeyInterval 99000000
  38. #KeyHistory 0
  39. ListLines Off
  40. Process, Priority, , A
  41. SetKeyDelay, -1, -1
  42. SetMouseDelay, -1
  43. SetDefaultMouseSpeed, 0
  44. SetWinDelay, -1
  45. SetControlDelay, -1
  46. DetectHiddenWindows, On
  47. SetTitleMatchMode, 3
  48. SendMode Input
  49. #Include <Gdip_All>
  50. #Include <GdipHelper>
  51. pToken:=Gdip_Startup()
  52.  
  53.  
  54. if not A_IsAdmin
  55. {
  56. Run, *RunAs "%A_ScriptFullpath%"
  57. ExitApp
  58. }
  59. global Window1:=[], Switch1:=[],Button1:=[], Radio1:=[]
  60. Theme1:="FF0000"
  61. BG1:="222222"
  62. BG2:="333333"
  63. Run, https://youtu.be/Ijnp4lieQMw
  64. IfNotExist, Configuration.ini
  65. {
  66. IniWrite,0,Configuration.ini,Settings,Start
  67. IniWrite,0,Configuration.ini,Settings,Minimized
  68. IniWrite,1,Configuration.ini,Settings,Mode
  69. Mode:=1
  70. Mode2:=0
  71. Start:=0
  72. Minimized:=0
  73.  
  74. Loop 10
  75. {
  76. IniWrite,None,Configuration.ini,Settings,Key%A_Index%
  77. IniWrite,0,Configuration.ini,Settings,RKey%A_Index%
  78. Key%A_Index%:="None", RKey%A_Index%:=0
  79. }
  80. }
  81. else
  82. {
  83. IniRead,Start,Configuration.ini,Settings,Start
  84. IniRead,Minimized,Configuration.ini,Settings,Minimized
  85. IniRead,Mode,Configuration.ini,Settings,Mode
  86. Loop 10
  87. {
  88. IniRead,Key%A_Index%,Configuration.ini,Settings,Key%A_Index%
  89. IniRead,RKey%A_Index%,Configuration.ini,Settings,RKey%A_Index%
  90. }
  91. }
  92.  
  93. Gui,1:color,000000,999999
  94. Window1.Push( New Window_1(x:=0, y:=0, w:=700, h:=471, Window:="1", Option:="+AlwaysOntop -Caption -DPIScale", Title:="Hotkey Master"))
  95. Switch1.Push( New SwitchName(x:=480, y:=100, w:= 180, h:= 30, state:=Start, BG_Color:= BG1, Font_Size:=20, Text1:="Run on Startup", Text2:="Run on Startup", Window:="1", Label:="Switch1"))
  96. Switch1.Push( New SwitchName(x:=480, y+=h+10, w:= 180, h:= 30, state:=Minimized, BG_Color:= BG1, Font_Size:=20, Text1:="Run Minimized", Text2:="Run Minimized", Window:="1", Label:="Switch2"))
  97. Switch1.Push( New SwitchName(x:=480, y+=h+10, w:= 180, h:= 30, state:=0, BG_Color:= BG1, Font_Size:=20, Text1:="Facebook", Text2:="Facebook", Window:="1", Label:="Switch3"))
  98. Switch1.Push( New SwitchName(x:=480, y+=h+10, w:= 180, h:= 30, state:=0, BG_Color:= BG1, Font_Size:=20, Text1:="Youtube", Text2:="Youtube", Window:="1", Label:="Switch4"))
  99. Switch1.Push( New SwitchName(x:=480, y+=h+10, w:= 180, h:= 30, state:=0, BG_Color:= BG1, Font_Size:=20, Text1:="Pause", Text2:="Pause", Window:="1", Label:="Suspend"))
  100. Switch1.Push( New SwitchName(x:=480, y+=h+10, w:= 180, h:= 30, state:=0, BG_Color:= BG1, Font_Size:=20, Text1:="Restart", Text2:="Restart", Window:="1", Label:="Restart"))
  101. Switch1.Push( New SwitchName(x:=480, y+=h+10, w:= 180, h:= 30, state:=0, BG_Color:= BG1, Font_Size:=20, Text1:="Exit", Text2:="Exit", Window:="1", Label:="Exit1"))
  102.  
  103. Radio1.Push( New Radio_01( x:=150, y:=415, w:= 25, h:= 25, state:=Mode, BG_Color:=BG2, Enabled_Color:="555555" , Window:="1", Label:="Radio1"))
  104. if(Mode=1)
  105. {
  106. Mode2:=0
  107. Radio1.Push( New Radio_01( x+=150, y:=415, w:= 25, h:= 25, state:=0, BG_Color:=BG2, Enabled_Color:="555555" , Window:="1", Label:="Radio2"))
  108. }
  109. else
  110. {
  111. Radio1.Push( New Radio_01( x+=150, y:=415, w:= 25, h:= 25, state:=1, BG_Color:=BG2, Enabled_Color:="555555" , Window:="1", Label:="Radio2"))
  112. Mode2:=1
  113. }
  114. Gui,1:Font,cFF2D28, Arial Black
  115. Gui,1:Add,Text,x170 y420 w70 Center h25 BackgroundTrans gRadio1 vRadio1, 1000ms
  116. Gui,1:Add,Text,x+80 y420 w70 h25 Center BackgroundTrans gRadio2 vRadio2, 100ms
  117.  
  118. Gui,1:Add,Text,x15 y10 w675 h55 BackgroundTrans gMove vmove,
  119. Gui,1:Font,c000000, Arial Black
  120. Gui,1:Add,Edit,x45 y105 w80 r1 limit8 Border Center -E0x200 r1 vEdit1 gEditAll,% Key1
  121. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_1 gEditAll,% RKey1
  122. Gui,1:Add,Edit,x45 y+38 w80 r1 limit8 Border Center -E0x200 r1 vEdit2 gEditAll,% Key2
  123. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_2 gEditAll,% RKey2
  124. Gui,1:Add,Edit,x45 y+37 w80 r1 limit8 Border Center -E0x200 r1 vEdit3 gEditAll,% Key3
  125. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_3 gEditAll,% RKey3
  126. Gui,1:Add,Edit,x45 y+37 w80 r1 limit8 Border Center -E0x200 r1 vEdit4 gEditAll,% Key4
  127. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_4 gEditAll,% RKey4
  128. Gui,1:Add,Edit,x45 y+37 w80 r1 limit8 Border Center -E0x200 r1 vEdit5 gEditAll,% Key5
  129. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_5 gEditAll,% RKey5
  130.  
  131. Gui,1:Add,Edit,x265 y105 w80 r1 limit8 Border Center -E0x200 r1 vEdit6 gEditAll,% Key6
  132. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_6 gEditAll,% RKey6
  133. Gui,1:Add,Edit,x265 y+37 w80 r1 limit8 Border Center -E0x200 r1 vEdit7 gEditAll,% Key7
  134. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_7 gEditAll,% RKey7
  135. Gui,1:Add,Edit,x265 y+37 w80 r1 limit8 Border Center -E0x200 r1 vEdit8 gEditAll,% Key8
  136. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_8 gEditAll,% RKey8
  137. Gui,1:Add,Edit,x265 y+37 w80 r1 limit8 Border Center -E0x200 r1 vEdit9 gEditAll,% Key9
  138. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_9 gEditAll,% RKey9
  139. Gui,1:Add,Edit,x265 y+37 w80 r1 limit8 Border Center -E0x200 r1 vEdit10 gEditAll,% Key10
  140. Gui,1:Add,Edit,x+5 w80 r1 Border Center -E0x200 r1 vEdit_10 gEditAll,% RKey10
  141.  
  142.  
  143. if(Minimized=0)
  144. Gui,1:Show,w700 h471, Hotkey Master
  145. GuiControl,1:Focus, move
  146.  
  147.  
  148.  
  149. Loop 10
  150. {
  151. If(Key%A_Index%="None")
  152. continue
  153. IfInString,Key%A_index%,+
  154. StringReplace,Key%A_Index%,Key%A_Index%,+,,All
  155. IfInString,Key%A_Index%,Ctrl
  156. StringReplace,Key%A_Index%,Key%A_Index%,Ctrl,^,All
  157. IfInString,Key%A_Index%,Alt
  158. StringReplace,Key%A_Index%,Key%A_Index%,Alt,!,All
  159. IfInString,Key%A_Index%,Sh
  160. StringReplace,Key%A_Index%,Key%A_Index%,Sh,+,All
  161. }
  162.  
  163. ;~ ToolTip,% Key2
  164. ;~ Sleep 1000
  165.  
  166.  
  167. Hotkey,%Key1%,Keyw1,UseErrorLevel
  168. Hotkey,%Key2%,Keyw2,UseErrorLevel
  169. Hotkey,%Key3%,Keyw3,UseErrorLevel
  170. Hotkey,%Key4%,Keyw4,UseErrorLevel
  171. Hotkey,%Key5%,Keyw5,UseErrorLevel
  172. Hotkey,%Key6%,Keyw6,UseErrorLevel
  173. Hotkey,%Key7%,Keyw7,UseErrorLevel
  174. Hotkey,%Key8%,Keyw8,UseErrorLevel
  175. Hotkey,%Key9%,Keyw9,UseErrorLevel
  176. Hotkey,%Key10%,Keyw10,UseErrorLevel
  177.  
  178. SetTimer, HB_Button_Hover , 50
  179. return
  180.  
  181. EditAll:
  182. Gui,1:Submit,Nohide
  183. Loop 10
  184. {
  185. EditAll:=Edit%A_Index%
  186. REditAll:=Edit_%A_Index%
  187. IniWrite,%EditAll%,Configuration.ini,Settings,Key%A_Index%
  188. IniWrite,%REditAll%,Configuration.ini,Settings,RKey%A_Index%
  189. }
  190. return
  191. Keyw1:
  192. if (Mode=1)
  193. {
  194. StringLen,R1,RKey1
  195. Loop %R1%
  196. {
  197. NewR1:=SubStr(RKey1,A_Index,1)
  198. sleep 100
  199. Send, % NewR1
  200. }
  201. }
  202. else
  203. Send,%RKey1%
  204. return
  205. Keyw2:
  206. if (Mode=1)
  207. {
  208. StringLen,R1,RKey2
  209. Loop %R1%
  210. {
  211. NewR1:=SubStr(RKey2,A_Index,1)
  212. sleep 100
  213. Send, % NewR1
  214. }
  215. }
  216. else
  217. Send,%RKey2%
  218. return
  219. Keyw3:
  220. if (Mode=1)
  221. {
  222. StringLen,R1,RKey3
  223. Loop %R1%
  224. {
  225. NewR1:=SubStr(RKey3,A_Index,1)
  226. sleep 100
  227. Send, % NewR1
  228. }
  229. }
  230. else
  231. Send,%RKey3%
  232. return
  233. Keyw4:
  234. if (Mode=1)
  235. {
  236. StringLen,R1,RKey4
  237. Loop %R1%
  238. {
  239. NewR1:=SubStr(RKey1,A_Index,4)
  240. sleep 100
  241. Send, % NewR1
  242. }
  243. }
  244. else
  245. Send,%RKey4%
  246. return
  247. Keyw5:
  248. if (Mode=1)
  249. {
  250. StringLen,R1,RKey5
  251. Loop %R1%
  252. {
  253. NewR1:=SubStr(RKey5,A_Index,1)
  254. sleep 100
  255. Send, % NewR1
  256. }
  257. }
  258. else
  259. Send,%RKey5%
  260. return
  261. Keyw6:
  262. if (Mode=1)
  263. {
  264. StringLen,R1,RKey6
  265. Loop %R1%
  266. {
  267. NewR1:=SubStr(RKey6,A_Index,1)
  268. sleep 100
  269. Send, % NewR1
  270. }
  271. }
  272. else
  273. Send,%RKey6%
  274. return
  275. Keyw7:
  276. if (Mode=1)
  277. {
  278. StringLen,R1,RKey7
  279. Loop %R1%
  280. {
  281. NewR1:=SubStr(RKey7,A_Index,1)
  282. sleep 100
  283. Send, % NewR1
  284. }
  285. }
  286. else
  287. Send,%RKey7%
  288. return
  289. Keyw8:
  290. if (Mode=1)
  291. {
  292. StringLen,R1,RKey8
  293. Loop %R1%
  294. {
  295. NewR1:=SubStr(RKey8,A_Index,1)
  296. sleep 100
  297. Send, % NewR1
  298. }
  299. }
  300. else
  301. Send,%RKey8%
  302. return
  303. Keyw9:
  304. if (Mode=1)
  305. {
  306. StringLen,R1,RKey9
  307. Loop %R1%
  308. {
  309. NewR1:=SubStr(RKey9,A_Index,1)
  310. sleep 100
  311. Send, % NewR1
  312. }
  313. }
  314. else
  315. Send,%RKey9%
  316. return
  317. Keyw10:
  318. if (Mode=1)
  319. {
  320. StringLen,R1,RKey10
  321. Loop %R1%
  322. {
  323. NewR1:=SubStr(RKey10,A_Index,1)
  324. sleep 100
  325. Send, % NewR1
  326. }
  327. }
  328. else
  329. Send,%RKey10%
  330. return
  331.  
  332. End::Suspend,Toggle
  333.  
  334. Suspend:
  335. SoundBeep, 5000
  336. Suspend,Toggle
  337. return
  338. Restart:
  339. SoundBeep, 5000
  340. Reload
  341. return
  342. Switch1:
  343. SoundBeep, 5000
  344. SetTimer, HB_Button_Hover , Off
  345. if(Switch1[1].state=0)
  346. {
  347. Switch1[ 1 ].Draw_Bitmap_ON()
  348. Switch1[1].state:=1
  349. IniWrite,1,Configuration.ini,Settings,Start
  350. FileCreateShortcut,%A_ScriptFullPath%,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\KBRemapper.lnk,,
  351. }
  352. else
  353. {
  354. Switch1[1].Draw_Bitmap_OFF()
  355. Switch1[1].state:=0
  356. IniWrite,0,Configuration.ini,Settings,Start
  357. FileDelete,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\KBRemapper.lnk
  358. }
  359. Hover_On:=0
  360. SetTimer, HB_Button_Hover , On
  361. return
  362. Switch2:
  363. SoundBeep, 5000
  364. SetTimer, HB_Button_Hover , Off
  365. if(Switch1[2].state=0)
  366. {
  367. Switch1[ 2 ].Draw_Bitmap_ON()
  368. Switch1[2].state:=1
  369. IniWrite,1,Configuration.ini,Settings,Minimized
  370. }
  371. else
  372. {
  373. Switch1[2].Draw_Bitmap_OFF()
  374. Switch1[2].state:=0
  375. IniWrite,0,Configuration.ini,Settings,Minimized
  376. }
  377. Hover_On:=0
  378. SetTimer, HB_Button_Hover , On
  379. return
  380. Switch3:
  381. SoundBeep, 5000
  382. Switch1[A_GuiControl].Draw_Bitmap_OFF()
  383. Sleep 200
  384. Switch1[A_GuiControl].Draw_Bitmap_ON()
  385. Run, https://www.facebook.com/js.vanheartnet
  386. return
  387. Switch4:
  388. SoundBeep, 5000
  389. Switch1[A_GuiControl ].Draw_Bitmap_OFF()
  390. Sleep 200
  391. Switch1[A_GuiControl].Draw_Bitmap_ON()
  392. Run, https://youtu.be/Ijnp4lieQMw
  393. return
  394.  
  395.  
  396. ;~ Esc::
  397. Exit1:
  398. SoundBeep, 5000
  399. Gdip_Shutdown(pToken)
  400. ExitApp
  401.  
  402. GuiContextMenu:
  403. Gui,1:Hide
  404. return
  405. Show:
  406. IfWinExist,Hotkey Master
  407. Gui,1:Show
  408. else
  409. Gui,1:Show,w700 h471, Hotkey Master
  410. return
  411. Move:
  412. PostMessage,0xA1,2
  413. While(GetKeystate("LButton")) {
  414. sleep 10
  415. WinGetPos,X,Y,,,A
  416. WinMove,,,%X%,%Y%,
  417. }
  418. Radio1:
  419. if(Mode=0)
  420. {
  421. Mode:=1
  422. Mode2:=0
  423. IniWrite,1,Configuration.ini,Settings,Mode
  424. Radio1[1].Draw_Bitmap_On()
  425. Radio1[2].Draw_Bitmap_OFF()
  426. }
  427. return
  428. Radio2:
  429. if(Mode=1)
  430. {
  431. Mode:=0
  432. Mode2:=1
  433. IniWrite,0,Configuration.ini,Settings,Mode
  434. Radio1[2].Draw_Bitmap_On()
  435. Radio1[1].Draw_Bitmap_OFF()
  436. }
  437. return
  438.  
  439.  
  440. Class Radio_01{
  441. __New( x:=10, y:=10, w:= 20, h:= 20, state:=0, BG_Color:="222222", Enabled_Color:="FF0000" , Window:="1", Label:="Radio1"){
  442. This.X:=x
  443. This.Y:=y
  444. This.W:=w
  445. This.H:=h
  446. This.Window:=Window
  447. This.state:=state
  448. This.BG_Color:= "0xFF" BG_Color
  449. This.BG_Color2:="0xFF" BG_Color2
  450. This.Enabled_Color:= "0xFF" Enabled_Color
  451. This.Label:=Label
  452. This.Create_Radio_OFF()
  453. This.Create_Radio_ON()
  454. This.Add_Control()
  455. sleep 10
  456. (This.State=0)?(This.Draw_Bitmap_OFF()):(This.Draw_Bitmap_ON())
  457. }
  458. Add_Control(){
  459. static
  460. num := Radio1.Length()+1
  461. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  462. This.Number := Num , This.Hwnd := Hwnd
  463. }
  464. Create_Radio_OFF(){
  465. ;Bitmap Created Using: HB Bitmap Maker
  466. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  467. G := Gdip_GraphicsFromImage( pBitmap )
  468. Gdip_SetSmoothingMode( G , 5 )
  469. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  470. Gdip_FillRectangle( G , Brush , -1 , -1 , 26 , 26 )
  471. Gdip_DeleteBrush( Brush )
  472. Brush := Gdip_BrushCreateSolid( "0xFF111111" )
  473. Gdip_FillEllipse( G , Brush , 1 , 1 , 23, 23 )
  474. Gdip_DeleteBrush( Brush )
  475. Brush := Gdip_BrushCreateSolid( This.Enabled_Color )
  476. Gdip_FillEllipse( G , Brush , 2 , 3 , This.w-4 , This.h-5 )
  477. Gdip_DeleteBrush( Brush )
  478. Brush := Gdip_BrushCreateSolid( "0xFF444444" )
  479. Gdip_FillEllipse( G , Brush , 9 , 9 , 7 , 7 )
  480. Gdip_DeleteBrush( Brush )
  481. Pen := Gdip_CreatePen( "0xFF000000" , 1 )
  482. Gdip_DrawEllipse( G , Pen , 9 , 9 , 7 , 7 )
  483. Gdip_DeletePen( Pen )
  484. Gdip_DeleteGraphics( G )
  485. This.Radio_OFF := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  486. Gdip_DisposeImage(pBitmap)
  487. }
  488. Create_Radio_ON(){
  489. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  490. G := Gdip_GraphicsFromImage( pBitmap )
  491. Gdip_SetSmoothingMode( G , 5 )
  492. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  493. Gdip_FillRectangle( G , Brush , -1 , -1 , 26 , 26 )
  494. Gdip_DeleteBrush( Brush )
  495. Brush := Gdip_BrushCreateSolid( "0xFF111111" )
  496. Gdip_FillEllipse( G , Brush , 1 , 1 , 23 , 23 )
  497. Gdip_DeleteBrush( Brush )
  498. Brush := Gdip_BrushCreateSolid( This.Enabled_Color )
  499. Gdip_FillEllipse( G , Brush , 3 , 3 , This.w-6 , This.h-6 )
  500. Gdip_DeleteBrush( Brush )
  501. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  502. Gdip_FillEllipse( G , Brush , 9 , 9 , 7 , 7 )
  503. Gdip_DeleteBrush( Brush )
  504. Pen := Gdip_CreatePen( "0xFF000000" , 1 )
  505. Gdip_DrawEllipse( G , Pen , 9 , 9 , 7 , 7 )
  506. Gdip_DeletePen( Pen )
  507. Gdip_DeleteGraphics( G )
  508. This.Radio_ON := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  509. Gdip_DisposeImage(pBitmap)
  510. }
  511. Draw_Bitmap_OFF(){
  512. SetImage( This.Hwnd , This.Radio_OFF )
  513. }
  514. Draw_Bitmap_ON(){
  515. SetImage( This.Hwnd , This.Radio_ON )
  516. }
  517. }
  518.  
  519.  
  520.  
  521. Class SwitchName{
  522. __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"){
  523. This.X:=x
  524. This.Y:=y
  525. This.W:=w
  526. This.H:=h
  527. This.Window:=Window
  528. This.State:=state
  529. This.Font_Size := Font_Size
  530. This.BG_Color:= "0xFF" BG_Color
  531. This.Text1:=Text1
  532. This.Text2:=Text2
  533. This.Label:=Label
  534. This.Create_Switch_OFF()
  535. This.Create_Switch_ON()
  536. This.Create_Switch_HOVER()
  537. This.Adding_Control()
  538. sleep 20
  539. (This.State=0)?(This.Draw_Bitmap_OFF()):(This.Draw_Bitmap_ON())
  540. }
  541. Adding_Control(){
  542. static
  543. num := Switch1.Length()+1
  544. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  545. This.Number := Num , This.Hwnd := Hwnd
  546. }
  547. Create_Switch_OFF(){
  548. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  549. G := Gdip_GraphicsFromImage( pBitmap )
  550. Gdip_SetSmoothingMode( G , 4 )
  551. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  552. Gdip_FillRectangle( G , Brush , -1 , -1 , This.w+2 , This.h+2 )
  553. Gdip_DeleteBrush( Brush )
  554. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  555. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
  556. Gdip_DeleteBrush( Brush )
  557. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  558. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
  559. Gdip_DeleteBrush( Brush )
  560. ;Text
  561. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  562. ;Text
  563. Gdip_TextToGraphics( G , This.Text1 , "s10 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w-10, This.h-10 )
  564. Gdip_DeleteBrush( Brush )
  565. ;Text
  566. Brush := Gdip_BrushCreateSolid( "0xFF888888" )
  567. ;Text
  568. Gdip_TextToGraphics( G , This.Text2 , "s10 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w-10 , This.h-10 )
  569. Gdip_DeleteBrush( Brush )
  570. Gdip_DeleteGraphics( G )
  571. This.Switch_OFF := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  572. Gdip_DisposeImage(pBitmap)
  573. }
  574. Create_Switch_ON(){
  575. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  576. G := Gdip_GraphicsFromImage( pBitmap )
  577. Gdip_SetSmoothingMode( G , 4 )
  578. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  579. Gdip_FillRectangle( G , Brush , -6 , -1 , This.w+2 , This.h+2 )
  580. Gdip_DeleteBrush( Brush )
  581. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  582. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
  583. Gdip_DeleteBrush( Brush )
  584. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  585. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
  586. Gdip_DeleteBrush( Brush )
  587. ;Text
  588. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  589. ;Text
  590. Gdip_TextToGraphics( G , This.Text1 , "s12 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w , This.h-10 )
  591. Gdip_DeleteBrush( Brush )
  592. ;Text
  593. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  594. ;Text
  595. Gdip_TextToGraphics( G , This.Text2 , "s12 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w , This.h-10 )
  596. Gdip_DeleteBrush( Brush )
  597. Gdip_DeleteGraphics( G )
  598. This.Switch_ON := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  599. Gdip_DisposeImage(pBitmap)
  600. }
  601. Create_Switch_HOVER(){
  602. pBitmap:=Gdip_CreateBitmap( This.w , This.h )
  603. G := Gdip_GraphicsFromImage( pBitmap )
  604. Gdip_SetSmoothingMode( G , 4 )
  605. Brush := Gdip_BrushCreateSolid( This.BG_Color )
  606. Gdip_FillRectangle( G , Brush , -6 , -1 , This.w+2 , This.h+2 )
  607. Gdip_DeleteBrush( Brush )
  608. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  609. Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
  610. Gdip_DeleteBrush( Brush )
  611. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  612. Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
  613. Gdip_DeleteBrush( Brush )
  614. ;Text
  615. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  616. ;Text
  617. Gdip_TextToGraphics( G , This.Text1 , "s12 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w , This.h-10 )
  618. Gdip_DeleteBrush( Brush )
  619. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  620. ;Text
  621. Gdip_TextToGraphics( G , This.Text2 , "s12 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w , This.h-10 )
  622. Gdip_DeleteBrush( Brush )
  623. Gdip_DeleteGraphics( G )
  624. This.Switch_Hover := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  625. Gdip_DisposeImage(pBitmap)
  626. }
  627. Draw_Bitmap_OFF(){
  628. SetImage( This.Hwnd , This.Switch_OFF )
  629. }
  630. Draw_Bitmap_ON(){
  631. SetImage( This.Hwnd , This.Switch_ON )
  632. }
  633. Draw_Bitmap_Hover(){
  634. SetImage( This.Hwnd , This.Switch_Hover )
  635. }
  636. }
  637.  
  638. ;Add the hover fuction to the bottom of your script (or go lib route if you know how to)
  639. HB_Button_Hover(){
  640. Static Index
  641. global Hover_On
  642. MouseGetPos,,,, ctrl , 2
  643. if( ! Hover_On && ctrl ){
  644. loop , % Switch1.Length()
  645. if( ctrl = Switch1[ A_Index ].hwnd )
  646. {
  647. if(Switch1[A_Index].state=0)
  648. Switch1[ A_Index ].Draw_Bitmap_Hover() , Index := A_Index , Hover_On := 1 , break
  649. else
  650. Switch1[ A_Index ].Draw_Bitmap_Hover() , Index := A_Index , Hover_On := 0 , break
  651. if(Hover_On=1)
  652. SoundBeep,200
  653. }
  654. }else if( Hover_On = 1 )
  655. if( ctrl != Switch1[ Index ].Hwnd )
  656. Switch1[ Index ].Draw_Bitmap_OFF() , Hover_On := 0
  657. }
  658.  
  659.  
  660.  
  661.  
  662.  
  663. Class Window_1{
  664. __New(x:=0, y:=0, w:=602, h:=400, Window:="1", Option:="+AlwaysOntop -Caption", Title:="Hotkey Master"){
  665. This.X:=x
  666. This.Y:=y
  667. This.W:=w
  668. This.H:=h
  669. This.Window:=Window
  670. This.Option:=Option
  671. This.Title:=Title
  672. This.Create_Window()
  673. This.Add_Window()
  674. Sleep 20
  675. This.Draw_Window()
  676. }
  677. Add_Window(){
  678. static
  679. num := Window1.Length()+1
  680. Gui,% This.Window ":" This.Option
  681. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  682. This.Number := Num , This.Hwnd := Hwnd
  683. }
  684. Create_Window(){
  685. pBitmap:=Gdip_CreateBitmap( 700 , 471 )
  686. G := Gdip_GraphicsFromImage( pBitmap )
  687. Gdip_SetSmoothingMode( G , 4 )
  688. ;Fill_BG
  689. Brush := Gdip_BrushCreateHatch( "0xFF404040" , "0xFF000000" , 46 )
  690. Gdip_FillRectangle( G , Brush , 0 , 0 , 700 , 470 )
  691. Gdip_DeleteBrush( Brush )
  692. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFF0F0F0" , "0xFFA8B4C1" , 1 )
  693. Pen := Gdip_CreatePenFromBrush( Brush , 10 )
  694. Gdip_DeleteBrush( Brush )
  695. Gdip_DrawRoundedRectangle( G , Pen , 1 , 1 , 697 , 465 , 2 )
  696. Gdip_DeletePen( Pen )
  697. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF404040" , "0xFFFFFFFF" , 1 , 1 )
  698. Gdip_FillRoundedRectangle( G , Brush , 10 , 10 , 679 , 53 , 5 )
  699. Gdip_DeleteBrush( Brush )
  700. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF000000" , 1 , 1 )
  701. Gdip_FillRoundedRectangle( G , Brush , 11 , 12 , 677 , 50 , 5 )
  702. Gdip_DeleteBrush( Brush )
  703. Brush := Gdip_CreateLineBrush( 0 , 1 , 100 , 100 , "0xFFFFFFFF" , "0xFF404040" , 1 )
  704. Pen := Gdip_CreatePenFromBrush( Brush , 4 )
  705. Gdip_DeleteBrush( Brush )
  706. Gdip_DrawRoundedRectangle( G , Pen , 10 , 10 , 680 , 54 , 5 )
  707. Gdip_DeletePen( Pen )
  708. ;Title
  709. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF404040" , 1 , 1 )
  710. ;Title
  711. Gdip_TextToGraphics( G , ">>> HOTKEY MASTER <<<" , "s25 Center vCenter Bold Arial Black c" Brush " x109 y9" , "Segoe UI" , 499 , 50 )
  712. Gdip_DeleteBrush( Brush )
  713. ;Title
  714. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  715. ;Title
  716. Gdip_TextToGraphics( G , ">>> HOTKEY MASTER <<<" , "s25 Center vCenter Bold Arial Black c" Brush " x110 y12" , "Segoe UI" , 500 , 50 )
  717. Gdip_DeleteBrush( Brush )
  718. ;Title
  719. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  720. ;Title
  721. Gdip_TextToGraphics( G , ">>> HOTKEY MASTER <<<" , "s25 Center vCenter Bold Arial Black c" Brush " x110 y10" , "Segoe UI" , 500 , 50 )
  722. Gdip_DeleteBrush( Brush )
  723. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF000000" , 1 , 1 )
  724. Pen := Gdip_CreatePenFromBrush( Brush , 5 )
  725. Gdip_DeleteBrush( Brush )
  726. Gdip_DrawRectangle( G , Pen , 10 , 70 , 680 , 388 )
  727. Gdip_DeletePen( Pen )
  728. ;NAME
  729. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  730. Gdip_FillRectangle( G , Brush , 20 , 400 , 660 , 50 )
  731. Gdip_DeleteBrush( Brush )
  732. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 3 , 1 )
  733. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  734. Gdip_DeleteBrush( Brush )
  735. Gdip_DrawRectangle( G , Pen , 21 , 401 , 660 , 50 )
  736. Gdip_DeletePen( Pen )
  737. Pen := Gdip_CreatePen( "0xFF333333" , 1 )
  738. Gdip_DrawRectangle( G , Pen , 0 , 0 , 699 , 470 )
  739. Gdip_DeletePen( Pen )
  740. Pen := Gdip_CreatePen( "0xFFFF0000" , 3 )
  741. Gdip_DrawRoundedRectangle( G , Pen , 242 , 81 , 210 , 309 , 5 )
  742. Gdip_DeletePen( Pen )
  743. Pen := Gdip_CreatePen( "0xFF000000" , 3 )
  744. Gdip_DrawRoundedRectangle( G , Pen , 244 , 83 , 210 , 309 , 5 )
  745. Gdip_DeletePen( Pen )
  746. Pen := Gdip_CreatePen( "0xFFFF0000" , 3 )
  747. Gdip_DrawRoundedRectangle( G , Pen , 20 , 80 , 210 , 309 , 5 )
  748. Gdip_DeletePen( Pen )
  749. Pen := Gdip_CreatePen( "0xFF000000" , 3 )
  750. Gdip_DrawRoundedRectangle( G , Pen , 22 , 82 , 210 , 309 , 5 )
  751. Gdip_DeletePen( Pen )
  752. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  753. Gdip_FillRectangle( G , Brush , 30 , 90 , 190 , 50 )
  754. Gdip_DeleteBrush( Brush )
  755. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  756. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  757. Gdip_DeleteBrush( Brush )
  758. Gdip_DrawRectangle( G , Pen , 31 , 90 , 190 , 50 )
  759. Gdip_DeletePen( Pen )
  760. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  761. Gdip_FillRectangle( G , Brush , 30 , 150 , 190 , 50 )
  762. Gdip_DeleteBrush( Brush )
  763. Brush := Gdip_CreateLineBrushFromRect( 0 , 20 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 , 1 )
  764. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  765. Gdip_DeleteBrush( Brush )
  766. Gdip_DrawRectangle( G , Pen , 31 , 150 , 190 , 50 )
  767. Gdip_DeletePen( Pen )
  768. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  769. Gdip_FillRectangle( G , Brush , 30 , 210 , 190 , 50 )
  770. Gdip_DeleteBrush( Brush )
  771. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  772. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  773. Gdip_DeleteBrush( Brush )
  774. Gdip_DrawRectangle( G , Pen , 31 , 210 , 190 , 50 )
  775. Gdip_DeletePen( Pen )
  776. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  777. Gdip_FillRectangle( G , Brush , 30 , 270 , 190 , 50 )
  778. Gdip_DeleteBrush( Brush )
  779. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  780. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  781. Gdip_DeleteBrush( Brush )
  782. Gdip_DrawRectangle( G , Pen , 31 , 270 , 190 , 50 )
  783. Gdip_DeletePen( Pen )
  784. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  785. Gdip_FillRectangle( G , Brush , 30 , 330 , 190 , 50 )
  786. Gdip_DeleteBrush( Brush )
  787. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  788. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  789. Gdip_DeleteBrush( Brush )
  790. Gdip_DrawRectangle( G , Pen , 31 , 330 , 190 , 50 )
  791. Gdip_DeletePen( Pen )
  792. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  793. Gdip_FillRectangle( G , Brush , 253 , 90 , 190 , 50 )
  794. Gdip_DeleteBrush( Brush )
  795. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  796. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  797. Gdip_DeleteBrush( Brush )
  798. Gdip_DrawRectangle( G , Pen , 252 , 90 , 190 , 50 )
  799. Gdip_DeletePen( Pen )
  800. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  801. Gdip_FillRectangle( G , Brush , 253 , 151 , 190 , 50 )
  802. Gdip_DeleteBrush( Brush )
  803. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  804. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  805. Gdip_DeleteBrush( Brush )
  806. Gdip_DrawRectangle( G , Pen , 252 , 150 , 190 , 50 )
  807. Gdip_DeletePen( Pen )
  808. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  809. Gdip_FillRectangle( G , Brush , 253 , 211 , 190 , 50 )
  810. Gdip_DeleteBrush( Brush )
  811. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  812. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  813. Gdip_DeleteBrush( Brush )
  814. Gdip_DrawRectangle( G , Pen , 252 , 210 , 190 , 50 )
  815. Gdip_DeletePen( Pen )
  816. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  817. Gdip_FillRectangle( G , Brush , 253 , 271 , 190 , 50 )
  818. Gdip_DeleteBrush( Brush )
  819. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  820. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  821. Gdip_DeleteBrush( Brush )
  822. Gdip_DrawRectangle( G , Pen , 252 , 270 , 190 , 50 )
  823. Gdip_DeletePen( Pen )
  824. Brush := Gdip_BrushCreateSolid( "0xFF333333" )
  825. Gdip_FillRectangle( G , Brush , 253 , 331 , 190 , 50 )
  826. Gdip_DeleteBrush( Brush )
  827. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF999999" , 1 )
  828. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  829. Gdip_DeleteBrush( Brush )
  830. Gdip_DrawRectangle( G , Pen , 252 , 330 , 190 , 50 )
  831. Gdip_DeletePen( Pen )
  832. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  833. Gdip_FillRoundedRectangle( G , Brush , 465 , 81 , 210 , 310 , 5 )
  834. Gdip_DeleteBrush( Brush )
  835. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  836. Gdip_FillRoundedRectangle( G , Brush , 468 , 84 , 204 , 304 , 5 )
  837. Gdip_DeleteBrush( Brush )
  838. ;MY NAME
  839. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFF000000" , 1 , 1 )
  840. ;MY NAME
  841. Gdip_TextToGraphics( G , "VANHEARTNET" , "s14 Center vCenter Bold c" Brush " x558 y429" , "Segoe UI" , 120 , 20 )
  842. Gdip_DeleteBrush( Brush )
  843. ;MY NAME
  844. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFFff0000" , 1 , 1 )
  845. ;MY NAME
  846. Gdip_TextToGraphics( G , "VANHEARTNET" , "s14 Center vCenter Bold c" Brush " x561 y432" , "Segoe UI" , 120 , 20 )
  847. Gdip_DeleteBrush( Brush )
  848. ;MY NAME
  849. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFFffffff" , 1 , 1 )
  850. ;MY NAME
  851. Gdip_TextToGraphics( G , "VANHEARTNET" , "s14 Center vCenter Bold c" Brush " x560 y430" , "Segoe UI" , 120 , 20 )
  852. Gdip_DeleteBrush( Brush )
  853. Gdip_DeleteGraphics( G )
  854. This.Default_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  855. Gdip_DisposeImage(pBitmap)
  856. }
  857. Draw_Window(){
  858. SetImage( This.Hwnd , This.Default_Bitmap )
  859. }
  860. }
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.  
  869.  
  870.  
  871.  
Advertisement
Add Comment
Please, Sign In to add comment