Verification of correct operation of a custom gui slider.

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Verification of correct operation of a custom gui slider.

21 Jun 2020, 13:31

I have a project that I started working on a few months ago that I just restarted working on today after a 3 month break from doing pretty much any coding due to health problems. I just finished adding in stand-in (temp) slider that I will be replacing shortly with a more polished control set, but before I do that I would like, if possible to get confirmation that there is no issues with the test control. I REALLY don't think that there are any issues with it's functionality, but I'd rather deal with any problems sooner rather than later.

Requires Windows 8+ (8 or 10) and a copy of GDIP to run.

I really only need to know if clicking on the first slider and moving your cursor up or down move the sliders button/thumb correctly within the area the body of the control sits.

To get to the slider, run the script and press the "click speed" button.

Here is a gif of what you should see.
Spoiler
Here is the code. Change the #Include to your gdip lib.

Code: Select all

;***************************************************************************************************
;***************************************************************************************************
;***************************************************************************************************
#Include <My Altered Gdip Lib>  ;<------       Replace with your copy of GDIP
;***************************************************************************************************
;***************************************************************************************************
;***************************************************************************************************
#SingleInstance, Force
SetBatchLines, -1

global Always := 1


BGMain := New LayeredWindow( x := "" , y := "" , w := 300 , h := 200 , window := 1 , title := "Toggle Clicker v2" , smoothing := 2 , options := "+AlwaysOnTop -DPIScale" , autoShow := 1 , GdipStart := 1 , WinMover := "" , BackgroundColor := "" )
BBrush := Gdip_BrushCreateSolid( "0xFF880000" ), BPen := Gdip_CreatePen( "0xFF555555" , 1 ), BP := []

Loop, 50
	BP.Push({X:Ran(-10,300),Y:Ran(-10,200),W:Ran(5,30),Phase:Ran(0,1),Co:Ran(0,3),Max: Max:=Ran(10,50),Min:Ran(3,Max)})


pBanner := BannerTag("Wash Your Hands" )
BannerWin := New LayeredWindow( x := 30 , y := 0 , w := 240 , h := 40 , window := 2 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0 , WinMover := "" , BackgroundColor := "" )
Banner := {Bitmap1:BannerTag("Wash Your Hands"),Bitmap2:BannerTag("HB Toggle Clicker"),X:20,Y:0,W:160,H:30,Dir1:1,Dir2:1,PhaseCo:0,Phase:1}
Gdip_DrawImage(BannerWin.G, Banner.Bitmap2, Banner.X, Banner.Y, Banner.W, Banner.H) 
BannerWin.UpdateWindow()
Bit:=Banner.Bitmap2
Gui,2:Add,Text,x0 y0 w300 h30 BackgroundTrans gMoveWin


InnerWin1 := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 3 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0 , WinMover := "" , BackgroundColor := "0x22000000" )
INPen1 := Gdip_CreatePen( "0xFF440000" , 1 )
Gdip_DrawRectangle(InnerWin1.G, INPen1,0, 0, InnerWin1.W-1, InnerWin1.H-1)
Gdip_DrawImage(InnerWin1.G, TogClButtSet1(), 0, 0, InnerWin1.W, InnerWin1.H) 
Gdip_DrawImage(InnerWin1.G, AlwaysSwitch(Always), 0, 0, InnerWin1.W, 30) 
Gdip_DisposeImage( AlwaysBit )
Gui,3:Add,Text,x10 y7 w20 h20 BackgroundTrans gSetAlways
InnerWin1.UpdateWindow()

Butts := []
Gui,3:Add,Text,x30 y35 w220 h30 BackgroundTrans hwndhwnd gHotkeysWindow
Butts[hwnd]:=1
Gui,3:Add,Text,x30 y75 w220 h30 BackgroundTrans hwndhwnd gClickSpeedWindow
Butts[hwnd]:=2
Gui,3:Add,Text,x30 y115 w220 h30 BackgroundTrans hwndhwnd gMoreOptionsWindow
Butts[hwnd]:=3



Mins := New LayeredWindow( x := 0 , y := 0 , w := 300 , h := 30 , window := 4 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0  )
Gdip_DrawImage(Mins.G, MinAndCloseButtons(), 0, 0, 300, 30)
Mins.UpdateWindow()
Gui,4:Add,Text,x5 y5 w20 h20 BackgroundTrans hwndhwnd gMinWin
Gui,4:Add,Text,x275 y5 w20 h20 BackgroundTrans hwndhwnd gGuiClose

;Slider test
;------------------------------------------------------------------------------------------
;------------------------------------------------------------------------------------------
;~ TestSlider := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 5 , title := " " , smoothing := 4 , options := "+Parent1 -DPIScale" , autoShow := 1 , GdipStart := 0 ) ; , WinMover := {X:0,Y:0,W:300,H:30} , BackgroundColor := "0xff171719" )
;~ Gui, 5:Add,Text,x24 y39 w22 h82 gAdjustSlider
;~ TestSlider.Draw( TestSlider(value:=0) , Positions := {x:10,y:30,w:50,h:100} , update := 1 , disposeBitmap := 1  , PaintBackground := 0)
;~ TestSlider.Draw_Text({x:15,y:120,w:40,h:30},Text:=10,Font:="Arial",FontSize:="12",Color1:="0xFFFFFFFF",Color2:="",PosObj2:="",update:=1)


SetTimer, Hover, 50
SetTimer, BannerM, 50
SetTimer, Ani, 100
return
GuiClose:
GuiContextMenu:
*ESC::
	BGMain.DeleteWindow(1)
	ExitApp

;Test Slider
;###################################################################################################
;###################################################################################################
AdjustSlider:
	Coordmode,Mouse,Client
	While(GetKeyState("LButton")){
		MouseGetPos,tx,ty2
		(ty2<87)?(ty2:=87):(ty2>147)?(ty2:=147)
		values :=  ((ty2-87)//(60//20)-20)*-1
		(values=0)?(Values:=1)
		TestSlider.ClearWindow()
		;~ TestSlider.Draw( TestSlider(1,tx,ty2-39) , Positions := {x:10,y:30,w:50,h:100} , update := 1 , disposeBitmap := 1  , PaintBackground := "0xff171719")
		TestSlider.Draw( TestSlider(1,tx,ty2-70) , Positions := {x:10,y:30,w:50,h:100} , update := 0 , disposeBitmap := 1  , PaintBackground := "0xff171719")
		TestSlider.Draw_Text({x:15,y:120,w:40,h:30},Text:=values,Font:="Arial",FontSize:="12",Color1:="0xFFFFFFFF",Color2:="",PosObj2:="",update:=0)
		TestSlider.Draw( TestSlider(1,tx,ty2-70) , Positions := {x:70,y:30,w:50,h:100} , update := 0 , disposeBitmap := 1  , PaintBackground := 0)
		TestSlider.Draw_Text({x:75,y:120,w:40,h:30},Text:=values,Font:="Arial",FontSize:="12",Color1:="0xFFFFFFFF",Color2:="",PosObj2:="",update:=0)
		
		TestSlider.UpdateWindow()
		sleep, 50
	}
	return
TestSlider(value:=0,x:="",y:=""){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 50 , 100 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_CreateLineBrushFromRect( 14 , 9 , 22 , 80 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 14 , 9 , 22 , 82 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 14 , 9 , 22 , 80 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 15 , 10 , 20 , 80 , 5 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 13 , 8 , 26 , 81 , "0xaa441111" , "0xaa000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 13 , 8 , 26 , 81 , "0xaa441111" , "0xaaffffff" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 24 , 14 , 2 , 72 )
	Gdip_DeleteBrush( Brush )
	;thumb x17 y17 w16 h8
	if(Value=1){
		Brush := Gdip_CreateLineBrushFromRect( 16 , y , 17 , 9 , "0xFF111111" , "0xFF000000" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 17 , y , 16 , 8 , 3 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 16 , y , 17 , 9 , "0xFF880000" , "0xFF000000" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 18 , y+1 , 14 , 7 , 3 )
		Gdip_DeleteBrush( Brush )
	}else{
		Brush := Gdip_CreateLineBrushFromRect( 16 , 50 , 17 , 9 , "0xFF111111" , "0xFF000000" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 17 , 50 , 16 , 8 , 3 )
		Gdip_DeleteBrush( Brush )
		Brush := Gdip_CreateLineBrushFromRect( 16 , 51 , 14 , 9 , "0xFF880000" , "0xFF000000" , 1 , 1 )
		Gdip_FillRoundedRectangle( G , Brush , 18 , 51 , 14 , 7 , 3 )
		Gdip_DeleteBrush( Brush )
	}
	Gdip_DeleteGraphics( G )
	return pBitmap
}
;###################################################################################################
;###################################################################################################

MinWin:
	Gui,1:Minimize
	return
SetAlways:
	Gui,% (Always:=!Always)?("1:+AlwaysOnTop"):("1:-AlwaysOnTop")
	InnerWin1.ClearWindow()
	Gdip_DrawImage(InnerWin1.G, WiniBit := TogClButtSet1(Active := 0), 0, 0, InnerWin1.W, InnerWin1.H) 
	Gdip_DrawRectangle(InnerWin1.G, INPen1,0, 0, InnerWin1.W-1, InnerWin1.H-1)
	Gdip_DrawImage(InnerWin1.G, AlwaysBit := AlwaysSwitch(Always), 0, 0, InnerWin1.W, 30) 
	InnerWin1.UpdateWindow()
	Gdip_DisposeImage( WiniBit )
	Gdip_DisposeImage( AlwaysBit )
	return
Ran(Min,Max){
	Random, Out, Min, Max
	return Out
}

Hover:
	MouseGetPos,,,,ctrl,2
	if(Butts[ctrl]&&!Active){
		LCtrl := ctrl
		InnerWin1.ClearWindow()
		Gdip_DrawImage(InnerWin1.G, WiniBit := TogClButtSet1(Active := Butts[ctrl]), 0, 0, InnerWin1.W, InnerWin1.H) 
		Gdip_DrawRectangle(InnerWin1.G, INPen1,0, 0, InnerWin1.W-1, InnerWin1.H-1)
		
		
		Gdip_DrawImage(InnerWin1.G, AlwaysSwitch(Always), 0, 0, InnerWin1.W, 30) 
		
		
		InnerWin1.UpdateWindow()
		Gdip_DisposeImage( WiniBit )
		Gdip_DisposeImage( AlwaysBit )
	}else if(Butts[LCtrl]!=Butts[ctrl]&&Active){
		InnerWin1.ClearWindow()
		Gdip_DrawImage(InnerWin1.G, WiniBit := TogClButtSet1(Active := 0), 0, 0, InnerWin1.W, InnerWin1.H) 
		Gdip_DrawRectangle(InnerWin1.G, INPen1,0, 0, InnerWin1.W-1, InnerWin1.H-1)
		
		Gdip_DrawImage(InnerWin1.G, AlwaysBit := AlwaysSwitch(Always), 0, 0, InnerWin1.W, 30) 
		
		InnerWin1.UpdateWindow()
		Gdip_DisposeImage( WiniBit )
		Gdip_DisposeImage( AlwaysBit )
	}
	return

MoveWin:
	PostMessage, 0xA1, 2,,,Toggle Clicker v2
	return

HotkeysWindow:
	ToolTip, here in hotkeys
	return

ClickSpeedWindow:
	ToolTip, here in Click Speed
	Gui,3:Hide
	;~ sleep, 2000
	;~ Gui,3:Show
	;~ TestSlider := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 5 , title := " " , smoothing := 4 , options := "+Parent1 -DPIScale" , autoShow := 1 , GdipStart := 0  , "" , BackgroundColor := "0xff171719" )
	TestSlider := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 5 , title := " " , smoothing := 4 , options := "+Parent1 -DPIScale" , autoShow := 1 , GdipStart := 0  , "" , BackgroundColor := "" )
Gui, 5:Add,Text,x24 y39 w22 h82 gAdjustSlider
TestSlider.Draw( TestSlider(value:=0) , Positions := {x:10,y:30,w:50,h:100} , update := 1 , disposeBitmap := 1  , PaintBackground := "0xff171719")
TestSlider.Draw_Text({x:15,y:120,w:40,h:30},Text:=10,Font:="Arial",FontSize:="12",Color1:="0xFFFFFFFF",Color2:="",PosObj2:="",update:=1)



	return

MoreOptionsWindow:
	ToolTip, here in Options
	return
	
BannerM:
	(Banner.Dir1=1&&Banner.X>=10)?(Banner.X-=2):(Banner.Dir1=1&&Banner.X<10)?(Banner.Dir1:=2)
	(Banner.Dir1=2&&Banner.X<=70)?(Banner.X+=3):(Banner.Dir1=2&&Banner.X>70)?(Banner.Dir1:=1)
	
	(Banner.Dir2=1&&Banner.Y<=10)?(Banner.Y+=.3):(Banner.Dir2=1&&Banner.Y>10)?(Banner.Dir2:=2)
	(Banner.Dir2=2&&Banner.Y>=2)?(Banner.Y-=.3):(Banner.Dir2=2&&Banner.Y<2)?(Banner.Dir2:=1)
	(++Banner.PhaseCo>30)?(Banner.PhaseCo:=0,(Banner.Phase=1)?(Bit:=Banner.Bitmap2,Banner.Phase:=2):(Bit:=Banner.Bitmap1,Banner.Phase:=1))
	
	BannerWin.ClearWindow()
	Gdip_DrawImage(BannerWin.G, Bit, Banner.X, Banner.Y, Banner.W, Banner.H)
	BannerWin.UpdateWindow()
	return
	
Ani:
	;~ BGMain.ClearWindow()
	BGMain.PaintBackground( BackgroundColor := "0x19171719" )
	;~ BGMain.PaintBackground( BackgroundColor := "0xff171719" )
	loop, % BP.Length(){
		(BP[A_Index].Phase=1&&BP[A_Index].W<BP[A_Index].Min)?(BP[A_Index].Phase := 0):(BP[A_Index].Phase=0&&BP[A_Index].W>BP[A_Index].Max)?(BP[A_Index].Phase := 1 , BP[A_Index].Co += 1)
		(BP[A_Index].Phase=1)?(BP[A_Index].X += 1,BP[A_Index].Y += 1,BP[A_Index].W -= 2,BP[A_Index].H -= 2):(BP[A_Index].X -= 1,BP[A_Index].Y -= 1,BP[A_Index].W += 2,BP[A_Index].H += 2)
		(BP[A_Index].Co>4)?(BP[A_Index] := {X:Ran(-10,300),Y:Ran(-10,200),W:Ran(5,30),Phase:Ran(0,1),Co:Ran(0,3),Max: Max:=Ran(10,50),Min:Ran(3,Max)})
		;~ Brush3 := Gdip_CreateLineBrushFromRect( BP[A_Index].x, BP[A_Index].y, BP[A_Index].w, BP[A_Index].w , "0x77660000" , "0xff000000" , 1 , 1 )
		Brush3 := Gdip_CreateLineBrushFromRect( BP[A_Index].x, BP[A_Index].y, BP[A_Index].w, BP[A_Index].w , "0xff660000" , "0xff000000" , 1 , 1 )
		Gdip_FillEllipse(BGMain.G, Brush3, BP[A_Index].x, BP[A_Index].y, BP[A_Index].w, BP[A_Index].w)
		Gdip_DeleteBrush( Brush3 )
		Gdip_DrawRectangle(BGMain.G, BPen,0, 0, 299, 199)

	}
	BGMain.UpdateWindow()
	return





;***********************************************************************************************************************************************************************
;***																																								 ***
;***																		Layered Window Class																	 ***
;***																																								 ***
;***********************************************************************************************************************************************************************

