vanheartnet

Gdip Multi-Window

Aug 26th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.77 KB | None | 0 0
  1. ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
  2. ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
  3. ;@Ahk2Exe-Set FileDescription, AHK Dock
  4. ;@Ahk2Exe-Set FileVersion, 1.0.0.0
  5. ;@Ahk2Exe-SetInternalName AHK Dock
  6. ;@Ahk2Exe-SetName GPoints AHK Dock
  7. ;@Ahk2Exe-SetOrigFileName AHK Dock
  8. ;@Ahk2Exe-Set ProductName, AHK Menu Launcher
  9. ;@Ahk2Exe-Set ProductVersion, 1.0.0.0
  10. ;@Ahk2Exe-Set Description, AHK Dock
  11. ;@Ahk2Exe-Set Comments, Software Created by : VANHEARTNET
  12.  
  13.  
  14.  
  15. #SingleInstance,Force
  16. #Persistent
  17. #NoEnv
  18. Menu,tray, NoStandard
  19. Menu,Tray,Add,Exit
  20. SetWorkingDir %A_ScriptDir%
  21. SetBatchLines, -1
  22. #MaxHotkeysPerInterval 99000000
  23. #HotkeyInterval 99000000
  24. #KeyHistory 0
  25. ListLines Off
  26. Process, Priority, , A
  27. SetKeyDelay, -1, -1
  28. SetMouseDelay, -1
  29. SetDefaultMouseSpeed, 0
  30. SetWinDelay, -1
  31. SetControlDelay, -1
  32. SendMode Input
  33. #Include <Gdip_All>
  34. #Include <GdipHelper>
  35. pToken:=Gdip_Startup()
  36. SetRegView, 64
  37.  
  38.  
  39.  
  40.  
  41. global Window:=[], Switch:=[], HB_Button:=[]
  42. Gui,1:Color,222222
  43.  
  44. Window.Push( New Window_1( x:=2, y:=2, w:=596, h:=388, Window:=1, Option:="-DPIScale +AlwaysOntop -Caption", Title:="Sample Window"))
  45. Window.Push( New Window_1( x:=2, y:=2, w:=596, h:=388, Window:=2, Option:="-DPIScale +AlwaysOntop -Caption", Title:="Sample Window2"))
  46. Window.Push( New Window_1( x:=2, y:=2, w:=596, h:=388, Window:=3, Option:="-DPIScale +AlwaysOntop -Caption", Title:="Sample Window3"))
  47.  
  48. Switch.Push( New SWITCH_1( x:=280, y:=45, w:= 100, h:= 30, state:=0, BG_Color:="222222", Switch_BG_Color:="333333", Switch_F_Color:="FF0000", Switch_Border:="FF0000" , Switch_Border2:="00FF00", Text_Color3:="FF0000", Font_Size:=14 , Text1:="OFF", Text2:="ON", Text_Color1:="FFFF00", Text_Color2:="FF0000",Window:="1", Label:="SwitchC"))
  49.  
  50. HB_Button.Push( New HB_Flat_Rounded_Button_Type_1( x:= 40 , y:=110 , w := 174 , h := 50 , Button_Color := "0AD7FF" , Button_Background_Color := "222222" , Text := "BROWSE LOGO" , Font := "Arial" , Font_Size := 14 " Bold" , Font_Color_Top := "FF0000" , Font_Color_Bottom := "000000" , Window := "1" , Label := "BTN1" , Default_Button := 0 , Roundness:=8, HoverColor:="ff0000", HoverColor2:="404040",BColor:="404040",TextHover:="FFFF00") )
  51.  
  52. HB_Button.Push( New HB_Flat_Rounded_Button_Type_1( x:= 40 , y+=60 , w := 174 , h := 50 , Button_Color := "0AD7FF" , Button_Background_Color := "222222" , Text := "CHANGE NAME" , Font := "Arial" , Font_Size := 14 " Bold" , Font_Color_Top := "FF00FF" , Font_Color_Bottom := "000000" , Window := "1" , Label := "BTN2" , Default_Button := 0 , Roundness:=8, HoverColor:="ff0000", HoverColor2:="404040",BColor:="404040",TextHover:="FFFF00") )
  53.  
  54. HB_Button.Push( New HB_Flat_Rounded_Button_Type_1( x:= 40 , y+=60 , w := 174 , h := 50 , Button_Color := "0AD7FF" , Button_Background_Color := "222222" , Text := "SAVE CHANGES" , Font := "Arial" , Font_Size := 14 " Bold" , Font_Color_Top := "0000FF" , Font_Color_Bottom := "000000" , Window := "1" , Label := "BTN3" , Default_Button := 0 , Roundness:=8, HoverColor:="ff0000", HoverColor2:="404040",BColor:="404040",TextHover:="FFFF00") )
  55.  
  56.  
  57. Gui,1:Add,Text,x10 y20 w220 h50 gMove BackgroundTrans,
  58. Gui,1:Font, cWhite s10 Bold, Times New Roman
  59. Gui,1:Add,Text,x390 y52 w200 r1 BackgroundTrans, AUTO DISPLAY LOGO
  60.  
  61.  
  62. Gui,1:Font,
  63. Gui,1:Font, cBlack s16, Impact
  64. Gui,1:Add,Text,x50 y26 w150 r1 Center BackgroundTrans, WIN CHANGER
  65.  
  66. Gui,1:Font,
  67. Gui,1:Font, cYellow s16, Impact
  68. Gui,1:Add,Text,x52 y28 w150 r1 Center BackgroundTrans, WIN CHANGER
  69.  
  70. Gui,1:Font,
  71. Gui,1:Font, cLime s8 Bold,
  72. Gui,1:Add,Text,x300 y10 w300 r1 BackgroundTrans, - - V A N H E A R T N E T - -
  73. Gui,1:Add,Picture, x300 y120 w200 h200 vOEMLogo Border,
  74.  
  75.  
  76.  
  77.  
  78. Gui,1:Show,,Sample Window
  79. SetTimer,HB_Button_Hover,50
  80. return
  81.  
  82. BTN1:
  83. ;-----------------------------------------------------
  84. ; In the button label, add the focus grab line
  85.  
  86. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  87. ; Add the button press function call and test
  88. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  89. return
  90. Gui,2:Submit,Nohide
  91. SoundBeep, 2000
  92. ;----------------------------------------------
  93. Gui,1:+Owndialogs
  94. FileSelectFile,File,,,,All Files 120x120 (*.*)
  95. if (Errorlevel=0){
  96. FileCopy,% File, C:\Windows\OEMLogo.bmp,1
  97. if (state=1)
  98. GuiControl,1:,OEMLogo,C:\Windows\OEMLogo.bmp
  99. ;~ RegRead,RegLogo,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation,Logo
  100. ;~ RegDelete,HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation,Logo
  101. ;~ If(Errorlevel=1)
  102. RegWrite,REG_SZ,HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation,Logo,C:\Windows\OEMLogo.bmp
  103. ;~ else{
  104. ;~ RegDelete,HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows\CurrentVersion\OEMInformation,Logo
  105. ;~ MsgBox, Existed
  106. ;~ }
  107. ;~ MsgBox,% RegLogo
  108.  
  109.  
  110.  
  111. }else
  112. return
  113. return
  114.  
  115. BTN2:
  116. ;-----------------------------------------------------
  117. ; In the button label, add the focus grab line
  118.  
  119. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  120. ; Add the button press function call and test
  121. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  122. return
  123. Gui,2:Submit,Nohide
  124. SoundBeep, 2000
  125. ;----------------------------------------------
  126.  
  127. Gui,2:Show,,Sample Window2
  128. return
  129.  
  130. BTN3:
  131. ;-----------------------------------------------------
  132. ; In the button label, add the focus grab line
  133.  
  134. GuiControl , % HB_Button[ A_GuiControl ].Window ": Focus" , % HB_Button[ A_GuiControl ].Hwnd
  135. ; Add the button press function call and test
  136. if( ! HB_Button[ A_GuiControl ].Draw_Pressed() )
  137. return
  138. Gui,2:Submit,Nohide
  139. SoundBeep, 2000
  140. ;----------------------------------------------
  141. Gui,3:Add,Text,x10 y20 w220 h50 gMove BackgroundTrans,
  142. Gui,3:Show,,Sample Window3
  143. tooltip, yes
  144. return
  145.  
  146. ;Add the hover fuction to the bottom of your script (or go lib route if you know how to)
  147. HB_Button_Hover(){
  148. static Index , Hover_On
  149. MouseGetPos,,,, ctrl , 2
  150. if( ! Hover_On && ctrl ){
  151. loop , % HB_Button.Length()
  152. if( ctrl = HB_Button[ A_Index ].hwnd )
  153. {
  154. HB_Button[ A_Index ].Draw_Hover() , Index := A_Index , Hover_On := 1 , break
  155. SoundBeep,200
  156. }
  157. }else if( Hover_On = 1 )
  158. if( ctrl != HB_Button[ Index ].Hwnd )
  159. HB_Button[ Index ].Draw_Default() , Hover_On := 0
  160. }
  161.  
  162. SwitchC:
  163. if(state=0){
  164. Switch[ A_GuiControl ].Draw_Bitmap_ON()
  165. ;~ IniWrite,1,gg.ini,sss,aa2
  166. ;~ Switch.state:=1
  167. state:=1
  168. }else{
  169. Switch[ A_GuiControl ].Draw_Bitmap_OFF()
  170. ;~ IniWrite,0,gg.ini,sss,aa2
  171. state:=0
  172. }
  173. return
  174.  
  175.  
  176. Move:
  177. PostMessage,0xA1,2
  178. return
  179. Esc::
  180. GuiClose:
  181. GuiContextMenu:
  182. Gdip_Shutdown(pToken)
  183. ExitApp
  184.  
  185. class HB_Flat_Rounded_Button_Type_1 {
  186. __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"){
  187. This.Roundness:=Roundness
  188. This.Text_Color_Top := "0xFF" Font_Color_Top
  189. This.Text_Color_Bottom := "0xFF" Font_Color_Bottom
  190. This.HoverC:="0xFF" HoverColor
  191. This.HoverC2:="0xFF" HoverColor2
  192. This.BColor:="0xFF" BColor
  193. This.Font := Font
  194. This.Font_Size := Font_Size
  195. This.Text := Text
  196. This.TextHover:="0xFF" TextHover
  197. This.X := x
  198. This.Y := y
  199. This.W := w
  200. This.H := h
  201. This.Button_Background_Color := "0xFF" Button_Background_Color
  202. This.Button_Color := "0xFF" Button_Color
  203. This.Window := Window
  204. This.Label := Label
  205. This.Default_Button := Default_Button
  206. This.Create_Default_Bitmap()
  207. This.Create_Hover_Bitmap()
  208. This.Create_Pressed_Bitmap()
  209. This.Create_Trigger()
  210. sleep, 20
  211. This.Draw_Default()
  212. }
  213. Create_Trigger(){
  214. static
  215. num := HB_Button.Length()+1
  216. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  217. This.Number := Num , This.Hwnd := Hwnd
  218.  
  219. }
  220. Create_Default_Bitmap(){
  221. ;Bitmap Created Using: HB Bitmap Maker
  222. pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;96x29
  223. G := Gdip_GraphicsFromImage( pBitmap )
  224. Gdip_SetSmoothingMode( G , 2 )
  225. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  226. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  227. Gdip_DeleteBrush( Brush )
  228. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF61646A" , "0xFF2E2124" , 1 , 1 )
  229. Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
  230. Gdip_DeleteBrush( Brush )
  231.  
  232. ;---------------------------------------------------
  233. if(This.Default_Button)
  234. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF4C4F54" , "0xFF35373B" , 1 , 1 )
  235. else
  236. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , This.Button_Color , This.BColor , 1 , 1 ) ; DEFAULT COLOR
  237. ;-------------------------------------------
  238.  
  239. Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-2 , This.H-5 , This.Roundness )
  240. Gdip_DeleteBrush( Brush )
  241. Pen := Gdip_CreatePen( "0xFFFFFFFF" , 1 ) ;0xFF1A1C1F
  242. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
  243. Gdip_DeletePen( Pen )
  244. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
  245. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y2 " , This.Font , This.W , This.H-1 )
  246. Gdip_DeleteBrush( Brush )
  247. Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
  248. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y1 " , This.Font , This.W , This.H-1 )
  249. Gdip_DeleteBrush( Brush )
  250. Gdip_DeleteGraphics( G )
  251. This.Default_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  252. Gdip_DisposeImage(pBitmap)
  253. }
  254. Create_Hover_Bitmap(){
  255. ;Bitmap Created Using: HB Bitmap Maker
  256. pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;96x29
  257. G := Gdip_GraphicsFromImage( pBitmap )
  258. Gdip_SetSmoothingMode( G , 2 )
  259. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  260. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  261. Gdip_DeleteBrush( Brush )
  262.  
  263. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF61646A" , "0xFF2E2124" , 1 , 1 )
  264. Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
  265. Gdip_DeleteBrush( Brush )
  266. ;---------------------------------------------------------------------------
  267. if(This.Default_Button)
  268. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF555851" , "0xFF3B3E41" , 1 , 1 )
  269.  
  270. else
  271. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , This.HoverC , This.HoverC2 , 1 , 1 ) ;HOVER COLOR
  272. ;----------------------------------------------------------------
  273. Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-2 , This.H-5 , This.Roundness )
  274. Gdip_DeleteBrush( Brush )
  275. Pen := Gdip_CreatePen( "0xFFFFFFFF" , 1 ) ; BODER
  276. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
  277. Gdip_DeletePen( Pen )
  278. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom ) ; TEXT BOTTOM COLOR
  279. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y2" , This.Font , This.W , This.H-1 )
  280. Gdip_DeleteBrush( Brush )
  281. Brush := Gdip_BrushCreateSolid( This.TextHover ) ;TEXT FONT COLOR
  282. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y1" , This.Font , This.W , This.H-1 )
  283. Gdip_DeleteBrush( Brush )
  284. Gdip_DeleteGraphics( G )
  285. This.Hover_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  286. Gdip_DisposeImage(pBitmap)
  287. }
  288. Create_Pressed_Bitmap(){
  289. pBitmap:=Gdip_CreateBitmap( This.W , This.H )
  290. G := Gdip_GraphicsFromImage( pBitmap )
  291. Gdip_SetSmoothingMode( G , 2 )
  292. Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
  293. Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
  294. Gdip_DeleteBrush( Brush )
  295. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF000000" , "0xFF45474E" , 1 , 1 )
  296. Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
  297. Gdip_DeleteBrush( Brush )
  298. Brush := Gdip_BrushCreateSolid( "0xFF2A2C2E" )
  299. Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , This.W , This.H-8 , This.Roundness )
  300. Gdip_DeleteBrush( Brush )
  301. Brush := Gdip_BrushCreateSolid( "0xFF46474D" )
  302. Gdip_FillRoundedRectangle( G , Brush , 0 , 7 , This.W , This.H-8 , This.Roundness )
  303. Gdip_DeleteBrush( Brush )
  304. ;------------------------------------------------------------------
  305. if(This.Default_Button)
  306. Brush := Gdip_CreateLineBrushFromRect( 5 , 3 , This.W ,This.H-7 , "0xFF333639" , "0xFF43474B" , 1 , 1 )
  307. else
  308. Brush := Gdip_CreateLineBrushFromRect( 5 , 3 , This.W ,This.H-7 , "0xFF333639" , "0xFF00FFFF" , 1 , 1 ) ;PRESSED COLOR
  309. ;-----------------------------------------------------------------------
  310. Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-3 , This.H-6 , This.Roundness )
  311. Gdip_DeleteBrush( Brush )
  312. Pen := Gdip_CreatePen( "0xFF1A1C1F" , 1 )
  313. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
  314. Gdip_DeletePen( Pen )
  315. Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
  316. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y3" , This.Font , This.W , This.H-1 )
  317. Gdip_DeleteBrush( Brush )
  318. Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
  319. Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y2" , This.Font , This.W , This.H-1 )
  320. Gdip_DeleteBrush( Brush )
  321. Gdip_DeleteGraphics( G )
  322. This.Pressed_Bitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
  323. Gdip_DisposeImage( pBitmap )
  324. }
  325. Draw_Default(){
  326. SetImage( This.Hwnd , This.Default_Bitmap )
  327. }
  328. Draw_Hover(){
  329. SetImage( This.Hwnd , This.Hover_Bitmap )
  330. }
  331. Draw_Pressed(){
  332. SetImage( This.Hwnd , This.Pressed_Bitmap )
  333. SetTimer , HB_Button_Hover , Off
  334. While( GetKeyState( "LButton" ) )
  335. sleep , 10
  336. SetTimer , HB_Button_Hover , On
  337. MouseGetPos,,,, ctrl , 2
  338. if( This.Hwnd != ctrl ){
  339. This.Draw_Default()
  340. return False
  341. }else {
  342. This.Draw_Hover()
  343. return true
  344. }
  345. }
  346. }
  347.  
  348. Class Window_1{
  349. __New( x:=10, y:=10, w:=602, h:=402, Window:=1, Option:="-DPIScale +AlwaysOntop -Caption", Title:="Sample Window"){
  350. This.X:=x
  351. This.Y:=y
  352. This.W:=w
  353. This.H:=h
  354. This.Window:=Window
  355. This.Option:=Option
  356. This.Title:=Title
  357. This.Create_Window()
  358. This.Add_Window()
  359. This.Create_Window2()
  360. sleep 20
  361. if (This.Window=1)
  362. This.Draw_Window()
  363. else if (This.Window=3)
  364. This.Draw_Window2()
  365. }
  366. Add_Window(){
  367. static
  368. Num:=Window.Length()+1
  369. Gui, % This.Window " :" This.Option
  370. Gui, % This.Window ":Add" , Picture,% "x" This.X " y" This.Y " w" This.W " h" This.H " v" Num " hwndhwnd 0xE"
  371. This.Number := Num , This.Hwnd := Hwnd
  372. }
  373. Create_Window(){
  374. ;Bitmap Created Using: HB Bitmap Maker
  375. pBitmap:=Gdip_CreateBitmap( 602 , 402 )
  376. G := Gdip_GraphicsFromImage( pBitmap )
  377. Gdip_SetSmoothingMode( G , 4 )
  378. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 )
  379. Pen := Gdip_CreatePenFromBrush( Brush , 8 )
  380. Gdip_DeleteBrush( Brush )
  381. Gdip_DrawRoundedRectangle( G , Pen , 0 , 35 , 600 , 350 , 20 )
  382. Gdip_DeletePen( Pen )
  383. Brush := Gdip_BrushCreateHatch( "0xFF222222" , "0xFF333333" , 39 )
  384. Gdip_FillRoundedRectangle( G , Brush , -2 , 2 , 244 , 85 , 20 )
  385. Gdip_DeleteBrush( Brush )
  386. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 )
  387. Pen := Gdip_CreatePenFromBrush( Brush , 8 )
  388. Gdip_DeleteBrush( Brush )
  389. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , 244 , 385 , 20 )
  390. Gdip_DeletePen( Pen )
  391. Brush := Gdip_BrushCreateHatch( "0xFF222222" , "0xFF333333" , 39 )
  392. Gdip_FillRoundedRectangle( G , Brush , 4 , 35 , 591 , 350 , 20 )
  393. Gdip_DeleteBrush( Brush )
  394. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  395. Gdip_FillRoundedRectangle( G , Brush , 24 , 94 , 200 , 270 , 10 )
  396. Gdip_DeleteBrush( Brush )
  397. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  398. Gdip_FillRoundedRectangle( G , Brush , 246 , 94 , 330 , 270 , 10 )
  399. Gdip_DeleteBrush( Brush )
  400. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF333333" , "0xFF880000" , 1 , 1 )
  401. Gdip_FillRoundedRectangle( G , Brush , 10 , 10 , 220 , 60 , 5 )
  402. Gdip_DeleteBrush( Brush )
  403. Pen := Gdip_CreatePen( "0xFF000000" , 3 )
  404. Gdip_DrawRoundedRectangle( G , Pen , 10 , 10 , 220 , 60 , 5 )
  405. Gdip_DeletePen( Pen )
  406. Brush := Gdip_BrushCreateSolid( "0xFF666666" )
  407. Gdip_FillRectangle( G , Brush , 20 , 17 , 200 , 44 )
  408. Gdip_DeleteBrush( Brush )
  409. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF888888" , "0xFFFFFFFF" , 1 , 1 )
  410. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  411. Gdip_DeleteBrush( Brush )
  412. Gdip_DrawRectangle( G , Pen , 10 , 80 , 579 , 293 )
  413. Gdip_DeletePen( Pen )
  414. Pen := Gdip_CreatePen( "0xFF000000" , 3 )
  415. Gdip_DrawRoundedRectangle( G , Pen , 24 , 94 , 200 , 270 , 5 )
  416. Gdip_DeletePen( Pen )
  417. Pen := Gdip_CreatePen( "0xFF000000" , 3 )
  418. Gdip_DrawRoundedRectangle( G , Pen , 246 , 94 , 330 , 270 , 5 )
  419. Gdip_DeletePen( Pen )
  420. Gdip_DeleteGraphics( G )
  421. This.Draw_1 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  422. Gdip_DisposeImage(pBitmap)
  423. }
  424. Draw_Window(){
  425. SetImage( This.Hwnd , This.Draw_1 )
  426. }
  427. Create_Window2(){
  428. ;Bitmap Created Using: HB Bitmap Maker
  429. pBitmap:=Gdip_CreateBitmap( 610 , 392 )
  430. G := Gdip_GraphicsFromImage( pBitmap )
  431. Gdip_SetSmoothingMode( G , 4 )
  432. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 )
  433. Pen := Gdip_CreatePenFromBrush( Brush , 8 )
  434. Gdip_DeleteBrush( Brush )
  435. Gdip_DrawRoundedRectangle( G , Pen , 0 , 35 , 600 , 350 , 20 )
  436. Gdip_DeletePen( Pen )
  437. Brush := Gdip_BrushCreateHatch( "0xFF222222" , "0xFF333333" , 39 )
  438. Gdip_FillRoundedRectangle( G , Brush , -2 , 2 , 244 , 85 , 20 )
  439. Gdip_DeleteBrush( Brush )
  440. Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 )
  441. Pen := Gdip_CreatePenFromBrush( Brush , 8 )
  442. Gdip_DeleteBrush( Brush )
  443. Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , 244 , 385 , 20 )
  444. Gdip_DeletePen( Pen )
  445. Brush := Gdip_BrushCreateHatch( "0xFF222222" , "0xFF333333" , 39 )
  446. Gdip_FillRoundedRectangle( G , Brush , 4 , 3 , 595 , 381 , 20 )
  447. Gdip_DeleteBrush( Brush )
  448. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  449. Gdip_FillRoundedRectangle( G , Brush , 24 , 94 , 200 , 270 , 10 )
  450. Gdip_DeleteBrush( Brush )
  451. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  452. Gdip_FillRoundedRectangle( G , Brush , 246 , 94 , 330 , 270 , 10 )
  453. Gdip_DeleteBrush( Brush )
  454. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF333333" , "0xFF880000" , 1 , 1 )
  455. Gdip_FillRoundedRectangle( G , Brush , 10 , 10 , 220 , 60 , 5 )
  456. Gdip_DeleteBrush( Brush )
  457. Pen := Gdip_CreatePen( "0xFF000000" , 3 )
  458. Gdip_DrawRoundedRectangle( G , Pen , 10 , 10 , 220 , 60 , 5 )
  459. Gdip_DeletePen( Pen )
  460. Brush := Gdip_BrushCreateSolid( "0xFF666666" )
  461. Gdip_FillRectangle( G , Brush , 20 , 17 , 200 , 44 )
  462. Gdip_DeleteBrush( Brush )
  463. Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF888888" , "0xFFFFFFFF" , 1 , 1 )
  464. Pen := Gdip_CreatePenFromBrush( Brush , 3 )
  465. Gdip_DeleteBrush( Brush )
  466. Gdip_DrawRectangle( G , Pen , 10 , 80 , 579 , 293 )
  467. Gdip_DeletePen( Pen )
  468. Pen := Gdip_CreatePen( "0xFF000000" , 3 )
  469. Gdip_DrawRoundedRectangle( G , Pen , 24 , 94 , 200 , 270 , 5 )
  470. Gdip_DeletePen( Pen )
  471. Pen := Gdip_CreatePen( "0xFF000000" , 3 )
  472. Gdip_DrawRoundedRectangle( G , Pen , 246 , 94 , 330 , 270 , 5 )
  473. Gdip_DeletePen( Pen )
  474. Gdip_DeleteGraphics( G )
  475. This.Draw_2 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  476. Gdip_DisposeImage(pBitmap)
  477. }
  478. Draw_Window2(){
  479. SetImage( This.Hwnd , This.Draw_2 )
  480. }
  481. }
  482.  
  483.  
  484. ;SWITCH
  485. Class SWITCH_1{
  486. __New( x:=10, y:=10, w:= 100, h:= 30, state:=0, BG_Color:="222222", Switch_BG_Color:="333333", Switch_F_Color:="404040", Switch_Border:="ffffff", Switch_Border2:="ffffff", Text_Color3:="00FF00", Font_Size:=20, Text1:="SwitchON", Text2:="SwitchOFF", Text_Color1:="FF0000", Text_Color2:="00FF00", Window:="1", Label:="SwitchC"){
  487. This.X:=x
  488. This.Y:=y
  489. This.W:=w
  490. This.H:=h
  491. This.Window:=Window
  492. This.State:=state
  493. This.Font_Size := Font_Size
  494. This.Text_Color3:= "0xFF" Text_Color3
  495. This.BG_Color:= "0xFF" BG_Color
  496. This.Switch_BG_Color:= "0xFF" Switch_BG_Color
  497. This.Switch_F_Color:= "0xFF" Switch_F_Color
  498. This.Switch_Border:="0xFF" Switch_Border
  499. This.Switch_Border2:="0xFF" Switch_Border2
  500. This.Text1:=Text1
  501. This.Text2:=Text2
  502. This.Text_Color1:= "0xFF" Text_Color1
  503. This.Text_Color2:= "0xFF" Text_Color2
  504. This.Label:=Label
  505. This.Create_Switch_OFF()
  506. This.Create_Switch_ON()
  507. This.Adding_Control()
  508. sleep 20
  509. (This.State=0)?(This.Draw_Bitmap_OFF()):(This.Draw_Bitmap_ON())
  510. }
  511.  
  512. Adding_Control(){
  513. static
  514. num := Switch.Length()+1
  515. Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
  516. This.Number := Num , This.Hwnd := Hwnd
  517. }
  518. Create_Switch_OFF(){
  519. ;Bitmap Created Using: HB Bitmap Maker
  520. pBitmap:=Gdip_CreateBitmap( This.W , This.H )
  521. G := Gdip_GraphicsFromImage( pBitmap )
  522. Gdip_SetSmoothingMode( G , 4 )
  523. ;background
  524. Brush := Gdip_BrushCreateHatch( "0xFF222222" , "0xFF333333" , 39 )
  525. Gdip_FillRectangle( G , Brush , -1 , -1 , 104 , 33 )
  526. Gdip_DeleteBrush( Brush )
  527. ;rounddedbackground
  528. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  529. Gdip_FillRoundedRectangle( G , Brush , 6 , 3 , 89 , 24 , 5 )
  530. Gdip_DeleteBrush( Brush )
  531. Pen := Gdip_CreatePen( "0xFFff0000" , 1 )
  532. Gdip_DrawRoundedRectangle( G , Pen , 5 , 3 , 90 , 24 , 5 )
  533. Gdip_DeletePen( Pen )
  534. ;backcolor
  535. Brush := Gdip_BrushCreateSolid( "0xFF666666" )
  536. Gdip_FillRoundedRectangle( G , Brush , 7 , 4 , 50 , 22 , 5 )
  537. Gdip_DeleteBrush( Brush )
  538. ;fontcolor
  539. Brush := Gdip_CreateLineBrushFromRect( 0 , 10 , 100 , 100 , "0xFF404040" , "0xFFffffff" , 1 , 1 )
  540. Gdip_FillRoundedRectangle( G , Brush , 7 , 4 , 50 , 22 , 5 )
  541. Gdip_DeleteBrush( Brush )
  542. Pen := Gdip_CreatePen( "0xFFffffff" , 1 )
  543. Gdip_DrawRoundedRectangle( G , Pen , 7 , 4 , 50 , 22 , 5 )
  544. Gdip_DeletePen( Pen )
  545. ;BACK CIRCLE
  546. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  547. Gdip_FillEllipse( G , Brush , 16 , 9 , 12 , 12 )
  548. Gdip_DeleteBrush( Brush )
  549. ;FONTCIRCLE
  550. Brush := Gdip_BrushCreateSolid( "0xFFff0000" )
  551. Gdip_FillEllipse( G , Brush , 17 , 10 , 10 , 10 )
  552. Gdip_DeleteBrush( Brush )
  553. ;BACK TEXT
  554. Brush := Gdip_BrushCreateSolid( "0xFFFFFFFF" )
  555. ;BACK TEXT
  556. Gdip_TextToGraphics( G , "OFF" , "s12 Center vCenter Bold c" Brush " x50 y-10" , "Segoe UI" , 50 , 50 )
  557. Gdip_DeleteBrush( Brush )
  558. ;FONT TEXT
  559. Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
  560. ;FONT TEXT
  561. Gdip_TextToGraphics( G , "OFF" , "s12 Center vCenter Bold c" Brush " x51 y-9" , "Segoe UI" , 50 , 50 )
  562. Gdip_DeleteBrush( Brush )
  563. Gdip_DeleteGraphics( G )
  564. This.Draw_OFF_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
  565. Gdip_DisposeImage(pBitmap)
  566. }
  567.  
  568. Create_Switch_ON(){
  569. ;Bitmap Created Using: HB Bitmap Maker
  570. pBitmap:=Gdip_CreateBitmap( This.W , This.H )
  571. G := Gdip_GraphicsFromImage( pBitmap )
  572. Gdip_SetSmoothingMode( G , 4 )
  573. ;background
  574. Brush := Gdip_BrushCreateHatch( "0xFF222222" , "0xFF333333" , 39 )
  575. Gdip_FillRectangle( G , Brush , -1 , -1 , 104 , 33 )
  576. Gdip_DeleteBrush( Brush )
  577. ;rounddedbackground
  578. Brush := Gdip_BrushCreateSolid( "0xFF000000" )
  579. Gdip_FillRoundedRectangle( G , Brush , 6 , 3 , 89 , 24 , 5 )
  580. Gdip_DeleteBrush( Brush )
  581. ;backcolor
  582. Brush := Gdip_BrushCreateSolid( "0xFF666666" )
  583. Gdip_FillRoundedRectangle( G , Brush , 44 , 4 , 50 , 22 , 5 )
  584. Gdip_DeleteBrush( Brush )
  585. ;fontcolor
  586. Brush := Gdip_CreateLineBrushFromRect( 0 , 10 , 100 , 100 , "0xFF404040" , "0xFFffffff" , 1 , 1 )
  587. Gdip_FillRoundedRectangle( G , Brush , 44 , 4 , 50 , 22 , 5 )
  588. Gdip_DeleteBrush( Brush )
  589. Pen := Gdip_CreatePen( "0xFF00ff00" , 1 )
  590. Gdip_DrawRoundedRectangle( G , Pen , 7 , 3 , 89 , 24 , 5 )
  591. Gdip_DeletePen( Pen )
  592. Pen := Gdip_CreatePen( "0xFFffffff" , 1 )
  593. Gdip_DrawRoundedRectangle( G , Pen , 44 , 4 , 50 , 22 , 5 )
  594. Gdip_DeletePen( Pen )
  595. ;BACK CIRCLE
  596. Brush := Gdip_BrushCreateSolid( "0xFF222222" )
  597. Gdip_FillEllipse( G , Brush , 76 , 9 , 12 , 12 )
  598. Gdip_DeleteBrush( Brush )
  599. ;FONTCIRCLE
  600. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  601. Gdip_FillEllipse( G , Brush , 77 , 10 , 10 , 10 )
  602. Gdip_DeleteBrush( Brush )
  603. ;BACK TEXT
  604. Brush := Gdip_BrushCreateSolid( "0xFFFFFFFF" )
  605. ;BACK TEXT
  606. Gdip_TextToGraphics( G , "ON" , "s12 Center vCenter Bold c" Brush " x0 y-10" , "Segoe UI" , 50 , 50 )
  607. Gdip_DeleteBrush( Brush )
  608. ;FONT TEXT
  609. Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
  610. ;FONT TEXT
  611. Gdip_TextToGraphics( G , "ON" , "s12 Center vCenter Bold c" Brush " x1 y-9" , "Segoe UI" , 50 , 50 )
  612. Gdip_DeleteBrush( Brush )
  613. Gdip_DeleteGraphics( G )
  614. This.Draw_ON_Bitmap:= Gdip_CreateHBITMAPFromBitmap(pBitmap)
  615. Gdip_DisposeImage(pBitmap)
  616. }
  617. Draw_Bitmap_ON(){
  618. SetImage( This.Hwnd , This.Draw_ON_Bitmap )
  619. }
  620. Draw_Bitmap_OFF(){
  621. SetImage( This.Hwnd , This.Draw_OFF_Bitmap )
  622. }
  623.  
  624. }
  625.  
  626.  
Advertisement
Add Comment
Please, Sign In to add comment