class LayeredWindow	{
;LayeredWindow class By: Hellbent
	__New( x := 0 , y := 0 , w := 100 , h := 100 , window := 1 , title := " " , smoothing := 4 , options := "" , autoShow := 1 , GdipStart := 0 , WinMover := "" , BackgroundColor := "" ){
		This.X := x , This.Y := y , This.W := w , This.H := h 
		This.Window := window , This.Title := title
		This.Options := options , This.Smoothing := smoothing
		( GdipStart ) ? ( This.Token := Gdip_Startup() )
		This._CreateWindow()
		( autoShow ) ? ( This.ShowWindow() )
		This._SetUpdateLayeredWindow()
		( WinMover ) ? ( This._AddMoveTrigger( WinMover ) )
		( BackgroundColor ) ? ( This.PaintBackground( BackgroundColor , 1 ) )
	}
	_CreateWindow(){
		Gui , % This.Window ": New" , % " +E0x80000 +LastFound -Caption " This.Options 
		This.Hwnd := WinExist()
		This.hbm := CreateDIBSection( This.W , This.H )
		This.hdc := CreateCompatibleDC()
		This.obm := SelectObject( This.hdc , This.hbm )
		This.G := Gdip_GraphicsFromHDC( This.hdc )
		Gdip_SetSmoothingMode( This.G , This.Smoothing )
	}
	_SetUpdateLayeredWindow(){
		UpdateLayeredWindow( This.hwnd , This.hdc , This.X , This.Y , This.W , This.H )
	}
	UpdateWindow(){
		UpdateLayeredWindow( This.hwnd , This.hdc )
	}
	ShowWindow( update := 1 , Position := "" ){ 
		if( !Position )
			Gui , % This.Window ": Show" , % "w" This.W " h" This.H  , % ( This.Title ) ? ( This.Title ) : ( "" )
		else
			Gui , % This.Window ": Show" , % "x" Position.X " y" Position.Y "w" Position.W " h" Position.H  , % ( This.Title ) ? ( This.Title )  : ( "" )
		( update ) ? ( This.UpdateWindow() )
	}
	_AddMoveTrigger( positons ){ 
		local hwnd , bd
		Gui , % This.Window " : Add" , Text , % "x" positons.x " y" positons.y " w" positons.w " h" positons.h " hwndhwnd"
		This.MoveHwnd := hwnd
		bd := This._WindowMover.Bind( This )
		GuiControl , % This.Window ": +G" , % This.MoveHwnd , % bd
	}
	_WindowMover(){ 
		PostMessage, 0xA1 , 2
	}
	PaintBackground( BackgroundColor := "0xFF000000" , update := 0){ 
		local Brush
		This.BackgroundColor := BackgroundColor
		Brush := Gdip_BrushCreateSolid( BackgroundColor )
		Gdip_FillRectangle( This.G , Brush , 0 , 0 , This.W , This.H )
		Gdip_DeleteBrush( Brush )
		( update ) ? ( This.UpdateWindow() )
	}
	Draw( pBitmap , Positions := "" , update := 1 , disposeBitmap := 0  , PaintBackground := 0){ 
	(PaintBackground) ? ( This.PaintBackground( This.BackgroundColor ) )	
		Gdip_DrawImage( This.G 
						, pBitmap 
						, ( Positions.X1 ) ? ( Positions.X1 ) : ( Positions.X ) ? ( Positions.X ) : ( "" )
						, ( Positions.Y1 ) ? ( Positions.Y1 ) : ( Positions.Y ) ? ( Positions.Y ) : ( "" ) 
						, ( Positions.W1 ) ? ( Positions.W1 ) : ( Positions.W ) ? ( Positions.W ) : ( "" ) 
						, ( Positions.H1 ) ? ( Positions.H1 ) : ( Positions.H ) ? ( Positions.H ) : ( "" ) 
						, ( Positions.X2 ) ? ( Positions.X2 ) : ( Positions.SX ) ? ( Positions.SX ) : ( "" )
						, ( Positions.Y2 ) ? ( Positions.Y2 ) : ( Positions.SY ) ? ( Positions.SY ) : ( "" )
						, ( Positions.W2 ) ? ( Positions.W2 ) : ( Positions.SW ) ? ( Positions.SW ) : ( "" )
						, ( Positions.H2 ) ? ( Positions.H2 ) : ( Positions.SH ) ? ( Positions.SH ) : ( "" ) )
		( update ) ? ( This.UpdateWindow() )
		( disposeBitmap ) ? ( Gdip_DisposeImage( pBitmap ) )
	}
	ClearWindow( update := "" ){ 
		Gdip_GraphicsClear( This.G )
		( update ) ? ( This.UpdateWindow() )
	}
	Add_Trigger(PositionObject,Label:="GuiClose"){
		Gui, % This.Window ": Add", Text, % "x" PositionObject.X " y" PositionObject.Y " w" PositionObject.W " h" PositionObject.H " g" Label " BackgroundTrans"
	}
	Draw_Text(PosObj,Text,Font:="Arial",FontSize:="12",Color1:="0xFFFFFFFF",Color2:="",PosObj2:="",update:=0){
		local Brush
		(!color2&&color2!="000000")?(Color2:=Color1)
		(StrLen(Color1)=6)?( Color1 := "0xFF" Color1 )
		(StrLen(Color2)=6)?( Color2 := "0xFF" Color2 )
		(PosObj2="")?(PosObj2:=PosObj)
		Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , PosObj2.W , PosObj2.H , Color1 , Color2 , 1 , 1 )
		Gdip_TextToGraphics(This.G, Text, "s" FontSize " c" Brush " Center vCenter Bold x" PosObj.X " y" PosObj.Y, Font , PosObj.W, PosObj.H)
		Gdip_DeleteBrush( Brush )
		( update ) ? ( This.UpdateWindow() )
	}
	Draw_Rectangle(Thickness:="5",PosObj:="",Color1:=0xFFFFFFFF,Color2:="",PosObj2:="",update:=0){
		local Brush, pPen
		(!color2)?(Color2:=Color1)
		(StrLen(Color1)=6)?( Color1 := "0xFF" Color1 )
		(StrLen(Color2)=6)?( Color2 := "0xFF" Color2 )
		(PosObj2="")?(PosObj2:=PosObj)
		Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , PosObj2.W , PosObj2.H , Color1 , Color2 , 1 , 1 )
		pPen := Gdip_CreatePenFromBrush(Brush, Thickness)
		Gdip_DrawRectangle( This.G, pPen, PosObj.X , PosObj.Y , PosObj.W , PosObj.H )
		Gdip_DeleteBrush( Brush )
		Gdip_DeletePen(pPen)
		( update ) ? ( This.UpdateWindow() )
	}
	DeleteWindow( TurnOffGdip := 0 ){
		SelectObject( This.hdc , This.obm )
		DeleteObject( This.hbm )
		DeleteDC( This.hdc )
		Gdip_DeleteGraphics( This.G )
		( TurnOffGdip && This.Token ) ? ( Gdip_Shutdown( This.Token ) )
		Gui, % This.Window " : Destroy"
	}
}

AlwaysSwitch(val := 1){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 30 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 10 , 7 , 15 , 15 )
	Gdip_DeleteBrush( Brush )
	if(val=1)
		Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0xFF990000" , "0xFF000000" , 1 , 1 )
	else
		Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0x66171719" , "0x66000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 11 , 8 , 13 , 13 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "AlwaysOnTop" , "s16  vCenter Bold c" Brush " x27 y0" , "Segoe ui" , 150 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 29 , 7 , 107 , 16 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "AlwaysOnTop" , "s16  vCenter Bold c" Brush " x28 y1" , "Segoe ui" , 150 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

MinAndCloseButtons(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 300 , 30 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 4 )
	;min ;x5 y5 w20 h20
	Brush := Gdip_BrushCreateSolid( "0x88666666" )
	Gdip_FillEllipse( G , Brush , 5 , 5 , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0x88171719" )
	Gdip_FillEllipse( G , Brush , 6 , 6 , 18 , 18 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Gdip_TextToGraphics( G , "_" , "s28 Center vCenter Bold c" Brush " x5 y-7" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Gdip_TextToGraphics( G , "_" , "s28 Center vCenter Bold c" Brush " x6 y-6" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	;close ;x275 y5 w20 h20
	Brush := Gdip_BrushCreateSolid( "0x88888888" )
	Gdip_FillEllipse( G , Brush , 275 , 5 , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0x88171719" )
	Gdip_FillEllipse( G , Brush , 276 , 6 , 18 , 18 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Gdip_TextToGraphics( G , "x" , "s16 Center vCenter Bold c" Brush " x275 y4" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Gdip_TextToGraphics( G , "x" , "s16 Center vCenter Bold c" Brush " x276 y5" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

BannerTag(txt := "Wash Your Hands" ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 160 , 30 ),G := Gdip_GraphicsFromImage( pBitmap ),Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF888888" )
	Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , 157 , 26 , 4 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0xFF333333" )
	Brush := Gdip_BrushCreateSolid( "0xFF171719" )
	Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , 155 , 24 , 3 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Gdip_TextToGraphics( G , txt , "s16 Center vCenter Bold c" Brush " x-1 y0" , "Segoe ui" , 160 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Gdip_TextToGraphics( G , txt , "s16 Center vCenter Bold c" Brush " x0 y1" , "Segoe ui" , 160 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

TogClButtSet1(value:=0){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 150 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	;Hotkeys
	Brush := Gdip_CreateLineBrushFromRect( 29 , 36 , 221 , 28 , (Value=1)?("0xFFaa0000"):("0xFF880000")  , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 35 , 220 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=1)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 36 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Hotkeys" , "s16 Center vCenter Bold c" Brush " x30 y35" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 109 , 38 , 72 , 14 , (Value=1)?("0xFF000000"):("0xFF880000") , (Value=1)?("0xFF880000"):("0xFF000000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Hotkeys" , "s16 Center vCenter Bold c" Brush " x31 y36" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	;Click Speed
	Brush := Gdip_CreateLineBrushFromRect( 30 , 74 , 219 , 29 ,(Value=2)?("0xFFaa0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 75 , 220 , 30 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=2)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 76 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Click Speed" , "s16 Center vCenter Bold c" Brush " x30 y75" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 92 , 77 , 94 , 17 ,(Value=2)?("0xFF000000"):("0xFF880000") ,(Value=2)?("0xFF880000"):("0xFF000000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Click Speed" , "s16 Center vCenter Bold c" Brush " x31 y76" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	;More Options
	Brush := Gdip_CreateLineBrushFromRect( 31 , 115 , 216 , 27 ,(Value=3)?("0xFFaa0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 115 , 220 , 30 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=3)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 116 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "More Options" , "s16 Center vCenter Bold c" Brush " x30 y115" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	if(Value=3)
		Brush := Gdip_CreateLineBrushFromRect( 87 , 116 , 105 , 18 , "0xFF000000" , "0xFF880000" , 1 , 1 )
	else
		Brush := Gdip_CreateLineBrushFromRect( 87 , 116 , 105 , 18 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "More Options" , "s16 Center vCenter Bold c" Brush " x31 y116" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap 
}


Thanks in advance.

If possible, please include your screen resolution and DPI setting (100%,125%,150%, etc).
User avatar
JoeWinograd
Posts: 2200
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Verification of correct operation of a custom gui slider.

21 Jun 2020, 14:02

Hellbent wrote:I really only need to know if clicking on the first slider and moving your cursor up or down move the sliders button/thumb correctly within the area the body of the control sits.
Hi Hellbent,

W10 64-bit v1909
AHK U64 1.1.32.00

Tested on two monitors at 100%:
2560x1440
1920x1080

Worked perfectly on both! Regards, Joe
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Verification of correct operation of a custom gui slider.

21 Jun 2020, 14:22

Thank you @flyingDman & @JoeWinograd for your fast reply.
I'll be sure to add your names to the credits for the script once I'm done.
User avatar
JoeWinograd
Posts: 2200
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Verification of correct operation of a custom gui slider.

21 Jun 2020, 14:40

Hi Hellbent,
You're very welcome, happy to help, and will be glad to test future versions if you want. Regards, Joe
BoBo
Posts: 6564
Joined: 13 May 2014, 17:15

Re: Verification of correct operation of a custom gui slider.

21 Jun 2020, 16:47

1366x768 (100%)
AHK: 1.1.30.03
Win: 10.0.18362
Gdip_All.ahk
Status: OK :)
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Verification of correct operation of a custom gui slider.

22 Jun 2020, 12:52

Thank you @BoBo.
JoeWinograd wrote:
21 Jun 2020, 14:40
Hi Hellbent,
You're very welcome, happy to help, and will be glad to test future versions if you want. Regards, Joe
Here's what I think I'm going to settle on being the final design of the sliders for this project.
There is no reason that things shouldn't work, but you never know lol.


Expected outcome Gif

temp gif.gif
temp gif.gif (1.88 MiB) Viewed 1465 times


Code: Select all

;***************************************************************************************************
;***************************************************************************************************
;***************************************************************************************************
#Include <My Altered Gdip Lib>  ;<------       Replace with your copy of GDIP
;***************************************************************************************************
;***************************************************************************************************
;***************************************************************************************************
#SingleInstance, Force
SetBatchLines, -1
OnExit, GuiClose
global Always := 1
Settings := {SLV1:10,SLV2:10,CDV:2,SLP1:68,SLP2:68,BackH:0,PlusH:0,MinusH:0}
BGMain := New LayeredWindow( x := "" , y := "" , w := 300 , h := 200 , window := 1 , title := "Toggle Clicker v2" , smoothing := 2 , options := "+AlwaysOnTop -DPIScale" , autoShow := 1 , GdipStart := 1 , WinMover := "" , BackgroundColor := "" )
BBrush := Gdip_BrushCreateSolid( "0xFF880000" ), BPen := Gdip_CreatePen( "0xFF555555" , 1 ), BP := []
Loop, 50
	BP.Push({X:Ran(-10,300),Y:Ran(-10,200),W:Ran(5,30),Phase:Ran(0,1),Co:Ran(0,3),Max: Max:=Ran(10,50),Min:Ran(3,Max)})
BannerWin := New LayeredWindow( x := 30 , y := 0 , w := 240 , h := 40 , window := 2 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0 , WinMover := "" , BackgroundColor := "" )
Banner := {Bitmap1:BannerTag("Wash Your Hands"),Bitmap2:BannerTag("HB Toggle Clicker"),X:20,Y:0,W:160,H:30,Dir1:1,Dir2:1,PhaseCo:0,Phase:1}
Gdip_DrawImage(BannerWin.G, Banner.Bitmap2, Banner.X, Banner.Y, Banner.W, Banner.H) 
BannerWin.UpdateWindow()
Bit:=Banner.Bitmap2
Gui,2:Add,Text,x0 y0 w300 h30 BackgroundTrans gMoveWin
InnerWin1 := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 3 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0 , WinMover := "" , BackgroundColor := "0x22000000" )
INPen1 := Gdip_CreatePen( "0xFF440000" , 1 )
Gdip_DrawRectangle(InnerWin1.G, INPen1,0, 0, InnerWin1.W-1, InnerWin1.H-1)
Gdip_DrawImage(InnerWin1.G, TogClButtSet1(), 0, 0, InnerWin1.W, InnerWin1.H) 
Gdip_DrawImage(InnerWin1.G, AlwaysSwitch(Always), 0, 0, InnerWin1.W, 30) 
Gdip_DisposeImage( AlwaysBit )
Gui,3:Add,Text,x10 y7 w20 h20 BackgroundTrans gSetAlways
InnerWin1.UpdateWindow()
Butts := []
Gui,3:Add,Text,x30 y35 w220 h30 BackgroundTrans hwndhwnd gHotkeysWindow
Butts[hwnd]:=1
Gui,3:Add,Text,x30 y75 w220 h30 BackgroundTrans hwndhwnd gClickSpeedWindow
Butts[hwnd]:=2
Gui,3:Add,Text,x30 y115 w220 h30 BackgroundTrans hwndhwnd gMoreOptionsWindow
Butts[hwnd]:=3
Mins := New LayeredWindow( x := 0 , y := 0 , w := 300 , h := 30 , window := 4 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0  )
Gdip_DrawImage(Mins.G, MinAndCloseButtons(), 0, 0, 300, 30)
Mins.UpdateWindow()
Gui,4:Add,Text,x5 y5 w20 h20 BackgroundTrans hwndhwnd gMinWin
Gui,4:Add,Text,x275 y5 w20 h20 BackgroundTrans hwndhwnd gGuiClose
SetTimer, Hover, 50
SetTimer, BannerM, 50
SetTimer, Ani, 100
return
GuiClose:
GuiContextMenu:
*ESC::
	BGMain.DeleteWindow(1)
	ExitApp

AdjustSlider1:
	Coordmode,Mouse,Client
	tty:=999
	SetTimer,CSHover, Off
	While(GetKeyState("LButton")){
		MouseGetPos,tx,ty2
		if(tty=ty2){
			sleep,50
			continue
		}
		tty:=ty2
		(ty2<84)?(ty2:=84):(ty2>144)?(ty2:=144)
		if(A_GuiControl="sl1"){
			Settings.SLV1 := ((ty2-84)//(60//20)-20)*-1
			(Settings.SLV1=0)?(Settings.SLV1:=1)
			Settings.SLP1 := ty2-45
		}else{
			Settings.SLV2 := ((ty2-84)//(60//20)-20)*-1
			(Settings.SLV2=0)?(Settings.SLV2:=1)
			Settings.SLP2 := ty2-45
		}
		gosub, SWDRAW
		sleep, 50
	}
	SetTimer,CSHover, 50
	return

MinWin:
	Gui,1:Minimize
	return
	
SetAlways:
	Gui,% (Always:=!Always)?("1:+AlwaysOnTop"):("1:-AlwaysOnTop")
	gosub, DefallMain
	return
	
Ran(Min,Max){
	Random, Out, Min, Max
	return Out
}

Hover:
	MouseGetPos,,,,ctrl,2
	if(Butts[ctrl]&&!Active){
		LCtrl := ctrl,Active := Butts[ctrl]
		gosub, DefallMain
	}else if(Butts[LCtrl]!=Butts[ctrl]&&Active){
		Active := 0
		gosub, DefallMain
	}
	return

DefallMain:
	InnerWin1.ClearWindow()
	Gdip_DrawImage(InnerWin1.G, WiniBit := TogClButtSet1(Active), 0, 0, InnerWin1.W, InnerWin1.H) 
	Gdip_DrawRectangle(InnerWin1.G, INPen1,0, 0, InnerWin1.W-1, InnerWin1.H-1)
	Gdip_DrawImage(InnerWin1.G, AlwaysBit := AlwaysSwitch(Always), 0, 0, InnerWin1.W, 30) 
	InnerWin1.UpdateWindow()
	Gdip_DisposeImage( WiniBit )
	Gdip_DisposeImage( AlwaysBit )
	return

MoveWin:
	PostMessage, 0xA1, 2,,,Toggle Clicker v2
	return

HotkeysWindow:
	ToolTip, here in hotkeys
	return

ClickSpeedWindow:
	Gui,3:Hide
	CSWHandles := "", CSWHandles := []
	SpeedWindow := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 5 , title := " " , smoothing := 4 , options := "+Parent1 -DPIScale" , autoShow := 1 , GdipStart := 0  , "" , BackgroundColor := "" )
	SpeedWindow.Draw( ClickWindow(Settings) , Positions := {x:0,y:0,w:280,h:150} , update := 1 , disposeBitmap := 1  , PaintBackground := 0)
	Gui,5:Add,Text,x28 y30 w22 h82 BackgroundTrans vsl1 gAdjustSlider1
	Gui,5:Add,Text,x229 y30 w22 h82 BackgroundTrans vsl2 gAdjustSlider1
	Gui,5:Add,Text,x80 y110 w120 h30 BackgroundTrans hwndhwnd gSpeedBack
	CSWHandles[hwnd] := 1
	Gui,5:Add,Text,x80 y40 w30 h30 BackgroundTrans vCWMV hwndhwnd gSpeedDur
	CSWHandles[hwnd] := 2
	Gui,5:Add,Text,x170 y40 w30 h30 BackgroundTrans vCWPV hwndhwnd gSpeedDur
	CSWHandles[hwnd] := 3
	SetTimer,Hover, Off
	SetTimer,CSHover, 50
	return

SpeedDur:
	rd:=1
	(A_GuiControl="CWMV")?((--Settings.CDV=0)?(Settings.CDV:=1,rd:=0)):((++Settings.CDV=4)?(Settings.CDV:=3,rd:=0))
	if(rd)
		gosub, SWDRAW
	return

SpeedBack:
	SetTimer,Hover, On
	SetTimer,CSHover, Off
	SpeedWindow.DeleteWindow()
	CWActive := CWLCtrl := Settings.BackH := Settings.PlusH := Settings.MinusH := 0
	gosub, DefallMain
	Gui,3:Show
	return

CSHover:
	MouseGetPos,,,,ctrl,2
	if(CSWHandles[ctrl]&&!CWActive){
		(CSWHandles[ctrl]=1)?(Settings.BackH:=1):(CSWHandles[ctrl]=2)?(Settings.MinusH:=1):(CSWHandles[ctrl]=3)?(Settings.PlusH:=1)
		CWActive:=CSWHandles[ctrl]
		CWLCtrl := ctrl
		gosub, SWDRAW
	}else if(CWLCtrl!=ctrl&&CWActive){
		CWActive := CWLCtrl := Settings.BackH := Settings.PlusH := Settings.MinusH := 0
		gosub, SWDRAW
	}
	return

SWDRAW:
	SpeedWindow.ClearWindow()
	SpeedWindow.Draw( ClickWindow(Settings) , Positions := {x:0,y:0,w:280,h:150} , update := 1 , disposeBitmap := 1 )
	return

MoreOptionsWindow:
	ToolTip, here in Options
	return
	
BannerM:
	(Banner.Dir1=1&&Banner.X>=10)?(Banner.X-=2):(Banner.Dir1=1&&Banner.X<10)?(Banner.Dir1:=2)
	(Banner.Dir1=2&&Banner.X<=70)?(Banner.X+=3):(Banner.Dir1=2&&Banner.X>70)?(Banner.Dir1:=1)
	(Banner.Dir2=1&&Banner.Y<=10)?(Banner.Y+=.3):(Banner.Dir2=1&&Banner.Y>10)?(Banner.Dir2:=2)
	(Banner.Dir2=2&&Banner.Y>=2)?(Banner.Y-=.3):(Banner.Dir2=2&&Banner.Y<2)?(Banner.Dir2:=1)
	(++Banner.PhaseCo>30)?(Banner.PhaseCo:=0,(Banner.Phase=1)?(Bit:=Banner.Bitmap2,Banner.Phase:=2):(Bit:=Banner.Bitmap1,Banner.Phase:=1))
	BannerWin.ClearWindow()
	Gdip_DrawImage(BannerWin.G, Bit, Banner.X, Banner.Y, Banner.W, Banner.H)
	BannerWin.UpdateWindow()
	return
	
Ani:
	BGMain.PaintBackground( BackgroundColor := "0x19171719" )
	loop, % BP.Length(){
		(BP[A_Index].Phase=1&&BP[A_Index].W<BP[A_Index].Min)?(BP[A_Index].Phase := 0):(BP[A_Index].Phase=0&&BP[A_Index].W>BP[A_Index].Max)?(BP[A_Index].Phase := 1 , BP[A_Index].Co += 1)
		(BP[A_Index].Phase=1)?(BP[A_Index].X += 1,BP[A_Index].Y += 1,BP[A_Index].W -= 2,BP[A_Index].H -= 2):(BP[A_Index].X -= 1,BP[A_Index].Y -= 1,BP[A_Index].W += 2,BP[A_Index].H += 2)
		(BP[A_Index].Co>4)?(BP[A_Index] := {X:Ran(-10,300),Y:Ran(-10,200),W:Ran(5,30),Phase:Ran(0,1),Co:Ran(0,3),Max: Max:=Ran(10,50),Min:Ran(3,Max)})
		Brush3 := Gdip_CreateLineBrushFromRect( BP[A_Index].x, BP[A_Index].y, BP[A_Index].w, BP[A_Index].w , "0xff660000" , "0xff000000" , 1 , 1 )
		Gdip_FillEllipse(BGMain.G, Brush3, BP[A_Index].x, BP[A_Index].y, BP[A_Index].w, BP[A_Index].w)
		Gdip_DeleteBrush( Brush3 )
		Gdip_DrawRectangle(BGMain.G, BPen,0, 0, 299, 199)
	}
	BGMain.UpdateWindow()
	return

ClickWindow(obj){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 150 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Pen := Gdip_CreatePen( "0xFF440000" , 1 )
	Gdip_DrawRectangle( G , Pen , 0 , 0 , 279 , 149 )
	Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 13 , 2 , 51 , 141 , "0x99440000" , "0x99aa0000" , 1 , 1 )
	Pen := Gdip_CreatePenFromBrush( Brush , 1 )
	Gdip_DeleteBrush( Brush )
	Gdip_DrawRoundedRectangle( G , Pen , 14 , 5 , 50 , 138 , 5 )
	Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 24 , 11 , 29 , 14 , "0xFF777777" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Min" , "s16  Center Bold c" Brush " x13 y7" , "Segoe ui" , 50 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 25 , 10 , 29 , 16 , "0xFFff0000" , "0xFF440000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Min" , "s16 Center Bold c" Brush " x14 y8" , "Segoe ui" , 50 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 28 , 30 , 22 , 82 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 28 , 30 , 22 , 82 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 28 , 29 , 25 , 84 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 29 , 31 , 20 , 80 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 39 , 34 , 7 , 72 , "0xaa441111" , "0xaaffffff" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 38 , 35 , 2 , 72 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFffffff" )
	Gdip_TextToGraphics( G , obj.SLV1 , "s16 Center  Bold c" Brush " x14 y116" , "Segoe ui" , 50 , 20 )
	Gdip_DeleteBrush( Brush )
	;Slider 1 thumb
	Brush := Gdip_CreateLineBrushFromRect( 31 , obj.SLP1 , 16 , 8 , "0xFF111111" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 31 , obj.SLP1 , 16 , 8 , 3 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 32 , obj.SLP1+1 , 14 , 7 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 32 , obj.SLP1+1 , 14 , 7 , 3 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 213 , 5 , 53 , 138 , "0x99440000" , "0x99aa0000" , 1 , 1 )
	Pen := Gdip_CreatePenFromBrush( Brush , 1 )
	Gdip_DeleteBrush( Brush )
	Gdip_DrawRoundedRectangle( G , Pen , 215 , 5 , 50 , 138 , 5 )
	Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 24 , 11 , 29 , 14 , "0xFF777777" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Max" , "s16 Center  Bold c" Brush " x214 y7" , "Segoe ui" , 50 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 223 , 12 , 33 , 14 , "0xFFff0000" , "0xFF440000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Max" , "s16 Center  Bold c" Brush " x215 y8" , "Segoe ui" , 50 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 229 , 31 , 23 , 80 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 229 , 30 , 22 , 82 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 28 , 29 , 25 , 84 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 230 , 31 , 20 , 80 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 39 , 34 , 7 , 72 , "0xaa441111" , "0xaaffffff" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 239 , 35 , 2 , 72 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFffffff" )
	Gdip_TextToGraphics( G , obj.SLV2 , "s16 Center  Bold c" Brush " x215 y116" , "Segoe ui" , 50 , 20 )
	Gdip_DeleteBrush( Brush )
	;Slider 2 thumb
	Brush := Gdip_CreateLineBrushFromRect( 232 , obj.SLP2 , 16 , 8 , "0xFF111111" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 232 , obj.SLP2 , 16 , 8 , 3 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 233 , obj.SLP2+1 , 14 , 7 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 233 , obj.SLP2+1 , 14 , 7 , 3 )
	Gdip_DeleteBrush( Brush )
	;Back Button
	Brush := Gdip_CreateLineBrushFromRect( 81 , 113 , 120 , 28 , (obj.BackH=0)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 80 , 110 , 120 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (obj.BackH=0)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 81 , 111 , 118 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "< Back " , "s16 Center vCenter Bold c" Brush " x79 y110" , "Segoe ui" , 120 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 121 , 117 , 38 , 12 , (obj.BackH=0)?("0xFF880000"):("0xFF000000") , (obj.BackH=0)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "< Back " , "s16 Center vCenter Bold c" Brush " x80 y111" , "Segoe ui" , 120 , 30 )
	Gdip_DeleteBrush( Brush )
	;Minus
	Brush := Gdip_CreateLineBrushFromRect( 80 , 40 , 28 , 27 , (obj.MinusH=0)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 80 , 40 , 30 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (obj.MinusH=0)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 81 , 41 , 28 , 28 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "_" , "s36 Center vCenter Bold c" Brush " x80 y25" , "Segoe ui" , 30 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 87 , 53 , 14 , 6 , (obj.MinusH=0)?("0xFF880000"):("0xFF000000") , (obj.MinusH=0)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "_" , "s36 Center vCenter Bold c" Brush " x81 y26" , "Segoe ui" , 30 , 30 )
	Gdip_DeleteBrush( Brush )
	;Plus
	Brush := Gdip_CreateLineBrushFromRect( 170 , 41 , 29 , 28 , (obj.PlusH=0)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 170 , 40 , 30 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (obj.PlusH=0)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 171 , 41 , 28 , 28 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "+" , "s22 Center vCenter Bold c" Brush " x171 y39" , "Segoe ui" , 30 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 179 , 49 , 11 , 11 , (obj.PlusH=0)?("0xFF880000"):("0xFF000000") , (obj.PlusH=0)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "+" , "s22 Center vCenter Bold c" Brush " x172 y40" , "Segoe ui" , 30 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Click Duration" , "s16 Center vCenter Bold c" Brush " x0 y0" , "Segoe ui" , 280 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 85 , 15 , 109 , 16 , "0xFFff0000" , "0xFF440000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Click Duration" , "s16 Center vCenter Bold c" Brush " x1 y1" , "Segoe ui" , 280 , 50 )
	Gdip_DeleteBrush( Brush )
	;CD
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	;CD
	Gdip_TextToGraphics( G , (obj.CDV=1)?("Short"):(obj.CDV=2)?("Med"):("Long") , "s16 Center vCenter Bold c" Brush " x110 y30" , "Segoe ui" , 60 , 50 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}	

AlwaysSwitch(val := 1){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 30 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 10 , 7 , 15 , 15 )
	Gdip_DeleteBrush( Brush )
	if(val=1)
		Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0xFF990000" , "0xFF000000" , 1 , 1 )
	else
		Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0x66171719" , "0x66000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 11 , 8 , 13 , 13 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "AlwaysOnTop" , "s16  vCenter Bold c" Brush " x27 y0" , "Segoe ui" , 150 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 29 , 7 , 107 , 16 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "AlwaysOnTop" , "s16  vCenter Bold c" Brush " x28 y1" , "Segoe ui" , 150 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

MinAndCloseButtons(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 300 , 30 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 4 )
	;min ;x5 y5 w20 h20
	Brush := Gdip_BrushCreateSolid( "0x88666666" )
	Gdip_FillEllipse( G , Brush , 5 , 5 , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0x88171719" )
	Gdip_FillEllipse( G , Brush , 6 , 6 , 18 , 18 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Gdip_TextToGraphics( G , "_" , "s28 Center vCenter Bold c" Brush " x5 y-7" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Gdip_TextToGraphics( G , "_" , "s28 Center vCenter Bold c" Brush " x6 y-6" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	;close ;x275 y5 w20 h20
	Brush := Gdip_BrushCreateSolid( "0x88888888" )
	Gdip_FillEllipse( G , Brush , 275 , 5 , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0x88171719" )
	Gdip_FillEllipse( G , Brush , 276 , 6 , 18 , 18 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Gdip_TextToGraphics( G , "x" , "s16 Center vCenter Bold c" Brush " x275 y4" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Gdip_TextToGraphics( G , "x" , "s16 Center vCenter Bold c" Brush " x276 y5" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

BannerTag(txt := "Wash Your Hands" ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 160 , 30 ),G := Gdip_GraphicsFromImage( pBitmap ),Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0xFF888888" )
	Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , 157 , 26 , 4 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0xFF333333" )
	Brush := Gdip_BrushCreateSolid( "0xFF171719" )
	Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , 155 , 24 , 3 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Gdip_TextToGraphics( G , txt , "s16 Center vCenter Bold c" Brush " x-1 y0" , "Segoe ui" , 160 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Gdip_TextToGraphics( G , txt , "s16 Center vCenter Bold c" Brush " x0 y1" , "Segoe ui" , 160 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

TogClButtSet1(value:=0){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 150 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	;Hotkeys
	Brush := Gdip_CreateLineBrushFromRect( 29 , 36 , 221 , 28 , (Value=1)?("0xFFaa0000"):("0xFF880000")  , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 35 , 220 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=1)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 36 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Hotkeys" , "s16 Center vCenter Bold c" Brush " x30 y35" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 109 , 38 , 72 , 14 , (Value=1)?("0xFF000000"):("0xFF880000") , (Value=1)?("0xFF880000"):("0xFF000000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Hotkeys" , "s16 Center vCenter Bold c" Brush " x31 y36" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	;Click Speed
	Brush := Gdip_CreateLineBrushFromRect( 30 , 74 , 219 , 29 ,(Value=2)?("0xFFaa0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 75 , 220 , 30 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=2)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 76 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Click Speed" , "s16 Center vCenter Bold c" Brush " x30 y75" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 92 , 77 , 94 , 17 ,(Value=2)?("0xFF000000"):("0xFF880000") ,(Value=2)?("0xFF880000"):("0xFF000000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Click Speed" , "s16 Center vCenter Bold c" Brush " x31 y76" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	;More Options
	Brush := Gdip_CreateLineBrushFromRect( 31 , 115 , 216 , 27 ,(Value=3)?("0xFFaa0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 115 , 220 , 30 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=3)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 116 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "More Options" , "s16 Center vCenter Bold c" Brush " x30 y115" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	if(Value=3)
		Brush := Gdip_CreateLineBrushFromRect( 87 , 116 , 105 , 18 , "0xFF000000" , "0xFF880000" , 1 , 1 )
	else
		Brush := Gdip_CreateLineBrushFromRect( 87 , 116 , 105 , 18 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "More Options" , "s16 Center vCenter Bold c" Brush " x31 y116" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap 
}

;***********************************************************************************************************************************************************************
;***																																								 ***
;***																		Layered Window Class																	 ***
;***																																								 ***
;***********************************************************************************************************************************************************************

class LayeredWindow	{
;LayeredWindow class By: Hellbent
	__New( x := 0 , y := 0 , w := 100 , h := 100 , window := 1 , title := " " , smoothing := 4 , options := "" , autoShow := 1 , GdipStart := 0 , WinMover := "" , BackgroundColor := "" ){
		This.X := x , This.Y := y , This.W := w , This.H := h 
		This.Window := window , This.Title := title
		This.Options := options , This.Smoothing := smoothing
		( GdipStart ) ? ( This.Token := Gdip_Startup() )
		This._CreateWindow()
		( autoShow ) ? ( This.ShowWindow() )
		This._SetUpdateLayeredWindow()
		( WinMover ) ? ( This._AddMoveTrigger( WinMover ) )
		( BackgroundColor ) ? ( This.PaintBackground( BackgroundColor , 1 ) )
	}
	_CreateWindow(){
		Gui , % This.Window ": New" , % " +E0x80000 +LastFound -Caption " This.Options 
		This.Hwnd := WinExist()
		This.hbm := CreateDIBSection( This.W , This.H )
		This.hdc := CreateCompatibleDC()
		This.obm := SelectObject( This.hdc , This.hbm )
		This.G := Gdip_GraphicsFromHDC( This.hdc )
		Gdip_SetSmoothingMode( This.G , This.Smoothing )
	}
	_SetUpdateLayeredWindow(){
		UpdateLayeredWindow( This.hwnd , This.hdc , This.X , This.Y , This.W , This.H )
	}
	UpdateWindow(){
		UpdateLayeredWindow( This.hwnd , This.hdc )
	}
	ShowWindow( update := 1 , Position := "" ){ 
		if( !Position )
			Gui , % This.Window ": Show" , % "w" This.W " h" This.H  , % ( This.Title ) ? ( This.Title ) : ( "" )
		else
			Gui , % This.Window ": Show" , % "x" Position.X " y" Position.Y "w" Position.W " h" Position.H  , % ( This.Title ) ? ( This.Title )  : ( "" )
		( update ) ? ( This.UpdateWindow() )
	}
	_AddMoveTrigger( positons ){ 
		local hwnd , bd
		Gui , % This.Window " : Add" , Text , % "x" positons.x " y" positons.y " w" positons.w " h" positons.h " hwndhwnd"
		This.MoveHwnd := hwnd
		bd := This._WindowMover.Bind( This )
		GuiControl , % This.Window ": +G" , % This.MoveHwnd , % bd
	}
	_WindowMover(){ 
		PostMessage, 0xA1 , 2
	}
	PaintBackground( BackgroundColor := "0xFF000000" , update := 0){ 
		local Brush
		This.BackgroundColor := BackgroundColor
		Brush := Gdip_BrushCreateSolid( BackgroundColor )
		Gdip_FillRectangle( This.G , Brush , 0 , 0 , This.W , This.H )
		Gdip_DeleteBrush( Brush )
		( update ) ? ( This.UpdateWindow() )
	}
	Draw( pBitmap , Positions := "" , update := 1 , disposeBitmap := 0  , PaintBackground := 0){ 
	(PaintBackground) ? ( This.PaintBackground( This.BackgroundColor ) )	
		Gdip_DrawImage( This.G 
						, pBitmap 
						, ( Positions.X1 ) ? ( Positions.X1 ) : ( Positions.X ) ? ( Positions.X ) : ( "" )
						, ( Positions.Y1 ) ? ( Positions.Y1 ) : ( Positions.Y ) ? ( Positions.Y ) : ( "" ) 
						, ( Positions.W1 ) ? ( Positions.W1 ) : ( Positions.W ) ? ( Positions.W ) : ( "" ) 
						, ( Positions.H1 ) ? ( Positions.H1 ) : ( Positions.H ) ? ( Positions.H ) : ( "" ) 
						, ( Positions.X2 ) ? ( Positions.X2 ) : ( Positions.SX ) ? ( Positions.SX ) : ( "" )
						, ( Positions.Y2 ) ? ( Positions.Y2 ) : ( Positions.SY ) ? ( Positions.SY ) : ( "" )
						, ( Positions.W2 ) ? ( Positions.W2 ) : ( Positions.SW ) ? ( Positions.SW ) : ( "" )
						, ( Positions.H2 ) ? ( Positions.H2 ) : ( Positions.SH ) ? ( Positions.SH ) : ( "" ) )
		( update ) ? ( This.UpdateWindow() )
		( disposeBitmap ) ? ( Gdip_DisposeImage( pBitmap ) )
	}
	ClearWindow( update := "" ){ 
		Gdip_GraphicsClear( This.G )
		( update ) ? ( This.UpdateWindow() )
	}
	Add_Trigger(PositionObject,Label:="GuiClose"){
		Gui, % This.Window ": Add", Text, % "x" PositionObject.X " y" PositionObject.Y " w" PositionObject.W " h" PositionObject.H " g" Label " BackgroundTrans"
	}
	Draw_Text(PosObj,Text,Font:="Arial",FontSize:="12",Color1:="0xFFFFFFFF",Color2:="",PosObj2:="",update:=0){
		local Brush
		(!color2&&color2!="000000")?(Color2:=Color1)
		(StrLen(Color1)=6)?( Color1 := "0xFF" Color1 )
		(StrLen(Color2)=6)?( Color2 := "0xFF" Color2 )
		(PosObj2="")?(PosObj2:=PosObj)
		Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , PosObj2.W , PosObj2.H , Color1 , Color2 , 1 , 1 )
		Gdip_TextToGraphics(This.G, Text, "s" FontSize " c" Brush " Center vCenter Bold x" PosObj.X " y" PosObj.Y, Font , PosObj.W, PosObj.H)
		Gdip_DeleteBrush( Brush )
		( update ) ? ( This.UpdateWindow() )
	}
	Draw_Rectangle(Thickness:="5",PosObj:="",Color1:=0xFFFFFFFF,Color2:="",PosObj2:="",update:=0){
		local Brush, pPen
		(!color2)?(Color2:=Color1)
		(StrLen(Color1)=6)?( Color1 := "0xFF" Color1 )
		(StrLen(Color2)=6)?( Color2 := "0xFF" Color2 )
		(PosObj2="")?(PosObj2:=PosObj)
		Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , PosObj2.W , PosObj2.H , Color1 , Color2 , 1 , 1 )
		pPen := Gdip_CreatePenFromBrush(Brush, Thickness)
		Gdip_DrawRectangle( This.G, pPen, PosObj.X , PosObj.Y , PosObj.W , PosObj.H )
		Gdip_DeleteBrush( Brush )
		Gdip_DeletePen(pPen)
		( update ) ? ( This.UpdateWindow() )
	}
	DeleteWindow( TurnOffGdip := 0 ){
		SelectObject( This.hdc , This.obm )
		DeleteObject( This.hbm )
		DeleteDC( This.hdc )
		Gdip_DeleteGraphics( This.G )
		( TurnOffGdip && This.Token ) ? ( Gdip_Shutdown( This.Token ) )
		Gui, % This.Window " : Destroy"
	}
}
Thanks again!
Last edited by Hellbent on 22 Jun 2020, 16:43, edited 1 time in total.
User avatar
JoeWinograd
Posts: 2200
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Verification of correct operation of a custom gui slider.

22 Jun 2020, 14:38

Hellbent wrote:There is no reason that things shouldn't work, but you never know lol.
Hi Hellbent,

Same config as last itme:
W10 64-bit v1909
AHK U64 1.1.32.00

Tested on two monitors at 100%:
2560x1440
1920x1080

Worked perfectly again on both monitors. I don't know if you intend the Short/Med/Long setting to affect clicking, but, as far as I can tell, it does not. Regards, Joe
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Verification of correct operation of a custom gui slider.

22 Jun 2020, 14:44

JoeWinograd wrote:
22 Jun 2020, 14:38
I don't know if you intend the Short/Med/Long setting to affect clicking, but, as far as I can tell, it does not. Regards, Joe
Thanks Joe.

The Short/Med/Long setting will be used for SetMouseDelay
User avatar
JoeWinograd
Posts: 2200
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Verification of correct operation of a custom gui slider.

22 Jun 2020, 15:03

Hellbent wrote:The Short/Med/Long setting will be used for SetMouseDelay
Got it!
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Verification of correct operation of a custom gui slider.

17 Nov 2020, 21:58

Finally almost done with this project after about 10 months since I first started it. Would love to know if everything works correctly as it stands.

Code: Select all

;***************************************************************************************************
;***************************************************************************************************
;***************************************************************************************************
#Include <My Altered Gdip Lib>  ;<------       Replace with your copy of GDIP
;***************************************************************************************************
;***************************************************************************************************
;#Include Toggle Clicker v2.1 Assets.ahk ; Added to the bottom of this script.
;***************************************************************************************************
;Credits: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=77617&p=337602#p337602
#SingleInstance, Force
SetBatchLines, -1
SetMouseDelay, 10
OnExit, GuiClose

;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global LongClick := 30
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


global  LBB64 := "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAW/SURBVGhD1VlJSCVHGC59LuP63J47aHQUorjdxHHU5CKEmBySQYQRhYAHD4KHnDSggaAHQXJxuelBcDkIcSEewnjxIiIowTEqqOCaPMUXHeJe+f561Z2ejNHuZ/cz74Oi/qqu/qu+rvrr/6uLWYWoqKjXNpvtGiIPDAz8y13rY4iNjf3Gz89PkPD3979MTU197X7iQ4iPj3+BwSskThwOx6fuJz6GkJCQN8h4QEDAZWJi4gt3rQ8CS2oPGQ8NDf3ZXeMd+MvcNIDABuU3NzfFCQkJcaLSFwEbqULGKWG3WkpJSflIPPBFhIeHDyITZGArR0lJSS/FA18DZsIWGRnZA3sRZOBPTrKzs9PcT30QcIpfYwsWZKKjo79311oDm8xNQVlZ2TMY+Se3t7dfYUnVQf788vJSzARmJz4sLCw1IiIiKTk52XV8fOwSL/2fAKf3EoMck6GImIGHEvzNb3a7/bv8/PwElJ8WMOLnIPCLYgvahC/PQVAtk3xXO9jPOxDqqKioCEXZ+4C/qMTy+ROiGBAI8fr6ej4+Ps4PDg44ob+/Xx3w3t4ePz095bOzs7y1tZXD+NVnlKDr17S0tGzI3gOCwM8oGIRI8RRvamriTqdTEOjt7eU1NTW8sbHxAyJawI745OQkz83NVdtA1x5m2TtksrKy4vD1/oBI61wMhgjU1dXRV1UHVVVVdS8RBRcXF4K00i44OHilvLz8GWRrgbXfhUx0OjAwwNfW1ji8tzoQJeklokBLBn18i9w6tLS02PDFjiDykpISfnV1xXNyctQBaJNRIufn5zwzM1O0DQoK2kJuCIaCxrGxsVwshRiSa2tr2fDwMFtZWRHPHgt8INbQ0CBk8j0fA6KgE4aIwBbUMAP7PxsdHZUlc4BZlhJj+/v7z6WoC4aIaMNybLdsfn5elswBbENKwskaOgIYIrK9vX0sRYYlxg4PD2XJHMBhSomxjY0NpxR1wRARrN1bKTKXy9pQCfYvJX0wRATOK0mKlsNoX4aIaEE2YjaMzoIWhoisr6+rRoFTIKuurqajrax5PLQ2gm19X4q64LGNTE1Nsb6+PmHwq6urbHBwkDU3N7PKykqxNWdkZMiW+kA6RkZGVDKPmZ0HgXVLHkt4X0o4f3CE37ytrY1PT0/zzc1NjsMUOWqBuzw7Pcfux2dmZnhXVxfHrHIctNR2SpJ9WYN/E7krIbzg6enpvLCwUA05KFEog6hZBJZ3nUsoaestJYJBfolMdNTT0yPCd0QS/zkwPSkxMVHEZd3d3Rwhj1oPnfRbSTf+sS59IOU/kbC8vMzy8vJIZEdHR2xxcVHEXVhebHd3l52dnYkEu6IPIDaH6OhohoEzHKAYDlbifcyS0EEgnQUFBbLEvkCacIsmQ7u0lpaWxJo3E6RT0W90aXnsR6wAuEjJODz2I8o2aSa0Or3mR6yG0dkxRATrVo1/HrMM9EDblx4YIgJndiNFy2G0L0NEsLX+LkWG87qUzANt1Qq2trbUvvTAEBH4gBMpsp2dHSmZB61OnEbVvvTAEBEEgm/9/d2vLCwsiNxMKDqpD4Q3b0XBKsBLLyHjiHDJh5kK0km6ZR/Wwm630z2H6HBubk4O4fEgXYpe2Ye1QHyUZrPZxH/f0tLS98J2T0H/gUkX6UR0fInI2Tu3W5GRkT8iEx13dHTI4XiOzs5OdTakbu8A542I4OBg+q1J9xt8aGhIDsk46F3l5zfpLC4utotOvIWoqKhCkBD3I3S10N7ezq+vr+XwHga1pXfoXdJBukinUO5tYIusRKBH+70YTFFREZ+YmLiXED2jNtRWeQ9kTkgXZI/x6BDW4XDku1yuMXhl9YKGDkv0EwJGS9dzog5ndobzBsNZ/T3Hh612DXbxyul0LsuqpwPd/8XFxXVgUO9QVL/0fYna4sT4w5PdHd4HHGHtsbGxTWFhYW9guB/c8FIdPYuJiWmitqgzCYz9DSZxG9YnpFN7AAAAAElFTkSuQmCC"
, RBB64 := "iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAXDSURBVGhD1VpLSGRHFC1ttaOtdrftX6H9NozidyWOg5KNEDCBkDAIIwoBFy4EF1lpQANBF4Jk42enC8HPQogf4iKMGzfiQmNwjAoqiK3RieMnxE+3lXOrq5vu0Wg/fa/HPlDUrVv1bt37Xt26t957TGuEh4f/i4rrdDqHyWR64+IGIdLT09+EhoZegeQhISEOi8XynasnCJGQkPA5jPkAkqN2JCYmvnT1BCGSk5NfhoWFiScTGRn51sUNUkRFRf2KipbYnoujHkJlrTmSkpLinU5nGdEwaFMwgw1paWmZ2L2WQXIq8JEa0RFMSElJeQXfeA9SGBEdHT0kOoIJNpvNivghdiv4BY+Nje3Fk9G5eoMIZrP5R1S05XIEw29cXG2g+t3JycmxQvEa3Pnay8vLrx0ORwLnnIGXAl6ZXq9/AR8xFBcX7+3s7DjkZc8DhYWFSUaj8QfEhz/RFL7wUKHUxWAwjCNYvkL706KqqioKBnTCD/5B00dR8gko6WkTHRMT4zOGCo2DQb9hU8hBO/CwWq027EZ/gPQoBefmbW1tfG5ujp+dnfG9vT1P38DAAFYY5/v7+3xiYoI3NDSQAZ5+yDpFfKkGHTjg7tmw5ik6CyXy8/P51NQUv7m5Ecq68bEhTU1NvLa2lvf19QmDjo6OeHNzs9gMaAzqKySZX4DWHpWVlZ/BYVdBislJOTi1VN0XHxtSU1PjaeMJ8Pr6emEQ3QT4l5t/mJubGw9aW2Cdf49KTEpG3If7DHEXRH2+vr7OBwcHPTzM0Y1aW0RERGyj4tnZ2fzi4kKqfDf8MYRKXl4ev76+5uXl5aKNJ/6+tbVVUWhQlDS+AK6urqxENzY2Mkwo+E/F6uoqGxkZYXV1daKNpRo3Pj6eLxp+QpEhdrvds0Xi7klKHYyNjVE8ki3G4DvihvkLRYYgFnicEOtYUupgYWGBYTuWLVfaL0m/oMiQzc3NI0kyBDJJqYODgwNaUrLFGNKXvyXpFxQZAv+VlDY4OTmRFGPwxRtJ+gVFhiDwpUhScyidS5Eh3tDi6Xj7iFIoMgTbpF2SqvoI0nr2+vVrhtOj5DC2sbFxIEm/8CgfISNGR0fZ2tqaaPuLrKwsscVWV1ezlpYWNjQ0JGSQo/f397Pp6Wk5UrmPKALWbSMqEX3dJTU1leNu8u7ubj47O8ux23Cn00mB/c7sl0D9W1tbfGZmhre3t3McB+h84iNXzqUNvA2hc4Sb9i7Ep4QQWaxIPdx8SmlwKuQZGRkcaY7PNXcVTQ2BkvQaR0yElIL39PSI/Ck5OfmWIv4WMhyZj0jne3t7PXwY+xVqv6HUY8mQX4hYXl72SSl2d3fZysoKQyZLwYxSDHZ8fMzOz89pvVOyKZyZCjJelpmZyfDEWGlpKbNYLEIGXe8l80uUSRepMryXFgyRK149kEy3fKVL61nFkafgWcQRN7xlBiSOBAJBnWt53yilcykyBIHMKUnNoXQuRYZsb2//JUmxpaoNnNslxRgiv2cuf6DIEJza6M26AMUNteEtE0HWM5c/UGQI0ox3oaGuSxYXF0WtJtwyaQ4kmO9EQysgQosvT4jAFMNUBckk2XIObWE0GsU3Dyrz8/NShaeDZLnlyjm0BTJYK7Jb8Zm5oqLi1vvex4DSepJFMnU63VVBQYGiV0GPRmxs7M+oxMRdXV1Sncejs7PT8zSk7MCgrKzMqNfrxatTOnsMDw9LlZSDrsVTEEaQTJxX1H1h9hBMJlMxFDgFKT4LdHR0cIfDIdV7GDSWrnF/UiBZJFMIDzSwHVdDEfHVlkpJSQmfnJy81yDqozE01n0dksUPJAv0o/HkFDY+Pr7w9PR0HJHeJln0R5B4wVBUVMRwphc8u93OlpaWGM71PoEPW+06dqlvDw8Pf5esTwf6lmg2m3+CUre+Jf5fobG4CZ10LdrPC1ar1RgXF9dsMBjewnHFD2fehXjUh6NtM40FTyUw9h8RjRjTQAd6dQAAAABJRU5ErkJggg=="

global ToggleClicker := New TCV2


return
GuiClose:
GuiContextMenu:
ESC::
	ToggleClicker.MainWindow.DeleteWindow(1)
	ExitApp


Numpad3::
	Reload
	return




class TCV2	{

	__New(){
			
			;Set Default Object Values
			This._ObjectSetup()
			
			
			;Create all the window objects
			This._CreateWindows()
			;Add Window controls
			This._AddControls()
			;Setup the binds for all the timers
			This._SetUpTimers()
			
			
			;Setup the blob object and start the blob animation
			This._SetUpBlobObject()
			This._ToggleTimers(This.BlobTimer,50)
			
			;Setup Banner object and start animation
			This._SetUpBannerWindowObject()
			This._ToggleTimers(This.BannerTimer,50)
			
			;Draw Main Window Controls and start control hover timer
			This._DrawWindows(Window := 1, Value := 0)
			This._ToggleTimers(This.HoverTimer,50)
			
			;Add Min and Close Buttons
			This._AddMinAndClose()
		}

	_ObjectSetup(){
			This.Buttons := []
			This.AlwaysState := 1
			This.CurrentWindow := 1
			This.LastCtrl := ""
			This.Active := 0
			This.HKTog := 0
			This.STime := 0
			This.CDelay := 0
			
			;Test clicker active state color change
			This.StateColor := 1
			
			;Settings
			This.MouseButtonHwnds := []
			This.MouseButton := 1 ;(1 = left, 2 = right)
			;~ This.HotkeyDisplayValue := "Alt + a"
			This.HotkeyDisplayValue := "z"
			;~ This.LastHotkeyDisplayValue := "Alt + a"
			This.LastHotkeyDisplayValue := "z"
			
			;~ This.HotkeyValue := "!a"
			This.HotkeyValue := "z"
			;~ This.LastHotkeyValue := "!a"
			This.LastHotkeyValue := "z"
			Hotkey, % This.HotkeyValue, TF, On
			
			
			;Sliders
			This.SliderTrigger := []
			This.SliderValue1 := 10
			This.SliderValue2 := 10
			This.SliderPosition1 := 68
			This.SliderPosition2 := 68
			This.ClickDurationValue := 2 ;(1=Fast,2=Med,3=Long)
			
			;Options
			This.SoundState := 1
			This.AutoSaveState := 1
			
		}

	_Data(){
			ToolTip, In Saved Data
	}

	_CreateWindows(){
			;This main window containing the blobs
			This.MainWindow := New LayeredWindow( x := "" , y := "" , w := 300 , h := 200 , window := 1 , title := "Toggle Clicker v2" , smoothing := 2 , options := "+AlwaysOnTop -DPIScale" , autoShow := 1 , GdipStart := 1 , WinMover := "" , BackgroundColor := "" )
			;The moving title window
			This.BannerWindow := New LayeredWindow( x := 30 , y := 0 , w := 240 , h := 40 , window := 2 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0 )
			;The inner window containing all the main window controls
			This.MainWindowControls := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 3 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0 )
			;The Minimize and close buttons
			This.MinsCloseWindow := New LayeredWindow( x := 0 , y := 0 , w := 300 , h := 30 , window := 4 , title := " " , smoothing := 2 , options := "-DPIScale +Parent1" , autoShow := 1 , GdipStart := 0 )
			;The hotkey window
			This.HotkeyWindow := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 5 , title := " " , smoothing := 2 , options := "+Parent1 -DPIScale" , autoShow := 1 , GdipStart := 0 )
			;The Click speed options window
			This.SpeedWindow := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 6 , title := " " , smoothing := 2 , options := "+Parent1 -DPIScale" , autoShow := 1 , GdipStart := 0 )
			;The More Options window
			This.MoreOptionsWindow := New LayeredWindow( x := 10 , y := 40 , w := 280 , h := 150 , window := 7 , title := " " , smoothing := 2 , options := "+Parent1 -DPIScale" , autoShow := 1 , GdipStart := 0 )
			Gui,5:Hide
			Gui,6:Hide
			Gui,7:Hide
		}

	_AddMinAndClose(){
			This.MinsCloseWindow.Draw( MinAndCloseButtons() , Positions := {x:0,y:0,w:300,h:30} , update := 1 , disposeBitmap := 1  , PaintBackground := 0)
			This.MinsCloseWindow.ShowWindow()
		}

	_AddControls(){
			local bd, hwnd
			
			;Banner control (move Window)
			Gui,2:Add,Text,x0 y0 w240 h30 hwndhwnd 
			bd := This._MoveWindow.Bind( This )
			GuiControl, 2: +G , % hwnd , % bd
			
			;Minimize and Close Buttons
			Gui,4:Add,Text,x5 y5 w20 h20 hwndhwnd 
			bd := This._MinimizeWindow.Bind( This )
			GuiControl, 4: +G , % hwnd , % bd
			
			Gui,4:Add,Text,x275 y5 w20 h20 hwndhwnd 
			bd := This._CloseWindow.Bind( This )
			GuiControl, 4: +G , % hwnd , % bd
			
			;Main Window Controls (Buttons and always switch)
			Gui,3:Add,Text,x10 y7 w130 h20 BackgroundTrans hwndhwnd
			bd := This._SetAlways.Bind( This )
			GuiControl, 3: +G , % hwnd , % bd
			
			Gui,3:Add,Text,x30 y35 w220 h30 hwndhwnd 
			This.Buttons[hwnd] := 1
			bd := This._SwitchWindows.Bind( This )
			GuiControl, 3: +G , % hwnd , % bd
			
			Gui,3:Add,Text,x30 y75 w220 h30 hwndhwnd 
			This.Buttons[hwnd] := 2
			bd := This._SwitchWindows.Bind( This )
			GuiControl, 3: +G , % hwnd , % bd
			
			Gui,3:Add,Text,x30 y115 w220 h30 hwndhwnd 
			This.Buttons[hwnd] := 3
			bd := This._SwitchWindows.Bind( This )
			GuiControl, 3: +G , % hwnd , % bd
			
			;Hotkeys Window Controls
			;--------------------------------------------------------------------------------------
			Gui,5:Add,Text, x25 y110 w120 h30 hwndhwnd 
			This.Buttons[hwnd] := 4
			bd := This._SwitchWindows.Bind( This )
			GuiControl, 5: +G , % hwnd , % bd

			Gui,5:Add,Text, x30 y15 w110 h15 hwndhwnd 
			This.MouseButtonHwnds[hwnd] := 1
			bd := This._SetClickButton.Bind( This )
			GuiControl, 5: +G , % hwnd , % bd
			
			Gui,5:Add,Text, x150 y15 w110 h15 hwndhwnd 
			This.MouseButtonHwnds[hwnd] := 2
			bd := This._SetClickButton.Bind( This )
			GuiControl, 5: +G , % hwnd , % bd
			
			Gui,5:Add,Hotkey,x10 y65 w130 h30 hwndhwnd 
			This.HKHwnd := hwnd
			bd := This._SetUpHK.Bind( This )
			GuiControl, 5: +G , % hwnd , % bd
			
			;Click Speed window controls
			;----------------------------------------------------------------------------------------
			Gui,6:Add,Text,x28 y30 w22 h82 hwndhwnd 
			This.SliderTrigger[hwnd] := 1
			bd := This._AdjustSlider.Bind( This )
			GuiControl, 6: +G , % hwnd , % bd
			
			Gui,6:Add,Text,x229 y30 w22 h82 hwndhwnd 
			This.SliderTrigger[hwnd] := 2
			bd := This._AdjustSlider.Bind( This )
			GuiControl, 6: +G , % hwnd , % bd
			
			Gui,6:Add,Text,x80 y110 w120 h30 hwndhwnd 
			This.Buttons[hwnd] := 5
			bd := This._SwitchWindows.Bind( This )
			GuiControl, 6: +G , % hwnd , % bd
			
			Gui,6:Add,Text,x80 y40 w30 h30 hwndhwnd 
			This.Buttons[hwnd] := 6
			bd := This._SetClickDuration.Bind( This )
			GuiControl, 6: +G , % hwnd , % bd
			
			Gui,6:Add,Text,x170 y40 w30 h30 hwndhwnd 
			This.Buttons[hwnd] := 7
			bd := This._SetClickDuration.Bind( This )
			GuiControl, 6: +G , % hwnd , % bd
			
			;More Options Window Controls
			Gui,7:Add,Text,x50 y25 w180 h23 hwndhwnd ;gShareClickerLink
			This.Buttons[hwnd] := 8
			bd := This._ShareLink.Bind( This )
			GuiControl, 7: +G , % hwnd , % bd
			
			Gui,7:Add,Text,x50 y55 w180 h23 hwndhwnd ;gMoreClickers
			This.Buttons[hwnd] := 9
			bd := This._MoreClickers.Bind( This )
			GuiControl, 7: +G , % hwnd , % bd
			
			Gui,7:Add,Text,x50 y85 w180 h23 hwndhwnd ;gAdvancedOptions
			This.Buttons[hwnd] := 10
			bd := This._AdvancedOptions.Bind( This )
			GuiControl, 7: +G , % hwnd , % bd
			
			Gui,7:Add,Text,x50 y115 w180 h23 hwndhwnd ;gMoreOptionsWindowBack
			This.Buttons[hwnd] := 11
			bd := This._SwitchWindows.Bind( This )
			GuiControl, 7: +G , % hwnd , % bd
			
			
			
			Gui,7:Add,Text,x10 y5 w80 h15 hwndhwnd ;gSounds
			bd := This._ToggleSounds.Bind( This )
			GuiControl, 7: +G , % hwnd , % bd
			
			Gui,7:Add,Text,x164 y5 w100 h15 hwndhwnd ;gAutoSave
			bd := This._ToggleAutoSave.Bind( This )
			GuiControl, 7: +G , % hwnd , % bd
		}
		
	_SetUpHK(){
			GuiControlGet, tempout,5:, % This.HKHwnd 
			This.HotkeyDisplayValue := tempout
			This.HotkeyDisplayValue := StrReplace(This.HotkeyDisplayValue, "+" , "Shift + ")
			This.HotkeyDisplayValue := StrReplace(This.HotkeyDisplayValue, "!" , "Alt + ")
			This.HotkeyDisplayValue := StrReplace(This.HotkeyDisplayValue, "^" , "Ctrl + ")
			if(This.HotkeyDisplayValue != ""){
				This.HotkeyValue := tempout
			}else{
				This.HotkeyValue := ""
			}
			This._DrawWindows()
		}

	_TestHK2(){
			static togg:=1
			if(togg:=!togg){
				HK := This.HK
				Hotkey, Numpad1,% HK, Off
				ToolTip, Hotkey 1 off
			}else{
				HK := This.HK
				Hotkey, Numpad1,% HK, On
				ToolTip, Hotkey 1 on
			}
			This._ToggleTimers(This.Tooltips,1000)
		}

	_ToggleAutoSave(){
			if(This.AutoSaveState:=!This.AutoSaveState){
				ToolTip, Auto Save On
			}else{
				ToolTip, Auto Save OFF
			}
			This._ToggleTimers(This.Tooltips,1000)
			This._DrawWindows()
		}

	_ToggleSounds(){
			if(This.SoundState:=!This.SoundState){
				ToolTip, Sounds ON
			}else{
				ToolTip, Sounds OFF
			}
			This._ToggleTimers(This.Tooltips,1000)
			This._DrawWindows()
		}

	_ShareLink(){
			;Place video link here once the video is complete
			ToolTip, In share link
			This._ToggleTimers(This.Tooltips,1000)
		}

	_MoreClickers(){
			Try{
				run, https://www.youtube.com/playlist?list=PLPI5C2_hIGGw7poIqgox3rDnyocwTxcY_
			}catch{
				Msgbox,Unable to run Auto Clicker Youtube Page
			}
		}

	_AdvancedOptions(){
			Tooltip, in advanced options
			This._ToggleTimers(This.Tooltips,1000)
		}
		
	_SetHotkey(){
			
		}
		
	_SetClickDuration(){
			local ctrl, rd:=1
			MouseGetPos,,,,ctrl,2
			(This.Buttons[ctrl]=6)?((--This.ClickDurationValue=0)?(This.ClickDurationValue:=1,rd:=0)):((++This.ClickDurationValue=4)?(This.ClickDurationValue:=3,rd:=0))
			if(rd)
				This._DrawWindows()
		}
		
	_AdjustSlider(){
			local ctrl, activeSlider, tty, tx, ty2
			This._ToggleTimers(This.HoverTimer,"Off")
			MouseGetPos,,,,ctrl,2
			activeSlider := This.SliderTrigger[ctrl]
			Coordmode,Mouse,Client
			tty := 999
			While(GetKeyState("LButton")){
				MouseGetPos,tx,ty2
				if(tty=ty2){
					sleep,50
					continue
				}
				tty:=ty2
				(ty2<84)?(ty2:=84):(ty2>144)?(ty2:=144)
				if(activeSlider=1){
					This.SliderValue1 := ((ty2-84)//(60//20)-20)*-1
					(This.SliderValue1=0)?(This.SliderValue1:=1)
					This.SliderPosition1 := ty2-45
					if(GetKeyState("Shift")){
						This.SliderPosition2 := This.SliderPosition1 
						This.SliderValue2 := This.SliderValue1 
					}
				}else{
					This.SliderValue2 := ((ty2-84)//(60//20)-20)*-1
					(This.SliderValue2=0)?(This.SliderValue2:=1)
					This.SliderPosition2 := ty2-45
					if(GetKeyState("Shift")){
						This.SliderPosition1 := This.SliderPosition2 
						This.SliderValue1 := This.SliderValue2 
					}
				}
				This._DrawWindows()
				sleep, 50
			}
			This._ToggleTimers(This.HoverTimer,50)
		}
		
	_SetClickButton(){
			local ctrl
			MouseGetPos,,,,ctrl,2
			This.MouseButton := This.MouseButtonHwnds[ctrl]
			This._DrawWindows()
		}
		
	_MinimizeWindow(){
			Gui,1:Minimize
		}
		
	_CloseWindow(){
			This.MainWindow.DeleteWindow(1)
			ExitApp
		}

	_SetAlways(){
			Gui,% (This.AlwaysState:=!This.AlwaysState)?("1:+AlwaysOnTop",This._DrawWindows()):("1:-AlwaysOnTop",This._DrawWindows())
		}

	_SetUpTimers(){
			This.HoverTimer := HoverTimer := ObjBindMethod( This , "_ControlHoverTimer" )
			This.BlobTimer := BlobTimer := ObjBindMethod( This , "_AnimateBlobs" )
			This.BannerTimer := BannerTimer := ObjBindMethod( This , "_AnimateBanner" )
			This.Tooltips := Tooltips := ObjBindMethod( This , "_TooltipsOff" )
			
			This.HK := HK := ObjBindMethod( This , "_TestHK" )
			This.HK2 := HK2 := ObjBindMethod( This , "_TestHK2" )
			Hotkey, Numpad1,% HK, On
			Hotkey, Numpad2,% HK2, On
		}

	_TooltipsOff(){
			ToolTip,
			This._ToggleTimers(This.Tooltips,"Off")
	}

	_ToggleTimers(Timer,Value){
			CurrentTimer := Timer
			SetTimer, %CurrentTimer%, %Value%
	}

	_DrawWindows(){
			if(This.CurrentWindow=1){
				This.MainWindowControls.ClearWindow()
				This.Pen1 := Gdip_CreatePen( "0xFF440000" , 1 )
				Gdip_DrawRectangle(This.MainWindowControls.G, This.Pen1, 0, 0, This.MainWindowControls.W-1, This.MainWindowControls.H-1)
				Gdip_DeletePen( This.Pen1 )
				Gdip_DrawImage(This.MainWindowControls.G, This.AlwaysBit := AlwaysSwitch(This.AlwaysState), 0, 0, This.MainWindowControls.W, 30) 
				Gdip_DisposeImage( This.AlwaysBit )
				Gdip_DrawImage(This.MainWindowControls.G, This.ButtonsBit := TogClButtSet1(This.Active), 0, 0, This.MainWindowControls.W, This.MainWindowControls.H)
				Gdip_DisposeImage( This.ButtonsBit )
				This.MainWindowControls.ShowWindow()
			}else if(This.CurrentWindow=2){
				;~ Settings := {SLV1:10,SLV2:10,CDV:2,SLP1:68,SLP2:68,BackH:0,PlusH:0,MinusH:0,HKUpdate:This.Active,HKButton:1,MWShareLink:0,MoreClickers:0,AdvancedOptions:0,MOWBack:0,Sounds:1,AutoSave:1,HK:"Alt + a",LHK:"!a",HKValue:"!a"}
				;~ This.Settings := Settings
				This.HotkeyWindow.ClearWindow()
				This.HotkeyWindow.Draw( HKWindow(This) , Positions := {x:0,y:0,w:280,h:150} , update := 1 , disposeBitmap := 1  , PaintBackground := 0)
				This.HotkeyWindow.ShowWindow()
				;~ Gui, 5:-Disabled
				;~ Settings := "", This.Settings := ""
			}else if(This.CurrentWindow=3){
				This.SpeedWindow.ClearWindow()
				This.SpeedWindow.Draw( ClickWindow(This) , Positions := {x:0,y:0,w:280,h:150} , update := 1 , disposeBitmap := 1 )
				This.SpeedWindow.ShowWindow()
			}else if(This.CurrentWindow=4){
				This.MoreOptionsWindow.ClearWindow()
				This.MoreOptionsWindow.Draw( OptionsWindow(This) , Positions := {x:0,y:0,w:280,h:150} , update := 1 , disposeBitmap := 1  , PaintBackground := 0)
				This.MoreOptionsWindow.ShowWindow()
			}
		}

	_SwitchWindows(){
			local Ctrl
			This.Active := 0
			MouseGetPos,,,,ctrl,2
			If(This.CurrentWindow=1){
				Gui, 3:Hide
				This.CurrentWindow := This.Buttons[ctrl] + 1
			}else if(This.CurrentWindow=2){
				;~ Gui, 5:+Disabled
				Gui, 5:Hide
				This.CurrentWindow := 1
				if(This.LastHotkeyValue != ""){
					Hotkey, % This.LastHotkeyValue, TF, Off
					This.LastHotkeyValue := ""
				}
				if(This.HotkeyValue != ""){
					Hotkey, % This.HotkeyValue, TF, On
					This.LastHotkeyValue := This.HotkeyValue
				}
			}else if(This.CurrentWindow=3){
				Gui, 6:Hide
				This.CurrentWindow := 1
			}else if(This.CurrentWindow=4){
				Gui, 7:Hide
				This.CurrentWindow := 1
			}
			This._DrawWindows()
			
		}

	_SetUpBlobObject(){
			This.Blobs := []
			Loop, 50	
				This.Blobs.Push({X:This._Random(-10,300),Y:This._Random(-10,200),W:This._Random(5,30),Phase:This._Random(0,1),Co:This._Random(0,3),Max: Max:=This._Random(10,50),Min: This._Random(3,Max)})
			This.BackgroundBrush := Gdip_BrushCreateSolid( "0xFF880000" )
			This.BackgroundPen := Gdip_CreatePen( "0xFF440000" , 1 )
		}

	_SetUpBannerWindowObject(){
			This.BannerWindow.Bitmap1 := BannerTag("Wash Your Hands"), This.BannerWindow.Bitmap2 := BannerTag("HB Toggle Clicker"), This.Bit := This.BannerWindow.Bitmap2
			This.BannerWindow.X := 20, This.BannerWindow.Y := 0, This.BannerWindow.W := 160, This.BannerWindow.H := 30
			This.BannerWindow.Dir1 := 1, This.BannerWindow.Dir2 := 1
			This.BannerWindow.PhaseCo := 0, This.BannerWindow.Phase := 1
			Gdip_DrawImage(This.BannerWindow.G, This.BannerWindow.Bitmap2, This.BannerWindow.X, This.BannerWindow.Y, This.BannerWindow.W, This.BannerWindow.H) 
		}

	_AnimateBlobs(){
			This.MainWindow.PaintBackground( BackgroundColor := "0x19171719" )
			loop, % This.Blobs.Length(){
				(This.Blobs[A_Index].Phase=1&&This.Blobs[A_Index].W<This.Blobs[A_Index].Min)?(This.Blobs[A_Index].Phase := 0):(This.Blobs[A_Index].Phase=0&&This.Blobs[A_Index].W>This.Blobs[A_Index].Max)?(This.Blobs[A_Index].Phase := 1 , This.Blobs[A_Index].Co += 1)
				(This.Blobs[A_Index].Phase=1)?(This.Blobs[A_Index].X += 1,This.Blobs[A_Index].Y += 1,This.Blobs[A_Index].W -= 2,This.Blobs[A_Index].H -= 2):(This.Blobs[A_Index].X -= 1,This.Blobs[A_Index].Y -= 1,This.Blobs[A_Index].W += 2,This.Blobs[A_Index].H += 2)
				(This.Blobs[A_Index].Co>4)?(This.Blobs[A_Index] := {X:This._Random(-10,300),Y:This._Random(-10,200),W:This._Random(5,30),Phase:This._Random(0,1),Co:This._Random(0,3),Max: Max:=This._Random(10,50),Min:This._Random(3,Max)})
				Brush3 := Gdip_CreateLineBrushFromRect( This.Blobs[A_Index].x, This.Blobs[A_Index].y, This.Blobs[A_Index].w, This.Blobs[A_Index].w , "0xff660000" , "0xff000000" , 1 , 1 )
				Gdip_FillEllipse(This.MainWindow.G, Brush3, This.Blobs[A_Index].x, This.Blobs[A_Index].y, This.Blobs[A_Index].w, This.Blobs[A_Index].w)
				Gdip_DeleteBrush( Brush3 )
				Gdip_DrawRectangle(This.MainWindow.G, This.BackgroundPen,0, 0, 299, 199)
			}
			This.MainWindow.UpdateWindow()
		}

	_AnimateBanner(){
			(This.BannerWindow.Dir1=1&&This.BannerWindow.X>=10)?(This.BannerWindow.X-=2):(This.BannerWindow.Dir1=1&&This.BannerWindow.X<10)?(This.BannerWindow.Dir1:=2)
			(This.BannerWindow.Dir1=2&&This.BannerWindow.X<=70)?(This.BannerWindow.X+=3):(This.BannerWindow.Dir1=2&&This.BannerWindow.X>70)?(This.BannerWindow.Dir1:=1)
			(This.BannerWindow.Dir2=1&&This.BannerWindow.Y<=10)?(This.BannerWindow.Y+=.3):(This.BannerWindow.Dir2=1&&This.BannerWindow.Y>10)?(This.BannerWindow.Dir2:=2)
			(This.BannerWindow.Dir2=2&&This.BannerWindow.Y>=2)?(This.BannerWindow.Y-=.3):(This.BannerWindow.Dir2=2&&This.BannerWindow.Y<2)?(This.BannerWindow.Dir2:=1)
			(++This.BannerWindow.PhaseCo>30)?(This.BannerWindow.PhaseCo:=0,(This.BannerWindow.Phase=1)?(This.Bit:=This.BannerWindow.Bitmap2,This.BannerWindow.Phase:=2):(This.Bit:=This.BannerWindow.Bitmap1,This.BannerWindow.Phase:=1))
			This.BannerWindow.ClearWindow()
			if(This.StateColor=1){
				Gdip_DrawImage(This.BannerWindow.G, This.Bit, This.BannerWindow.X, This.BannerWindow.Y, This.BannerWindow.W, This.BannerWindow.H)
			}else{
				bitt := BannerTag("HB Toggle Clicker",This)
				;~ This.MoreOptionsWindow.Draw( BannerTag("HB Toggle Clicker",This) , Positions := {x:This.BannerWindow.X,y:This.BannerWindow.Y,w:This.BannerWindow.W,h:This.BannerWindow.H} , update := 1 , disposeBitmap := 1  , PaintBackground := 0)
				Gdip_DrawImage(This.BannerWindow.G, bitt, This.BannerWindow.X, This.BannerWindow.Y, This.BannerWindow.W, This.BannerWindow.H)
				Gdip_DisposeImage( Bitt )
			}
			This.BannerWindow.UpdateWindow()
		}

	_ControlHoverTimer(){
			local ctrl
			MouseGetPos,,,,ctrl,2
			if(This.Buttons[ctrl]&&!This.Active){
				This.LastCtrl := ctrl
				This.Active := This.Buttons[ctrl]
				This._DrawWindows()
			}else if(This.Buttons[This.LastCtrl]!=This.Buttons[ctrl]&&This.Active){
				This.Active := 0
				This._DrawWindows()
			}
			;~ ToolTip,% " in hover timer `n" This.Active "`n" This.LastCtrl 
		}

	_Random(Min,Max){
			random,Out,Min,Max
			return Out
		}

	_MoveWindow(){
		PostMessage, 0xA1, 2,,,Toggle Clicker v2
		This._ToggleTimers(This.HoverTimer,"Off")
		KeyWait, LButton
		This._ToggleTimers(This.HoverTimer,50)
	}
	
	ToggleFunctionality(){
		local hz := 600
		if(This.HKTog:=!This.HKTog){
			This._ToggleTimers(This.BlobTimer,"Off")
			This._ToggleTimers(This.BannerTimer,"Off")
			SoundBeep, 450
		}else{
			Loop, 3
				SoundBeep, % hz ;+= 50
			This._ToggleTimers(This.BlobTimer,50)
			This._ToggleTimers(This.BannerTimer,50)
		}
	}
	ClickFunctionality(){
		SetMouseDelay, % ttt := ((This.ClickDurationValue=1)?(-1):(This.ClickDurationValue=2)?(10):(LongClick))
		;~ This._ToggleTimers(This.BlobTimer,"Off")
		;~ This._ToggleTimers(This.BannerTimer,"Off")
		This.STime := A_TickCount
		This.CDelay := 1000 / This._Random(This.SliderValue1,This.SliderValue2)
		While(GetKeyState("LButton","P")){
			Sleep, 10
			if(Winactive("AHK_ID " This.MainWindow.Hwnd)){
				Gosub, TF
				break
			}
			if(This.STime+This.CDelay<=A_TickCount){
				;~ del := A_TickCount - (This.STime+This.CDelay)
				This.CDelay := (1000 / This._Random(This.SliderValue1,This.SliderValue2)) - (A_TickCount - (This.STime+This.CDelay))
				This.STime := A_TickCount
				Click,
			}
		}
		;~ This._ToggleTimers(This.BlobTimer,50)
		;~ This._ToggleTimers(This.BannerTimer,50)
	}
}


TF:
	ToggleClicker.ToggleFunctionality()
	return

#IF (ToggleClicker.HKTog)
~$LButton::
	ToggleClicker.ClickFunctionality()
	return
#IF


;***********************************************************************************************************************************************************************
;***																																								 ***
;***																		Layered Window Class																	 ***
;***																																								 ***
;***********************************************************************************************************************************************************************

class LayeredWindow	{
;LayeredWindow class By: Hellbent
	__New( x := 0 , y := 0 , w := 100 , h := 100 , window := 1 , title := " " , smoothing := 4 , options := "" , autoShow := 1 , GdipStart := 0 , WinMover := "" , BackgroundColor := "" ){
		This.X := x , This.Y := y , This.W := w , This.H := h 
		This.Window := window , This.Title := title
		This.Options := options , This.Smoothing := smoothing
		( GdipStart ) ? ( This.Token := Gdip_Startup() )
		This._CreateWindow()
		( autoShow ) ? ( This.ShowWindow() )
		This._SetUpdateLayeredWindow()
		( WinMover ) ? ( This._AddMoveTrigger( WinMover ) )
		( BackgroundColor ) ? ( This.PaintBackground( BackgroundColor , 1 ) )
	}
	_CreateWindow(){
		Gui , % This.Window ": New" , % " +E0x80000 +LastFound -Caption " This.Options 
		This.Hwnd := WinExist()
		This.hbm := CreateDIBSection( This.W , This.H )
		This.hdc := CreateCompatibleDC()
		This.obm := SelectObject( This.hdc , This.hbm )
		This.G := Gdip_GraphicsFromHDC( This.hdc )
		Gdip_SetSmoothingMode( This.G , This.Smoothing )
	}
	_SetUpdateLayeredWindow(){
		UpdateLayeredWindow( This.hwnd , This.hdc , This.X , This.Y , This.W , This.H )
	}
	UpdateWindow(){
		UpdateLayeredWindow( This.hwnd , This.hdc )
	}
	ShowWindow( update := 1 , Position := "" ){ 
		if( !Position )
			Gui , % This.Window ": Show" , % "w" This.W " h" This.H  , % ( This.Title ) ? ( This.Title ) : ( "" )
		else
			Gui , % This.Window ": Show" , % "x" Position.X " y" Position.Y "w" Position.W " h" Position.H  , % ( This.Title ) ? ( This.Title )  : ( "" )
		( update ) ? ( This.UpdateWindow() )
	}
	_AddMoveTrigger( positons ){ 
		local hwnd , bd
		Gui , % This.Window " : Add" , Text , % "x" positons.x " y" positons.y " w" positons.w " h" positons.h " hwndhwnd"
		This.MoveHwnd := hwnd
		bd := This._WindowMover.Bind( This )
		GuiControl , % This.Window ": +G" , % This.MoveHwnd , % bd
	}
	_WindowMover(){ 
		PostMessage, 0xA1 , 2
	}
	PaintBackground( BackgroundColor := "0xFF000000" , update := 0){ 
		local Brush
		This.BackgroundColor := BackgroundColor
		Brush := Gdip_BrushCreateSolid( BackgroundColor )
		Gdip_FillRectangle( This.G , Brush , 0 , 0 , This.W , This.H )
		Gdip_DeleteBrush( Brush )
		( update ) ? ( This.UpdateWindow() )
	}
	Draw( pBitmap , Positions := "" , update := 1 , disposeBitmap := 0  , PaintBackground := 0){ 
	(PaintBackground) ? ( This.PaintBackground( This.BackgroundColor ) )	
		Gdip_DrawImage( This.G 
						, pBitmap 
						, ( Positions.X1 ) ? ( Positions.X1 ) : ( Positions.X ) ? ( Positions.X ) : ( "" )
						, ( Positions.Y1 ) ? ( Positions.Y1 ) : ( Positions.Y ) ? ( Positions.Y ) : ( "" ) 
						, ( Positions.W1 ) ? ( Positions.W1 ) : ( Positions.W ) ? ( Positions.W ) : ( "" ) 
						, ( Positions.H1 ) ? ( Positions.H1 ) : ( Positions.H ) ? ( Positions.H ) : ( "" ) 
						, ( Positions.X2 ) ? ( Positions.X2 ) : ( Positions.SX ) ? ( Positions.SX ) : ( "" )
						, ( Positions.Y2 ) ? ( Positions.Y2 ) : ( Positions.SY ) ? ( Positions.SY ) : ( "" )
						, ( Positions.W2 ) ? ( Positions.W2 ) : ( Positions.SW ) ? ( Positions.SW ) : ( "" )
						, ( Positions.H2 ) ? ( Positions.H2 ) : ( Positions.SH ) ? ( Positions.SH ) : ( "" ) )
		( update ) ? ( This.UpdateWindow() )
		( disposeBitmap ) ? ( Gdip_DisposeImage( pBitmap ) )
	}
	ClearWindow( update := "" ){ 
		Gdip_GraphicsClear( This.G )
		( update ) ? ( This.UpdateWindow() )
	}
	Add_Trigger(PositionObject,Label:="GuiClose"){
		Gui, % This.Window ": Add", Text, % "x" PositionObject.X " y" PositionObject.Y " w" PositionObject.W " h" PositionObject.H " g" Label " BackgroundTrans"
	}
	Draw_Text(PosObj,Text,Font:="Arial",FontSize:="12",Color1:="0xFFFFFFFF",Color2:="",PosObj2:="",update:=0){
		local Brush
		(!color2&&color2!="000000")?(Color2:=Color1)
		(StrLen(Color1)=6)?( Color1 := "0xFF" Color1 )
		(StrLen(Color2)=6)?( Color2 := "0xFF" Color2 )
		(PosObj2="")?(PosObj2:=PosObj)
		Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , PosObj2.W , PosObj2.H , Color1 , Color2 , 1 , 1 )
		Gdip_TextToGraphics(This.G, Text, "s" FontSize " c" Brush " Center vCenter Bold x" PosObj.X " y" PosObj.Y, Font , PosObj.W, PosObj.H)
		Gdip_DeleteBrush( Brush )
		( update ) ? ( This.UpdateWindow() )
	}
	Draw_Rectangle(Thickness:="5",PosObj:="",Color1:=0xFFFFFFFF,Color2:="",PosObj2:="",update:=0){
		local Brush, pPen
		(!color2)?(Color2:=Color1)
		(StrLen(Color1)=6)?( Color1 := "0xFF" Color1 )
		(StrLen(Color2)=6)?( Color2 := "0xFF" Color2 )
		(PosObj2="")?(PosObj2:=PosObj)
		Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , PosObj2.W , PosObj2.H , Color1 , Color2 , 1 , 1 )
		pPen := Gdip_CreatePenFromBrush(Brush, Thickness)
		Gdip_DrawRectangle( This.G, pPen, PosObj.X , PosObj.Y , PosObj.W , PosObj.H )
		Gdip_DeleteBrush( Brush )
		Gdip_DeletePen(pPen)
		( update ) ? ( This.UpdateWindow() )
	}
	DeleteWindow( TurnOffGdip := 0 ){
		Gui, % This.Window " : Destroy"
		SelectObject( This.hdc , This.obm )
		DeleteObject( This.hbm )
		DeleteDC( This.hdc )
		Gdip_DeleteGraphics( This.G )
		( TurnOffGdip && This.Token ) ? ( Gdip_Shutdown( This.Token ) )
	}
}



;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
; Banner
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
BannerTag(txt := "Wash Your Hands" , OBJ := "" ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 160 , 30 ),G := Gdip_GraphicsFromImage( pBitmap ),Gdip_SetSmoothingMode( G , 2 )
	;~ Brush := Gdip_BrushCreateSolid( "0xFF888888" )
	Brush := Gdip_BrushCreateSolid((OBJ.StateColor=2)?("0xFFff0000"):(OBJ.StateColor=3)?("0xFFff0000"):("0xFF888888"))
	Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , 157 , 26 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF171719" )
	;~ Brush := Gdip_BrushCreateSolid( (OBJ.StateColor=2)?("0xFFFFFF00"):(OBJ.StateColor=3)?("0xFF00FF00"):("0xFF171719") )
	Gdip_FillRoundedRectangle( G , Brush , 2 , 3 , 155 , 24 , 3 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Brush := Gdip_BrushCreateSolid( (OBJ.StateColor=2)?("0xFFff0000"):(OBJ.StateColor=3)?("0xFFff0000"):("0xFFaaaaaa") )
	Gdip_TextToGraphics( G , txt , "s16 Center vCenter Bold c" Brush " x-1 y0" , "Segoe ui" , 160 , 30 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Brush := Gdip_BrushCreateSolid( (OBJ.StateColor=2)?("0xFFffff00"):(OBJ.StateColor=3)?("0xFF00FF00"):("0xFF770000") )
	Gdip_TextToGraphics( G , txt , "s16 Center vCenter Bold c" Brush " x0 y1" , "Segoe ui" , 160 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
; Always on top graphics
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
AlwaysSwitch(val := 1){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 30 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 10 , 7 , 15 , 15 )
	Gdip_DeleteBrush( Brush )
	if(val=1)
		;~ Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0xFF990000" , "0xFF000000" , 1 , 1 )
		Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	else
		Brush := Gdip_CreateLineBrushFromRect( 11 , 7 , 15 , 16 , "0x66171719" , "0x66000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 11 , 8 , 13 , 13 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "AlwaysOnTop" , "s16  vCenter Bold c" Brush " x27 y0" , "Segoe ui" , 150 , 30 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 29 , 7 , 107 , 16 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	;~ Brush := Gdip_CreateLineBrushFromRect( 29 , 7 , 107 , 16 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 29 , 7 , 107 , 16 , (val=1)?("0xFFff0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "AlwaysOnTop" , "s16  vCenter Bold c" Brush " x28 y1" , "Segoe ui" , 150 , 30 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
; Min and close button set
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
MinAndCloseButtons(){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 300 , 30 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 4 )
	;min ;x5 y5 w20 h20
	Brush := Gdip_BrushCreateSolid( "0x88666666" )
	Gdip_FillEllipse( G , Brush , 5 , 5 , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0x88171719" )
	Gdip_FillEllipse( G , Brush , 6 , 6 , 18 , 18 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Gdip_TextToGraphics( G , "_" , "s28 Center vCenter Bold c" Brush " x5 y-7" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Gdip_TextToGraphics( G , "_" , "s28 Center vCenter Bold c" Brush " x6 y-6" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	;close ;x275 y5 w20 h20
	Brush := Gdip_BrushCreateSolid( "0x88888888" )
	Gdip_FillEllipse( G , Brush , 275 , 5 , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0x88171719" )
	Gdip_FillEllipse( G , Brush , 276 , 6 , 18 , 18 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	Gdip_TextToGraphics( G , "x" , "s16 Center vCenter Bold c" Brush " x275 y4" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF770000" )
	Gdip_TextToGraphics( G , "x" , "s16 Center vCenter Bold c" Brush " x276 y5" , "Segoe ui" , 20 , 20 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
; Main window button set
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
TogClButtSet1(value:=0){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 150 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0x01777777" )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 280 , 150 )
	Gdip_DeleteBrush( Brush )
	;Hotkeys
	Brush := Gdip_CreateLineBrushFromRect( 29 , 36 , 221 , 28 , (Value=1)?("0xFFaa0000"):("0xFF880000")  , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 35 , 220 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=1)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 36 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Hotkeys" , "s16 Center vCenter Bold c" Brush " x30 y35" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 109 , 38 , 72 , 14 , (Value=1)?("0xFF000000"):("0xFF880000") , (Value=1)?("0xFF880000"):("0xFF000000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Hotkeys" , "s16 Center vCenter Bold c" Brush " x31 y36" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	;Click Speed
	Brush := Gdip_CreateLineBrushFromRect( 30 , 74 , 219 , 29 ,(Value=2)?("0xFFaa0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 75 , 220 , 30 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=2)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 76 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Click Speed" , "s16 Center vCenter Bold c" Brush " x30 y75" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 92 , 77 , 94 , 17 ,(Value=2)?("0xFF000000"):("0xFF880000") ,(Value=2)?("0xFF880000"):("0xFF000000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Click Speed" , "s16 Center vCenter Bold c" Brush " x31 y76" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	;More Options
	Brush := Gdip_CreateLineBrushFromRect( 31 , 115 , 216 , 27 ,(Value=3)?("0xFFaa0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 30 , 115 , 220 , 30 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (Value=3)?("0x44000000"):("0x44222222") )
	Gdip_FillRoundedRectangle( G , Brush , 31 , 116 , 218 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "More Options" , "s16 Center vCenter Bold c" Brush " x30 y115" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	if(Value=3)
		Brush := Gdip_CreateLineBrushFromRect( 87 , 116 , 105 , 18 , "0xFF000000" , "0xFF880000" , 1 , 1 )
	else
		Brush := Gdip_CreateLineBrushFromRect( 87 , 116 , 105 , 18 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "More Options" , "s16 Center vCenter Bold c" Brush " x31 y116" , "Segoe ui" , 218 , 28 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap 
}
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
; Hotkeys Window
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
HKWindow(obj){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 150 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	
	Brush := Gdip_BrushCreateSolid( "0x01777777" )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 280 , 150 )
	Gdip_DeleteBrush( Brush )
	
	
	Pen := Gdip_CreatePen( "0xFF440000" , 1 )
	Gdip_DrawRectangle( G , Pen , 0 , 0 , 279 , 149 )
	Gdip_DeletePen( Pen )
	Pen := Gdip_CreatePen( "0xFF440000" , 1 )
	Gdip_DrawRectangle( G , Pen , 10 , 5 , 259 , 31 )
	Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 30 , 15 , 15 , 15 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 30 , 15 , 15 , 15 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 31 , 16 , 14 , 12 , "0xffff0000" , "0xff000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 31 , 16 , 14 , 12 ,(obj.MouseButton=1)?("0xffff0000"):("0x55ff0000") , "0xff000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 31 , 16 , 13 , 13 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Left Click" , "s16 Center vCenter Bold c" Brush " x37 y-3" , "Segoe ui" , 100 , 50 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 53 , 16 , 70 , 12 , "0xFFff0000" , "0xFF440000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 53 , 16 , 70 , 12 , (obj.MouseButton=1)?("0xFFff0000"):("0xff880000") , (obj.MouseButton=1)?("0xFF440000"):("0xFF220000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Left Click" , "s16 Center vCenter Bold c" Brush " x38 y-2" , "Segoe ui" , 100 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 151 , 15 , 14 , 14 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 150 , 15 , 15 , 15 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 150 , 15 , 14 , 13 , "0x55ff0000" , "0xff000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 150 , 15 , 14 , 13 , (obj.MouseButton=2)?("0xffff0000"):("0x55ff0000")  , "0xff000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 151 , 16 , 13 , 13 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Right Click" , "s16 Center vCenter Bold c" Brush " x160 y-3" , "Segoe ui" , 100 , 50 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 179 , 21 , 82 , 13 , "0xff880000" , "0xFF220000" , 1 , 1 )
	;~ Brush := Gdip_CreateLineBrushFromRect( 179 , 21 , 82 , 13 , (obj.HKButton=2)?("0xFFff0000"):("0xff880000") , (obj.HKButton=2)?("0xFF440000"):("0xFF220000") , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 179 , 21 , 82 , 13 , (obj.MouseButton=2)?("0xFFff0000"):("0xff880000") , (obj.MouseButton=2)?("0xFF440000"):("0xFF220000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Right Click" , "s16 Center vCenter Bold c" Brush " x161 y-2" , "Segoe ui" , 100 , 50 )
	Gdip_DeleteBrush( Brush )
	;toggle text
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	;toggle text
	Gdip_TextToGraphics( G , "Toggle" , "s16 Center vCenter Bold c" Brush " x0 y27" , "Segoe ui" , 140 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 44 , 46 , 54 , 13 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Toggle" , "s16 Center vCenter Bold c" Brush " x1 y28" , "Segoe ui" , 140 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 11 , 64 , 130 , 32 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Pen := Gdip_CreatePenFromBrush( Brush , 1 )
	Gdip_DeleteBrush( Brush )
	Gdip_DrawRectangle( G , Pen , 10 , 65 , 130 , 30 )
	Gdip_DeletePen( Pen )
	;~ Brush := Gdip_BrushCreateSolid( "0xFFff0000" )
	Brush := Gdip_BrushCreateSolid( "0xFFffffff" )
	;~ Gdip_TextToGraphics( G , "Shift + Ctrl + A" , "s12 Center vCenter Bold c" Brush " x10 y65" , "Segoe ui" , 130 , 30 )
	Gdip_TextToGraphics( G , Obj.HotkeyDisplayValue , "s12 Center vCenter Bold c" Brush " x10 y65" , "Segoe ui" , 130 , 30 )
	Gdip_DeleteBrush( Brush )
	;Click text
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	;Click text
	Gdip_TextToGraphics( G , "Activate" , "s16 Center vCenter Bold c" Brush " x140 y27" , "Segoe ui" , 140 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 193 , 44 , 34 , 13 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Activate" , "s16 Center vCenter Bold c" Brush " x141 y28" , "Segoe ui" , 140 , 50 )
	Gdip_DeleteBrush( Brush )

	;Update Button ;<-----------------------------------------
	;~ Brush := Gdip_CreateLineBrushFromRect( 25 , 110 , 120 , 30 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 25 , 110 , 120 , 30 , (obj.Active=0)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 25 , 110 , 120 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0x44222222" )
	Brush := Gdip_BrushCreateSolid( (obj.Active=0)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 26 , 111 , 118 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "< Update" , "s16 Center vCenter Bold c" Brush " x25 y110" , "Segoe ui" , 120 , 30 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 49 , 120 , 76 , 12 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	;~ Brush := Gdip_CreateLineBrushFromRect( 49 , 120 , 76 , 12 , (obj.HKUpdate=0)?("0xFF880000"):("0xFF000000") , (obj.HKUpdate=0)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 49 , 115 , 76 , 22 , (obj.Active=0)?("0xFF880000"):("0xFF000000") , (obj.Active=0)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "< Update" , "s16 Center vCenter Bold c" Brush " x26 y111" , "Segoe ui" , 120 , 30 )
	Gdip_DeleteBrush( Brush )
	
	;~ pLB := Create_Sheets( LBB64 )
	Gdip_DrawImage(G, (obj.MouseButton=1)?(pLB := Create_Sheets( LBB64 )):(pLB := Create_Sheets( RBB64 )), 185, 70, 50, 50) ;, sx="", sy="", sw="", sh="", Matrix=1)
	Gdip_DisposeImage( pLB )
	Gdip_DeleteGraphics( G )
	return pBitmap
}
Create_Sheets( B65 ){
	local ptr , uptr , pBitmap
	VarSetCapacity(B64, strlen( B65 ) << !!A_IsUnicode)
	B64 := B65
	If !DllCall("Crypt32.dll\CryptStringToBinary" (A_IsUnicode ? "W" : "A"), Ptr := A_PtrSize ? "Ptr" : "UInt" , &B64, "UInt", 0, "UInt", 0x01, Ptr, 0, "UIntP", DecLen, Ptr, 0, Ptr, 0)
		Return False
	VarSetCapacity(Dec, DecLen, 0)
	If !DllCall("Crypt32.dll\CryptStringToBinary" (A_IsUnicode ? "W" : "A"), Ptr, &B64, "UInt", 0, "UInt", 0x01, Ptr, &Dec, "UIntP", DecLen, Ptr, 0, Ptr, 0)
		Return False
	DllCall("Kernel32.dll\RtlMoveMemory", Ptr, pData := DllCall("Kernel32.dll\GlobalLock", Ptr, hData := DllCall("Kernel32.dll\GlobalAlloc", "UInt", 2,  UPtr := A_PtrSize ? "UPtr" : "UInt" , DecLen, UPtr), UPtr) , Ptr, &Dec, UPtr, DecLen)
	DllCall("Kernel32.dll\GlobalUnlock", Ptr, hData)
	DllCall("Ole32.dll\CreateStreamOnHGlobal", Ptr, hData, "Int", True, Ptr "P", pStream)
	DllCall("Gdiplus.dll\GdipCreateBitmapFromStream",  Ptr, pStream, Ptr "P", pBitmap)
	return pBitmap
}

;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
; Click Speed Window
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
ClickWindow(obj){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 150 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Pen := Gdip_CreatePen( "0xFF440000" , 1 )
	Gdip_DrawRectangle( G , Pen , 0 , 0 , 279 , 149 )
	Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 13 , 2 , 51 , 141 , "0x99440000" , "0x99aa0000" , 1 , 1 )
	Pen := Gdip_CreatePenFromBrush( Brush , 1 )
	Gdip_DeleteBrush( Brush )
	Gdip_DrawRoundedRectangle( G , Pen , 14 , 5 , 50 , 138 , 5 )
	Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 24 , 11 , 29 , 14 , "0xFF777777" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Min" , "s16  Center Bold c" Brush " x13 y7" , "Segoe ui" , 50 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 25 , 10 , 29 , 16 , "0xFFff0000" , "0xFF440000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Min" , "s16 Center Bold c" Brush " x14 y8" , "Segoe ui" , 50 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 28 , 30 , 22 , 82 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 28 , 30 , 22 , 82 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 28 , 29 , 25 , 84 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 29 , 31 , 20 , 80 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 39 , 34 , 7 , 72 , "0xaa441111" , "0xaaffffff" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 38 , 35 , 2 , 72 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFffffff" )
	Gdip_TextToGraphics( G , obj.SliderValue1 , "s16 Center  Bold c" Brush " x14 y116" , "Segoe ui" , 50 , 20 )
	Gdip_DeleteBrush( Brush )
	;Slider 1 thumb
	Brush := Gdip_CreateLineBrushFromRect( 31 , obj.SliderPosition1 , 16 , 8 , "0xFF111111" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 31 , obj.SliderPosition1 , 16 , 8 , 3 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 32 , obj.SliderPosition1+1 , 14 , 7 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 32 , obj.SliderPosition1+1 , 14 , 7 , 3 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 213 , 5 , 53 , 138 , "0x99440000" , "0x99aa0000" , 1 , 1 )
	Pen := Gdip_CreatePenFromBrush( Brush , 1 )
	Gdip_DeleteBrush( Brush )
	Gdip_DrawRoundedRectangle( G , Pen , 215 , 5 , 50 , 138 , 5 )
	Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 24 , 11 , 29 , 14 , "0xFF777777" , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Max" , "s16 Center  Bold c" Brush " x214 y7" , "Segoe ui" , 50 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 223 , 12 , 33 , 14 , "0xFFff0000" , "0xFF440000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Max" , "s16 Center  Bold c" Brush " x215 y8" , "Segoe ui" , 50 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 229 , 31 , 23 , 80 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 229 , 30 , 22 , 82 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 28 , 29 , 25 , 84 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 230 , 31 , 20 , 80 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 39 , 34 , 7 , 72 , "0xaa441111" , "0xaaffffff" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 239 , 35 , 2 , 72 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFFffffff" )
	Gdip_TextToGraphics( G , obj.SliderValue2 , "s16 Center  Bold c" Brush " x215 y116" , "Segoe ui" , 50 , 20 )
	Gdip_DeleteBrush( Brush )
	;Slider 2 thumb
	Brush := Gdip_CreateLineBrushFromRect( 232 , obj.SliderPosition2 , 16 , 8 , "0xFF111111" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 232 , obj.SliderPosition2 , 16 , 8 , 3 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 233 , obj.SliderPosition2+1 , 14 , 7 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 233 , obj.SliderPosition2+1 , 14 , 7 , 3 )
	Gdip_DeleteBrush( Brush )
	;Back Button
	Brush := Gdip_CreateLineBrushFromRect( 81 , 113 , 120 , 28 , (obj.Active!=5)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 80 , 110 , 120 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( (obj.Active!=5)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 81 , 111 , 118 , 28 , 4 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "< Back " , "s16 Center vCenter Bold c" Brush " x79 y110" , "Segoe ui" , 120 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 121 , 117 , 38 , 12 , (obj.Active!=5)?("0xFF880000"):("0xFF000000") , (obj.Active!=5)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "< Back " , "s16 Center vCenter Bold c" Brush " x80 y111" , "Segoe ui" , 120 , 30 )
	Gdip_DeleteBrush( Brush )
	;Minus
	;~ Brush := Gdip_CreateLineBrushFromRect( 80 , 40 , 28 , 27 , (obj.MinusH=0)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 80 , 40 , 28 , 27 , (obj.Active!=6)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 80 , 40 , 30 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( (obj.MinusH=0)?("0x44222222"):("0x44000000") )
	Brush := Gdip_BrushCreateSolid( (obj.Active!=6)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 81 , 41 , 28 , 28 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "_" , "s36 Center vCenter Bold c" Brush " x80 y25" , "Segoe ui" , 30 , 30 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 87 , 53 , 14 , 6 , (obj.MinusH=0)?("0xFF880000"):("0xFF000000") , (obj.MinusH=0)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 87 , 53 , 14 , 6 , (obj.Active!=6)?("0xFF880000"):("0xFF000000") , (obj.Active!=6)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "_" , "s36 Center vCenter Bold c" Brush " x81 y26" , "Segoe ui" , 30 , 30 )
	Gdip_DeleteBrush( Brush )
	;Plus
	;~ Brush := Gdip_CreateLineBrushFromRect( 170 , 41 , 29 , 28 , (obj.PlusH=0)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 170 , 41 , 29 , 28 , (obj.Active!=7)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 170 , 40 , 30 , 30 , 5 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( (obj.PlusH=0)?("0x44222222"):("0x44000000") )
	Brush := Gdip_BrushCreateSolid( (obj.Active!=7)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 171 , 41 , 28 , 28 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "+" , "s22 Center vCenter Bold c" Brush " x171 y39" , "Segoe ui" , 30 , 30 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 179 , 49 , 11 , 11 , (obj.PlusH=0)?("0xFF880000"):("0xFF000000") , (obj.PlusH=0)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 179 , 49 , 11 , 11 , (obj.Active!=7)?("0xFF880000"):("0xFF000000") , (obj.Active!=7)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "+" , "s22 Center vCenter Bold c" Brush " x172 y40" , "Segoe ui" , 30 , 30 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Click Duration" , "s16 Center vCenter Bold c" Brush " x0 y0" , "Segoe ui" , 280 , 50 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 85 , 15 , 109 , 16 , "0xFFff0000" , "0xFF440000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Click Duration" , "s16 Center vCenter Bold c" Brush " x1 y1" , "Segoe ui" , 280 , 50 )
	Gdip_DeleteBrush( Brush )
	;CD
	Brush := Gdip_BrushCreateSolid( "0xFFaaaaaa" )
	;CD
	Gdip_TextToGraphics( G , (obj.ClickDurationValue=1)?("Short"):(obj.ClickDurationValue=2)?("Med"):("Long") , "s16 Center vCenter Bold c" Brush " x110 y30" , "Segoe ui" , 60 , 50 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}	
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
; More Options Window
;--------------------------------------------------------------------------------------------------------
;--------------------------------------------------------------------------------------------------------
OptionsWindow(OBJ){
	;Bitmap Created Using: HB Bitmap Maker
	pBitmap:=Gdip_CreateBitmap( 280 , 150 ) 
	G := Gdip_GraphicsFromImage( pBitmap )
	Gdip_SetSmoothingMode( G , 2 )
	Brush := Gdip_BrushCreateSolid( "0x01777777" )
	Gdip_FillRectangle( G , Brush , 0 , 0 , 280 , 150 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 12 , 12 , 11 , 13 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 10 , 5 , 15 , 15 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 11 , 6 , 13 , 13 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 11 , 6 , 13 , 13 , (obj.SoundState=1)?("0xFFff0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 11 , 6 , 13 , 13 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Sounds" , "s16 Center vCenter Bold c" Brush " x9 y-12" , "Segoe ui" , 100 , 50 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 10 , 6 , 100 , 13 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 10 , 6 , 100 , 13 , (obj.SoundState=1)?("0xFFff0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_TextToGraphics( G , "Sounds" , "s16 Center vCenter Bold c" Brush " x10 y-11" , "Segoe ui" , 100 , 50 )
	Gdip_DeleteBrush( Brush )
	;Button 1
	
	;~ Brush := Gdip_CreateLineBrushFromRect( 25 , 110 , 120 , 30 , (obj.HKUpdate=0)?("0xFF880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	
	
	;~ Brush := Gdip_CreateLineBrushFromRect( 50 , 30 , 180 , 23 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 50 , 25 , 180 , 23 ,(obj.Active!=8)?("0xff880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 50 , 25 , 180 , 23 , 5 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0x44222222" )
	Brush := Gdip_BrushCreateSolid( (obj.Active!=8)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 51 , 26 , 178 , 21 , 5 )
	Gdip_DeleteBrush( Brush )
	
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "<--  Share Link  -->" , "s16 Center vCenter Bold c" Brush " x50 y27" , "Segoe ui" , 180 , 23 )
	Gdip_DeleteBrush( Brush )
	
	;~ Brush := Gdip_CreateLineBrushFromRect( 49 , 115 , 76 , 22 , (obj.HKUpdate=0)?("0xFF880000"):("0xFF000000") , (obj.HKUpdate=0)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	;~ Brush := Gdip_CreateLineBrushFromRect( 65 , 33 , 146 , 8 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 65 , 33 , 146 , 8 , (obj.Active!=8)?("0xFF880000"):("0xFF000000") , (obj.Active!=8)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "<--  Share Link  -->" , "s16 Center vCenter Bold c" Brush " x51 y28" , "Segoe ui" , 180 , 23 )
	Gdip_DeleteBrush( Brush )
	
	
	
	;Button 2
	;~ Brush := Gdip_CreateLineBrushFromRect( 50 , 60 , 180 , 23 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 50 , 55 , 180 , 23 , (obj.Active!=9)?("0xff880000"):("0xFFAA0000")  , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 50 , 55 , 180 , 23 , 5 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0x44222222" )
	Brush := Gdip_BrushCreateSolid( (obj.Active!=9)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 51 , 56 , 178 , 21 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "More Free Auto Clickers" , "s14 Center vCenter Bold c" Brush " x50 y57" , "Segoe ui" , 180 , 23 )
	Gdip_DeleteBrush( Brush )
	
	
	;~ Brush := Gdip_CreateLineBrushFromRect( 60 , 64 , 161 , 8 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 60 , 64 , 161 , 8 ,  (obj.Active!=9)?("0xFF880000"):("0xFF000000") , (obj.Active!=9)?("0xFF000000"):("0xFF880000")  , 1 , 1 )
	Gdip_TextToGraphics( G , "More Free Auto Clickers" , "s14 Center vCenter Bold c" Brush " x51 y58" , "Segoe ui" , 180 , 23 )
	Gdip_DeleteBrush( Brush )
	
	
	
	;Button 3
	;~ Brush := Gdip_CreateLineBrushFromRect( 50 , 90 , 180 , 23 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 50 , 85 , 180 , 23 , (obj.Active!=10)?("0xff880000"):("0xFFAA0000")  , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 50 , 85 , 180 , 23 , 5 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0x44222222" )
	Brush := Gdip_BrushCreateSolid( (obj.Active!=10)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 51 , 86 , 178 , 21 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Advaced Options" , "s16 Center vCenter Bold c" Brush " x50 y87" , "Segoe ui" , 180 , 23 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 72 , 93 , 134 , 9 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 72 , 93 , 134 , 9 ,  (obj.Active!=10)?("0xFF880000"):("0xFF000000") , (obj.Active!=10)?("0xFF000000"):("0xFF880000")  , 1 , 1 )
	Gdip_TextToGraphics( G , "Advaced Options" , "s16 Center vCenter Bold c" Brush " x51 y88" , "Segoe ui" , 180 , 23 )
	Gdip_DeleteBrush( Brush )
	
	
	
	
	;Button 4
	;~ Brush := Gdip_CreateLineBrushFromRect( 50 , 120 , 180 , 23 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 50 , 115 , 180 , 23 , (obj.Active!=11)?("0xff880000"):("0xFFAA0000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRoundedRectangle( G , Brush , 50 , 115 , 180 , 23 , 5 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_BrushCreateSolid( "0x44222222" )
	Brush := Gdip_BrushCreateSolid( (obj.Active!=11)?("0x44222222"):("0x44000000") )
	Gdip_FillRoundedRectangle( G , Brush , 51 , 116 , 178 , 21 , 5 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "<Back" , "s16 Center vCenter Bold c" Brush " x50 y117" , "Segoe ui" , 180 , 23 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 109 , 121 , 59 , 11 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 109 , 121 , 59 , 11 , (obj.Active!=11)?("0xFF880000"):("0xFF000000") , (obj.Active!=11)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "<Back" , "s16 Center vCenter Bold c" Brush " x51 y118" , "Segoe ui" , 180 , 23 )
	Gdip_DeleteBrush( Brush )
	;------------------------------------------------------------
	
	
	Pen := Gdip_CreatePen( "0xFF880000" , 1 )
	Gdip_DrawRectangle( G , Pen , 0 , 0 , 279 , 149 )
	Gdip_DeletePen( Pen )
	Brush := Gdip_CreateLineBrushFromRect( 161 , 12 , 13 , 13 , "0xFF880000" , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 164 , 5 , 15 , 15 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_CreateLineBrushFromRect( 161 , 6 , 13 , 13 , (obj.AutoSaveState=1)?("0xFFff0000"):("0xFF880000") , "0xFF000000" , 1 , 1 )
	Gdip_FillRectangle( G , Brush , 165 , 6 , 13 , 13 )
	Gdip_DeleteBrush( Brush )
	Brush := Gdip_BrushCreateSolid( "0xFF777777" )
	Gdip_TextToGraphics( G , "Auto Save" , "s16 Center vCenter Bold c" Brush " x138 y-11" , "Segoe ui" , 170 , 50 )
	Gdip_DeleteBrush( Brush )
	;~ Brush := Gdip_CreateLineBrushFromRect( 141 , 8 , 131 , 13 , "0xFFff0000" , "0xFF000000" , 1 , 1 )
	Brush := Gdip_CreateLineBrushFromRect( 141 , 8 , 131 , 13 , (obj.AutoSaveState=1)?("0xFFff0000"):("0xFF000000") , (obj.AutoSaveState=1)?("0xFF000000"):("0xFF880000") , 1 , 1 )
	Gdip_TextToGraphics( G , "Auto Save" , "s16 Center vCenter Bold c" Brush " x139 y-10" , "Segoe ui" , 170 , 50 )
	Gdip_DeleteBrush( Brush )
	Gdip_DeleteGraphics( G )
	return pBitmap
}

Requires windows 8 or highter to run. Should be simple to figure out how to use / test. Questions are advised.
You should be able to figure it out without much problem or instruction.

gif
temp gif.gif
temp gif.gif (1.44 MiB) Viewed 587 times
User avatar
JoeWinograd
Posts: 2200
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Verification of correct operation of a custom gui slider.

17 Nov 2020, 22:20

Hi Hellbent,

W10 64-bit v1909 Build 18363.1198
AHK U64 1.1.33.02

Tested on two monitors at 100%:
2560x1440
1920x1080

Did not customize it in any way...tried everything as is...worked perfectly! Great job! Regards, Joe
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

Re: Verification of correct operation of a custom gui slider.

06 Dec 2020, 12:44

JoeWinograd wrote:
17 Nov 2020, 22:20
worked perfectly!
Thank you very much Joe!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, kingina, mcd and 189 guests