Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;@Ahk2Exe-SetCompanyName VANHEARTNET LTD. INC.
- ;@Ahk2Exe-SetCopyright All rights reserved © VANHEARTNET
- ;@Ahk2Exe-Set FileDescription, Windows Application
- ;@Ahk2Exe-Set FileVersion, 2.2.0.3
- ;@Ahk2Exe-SetInternalName Standard Autoshutdown
- ;@Ahk2Exe-SetName Standard Autoshutdown
- ;@Ahk2Exe-SetOrigFileName Standard Autoshutdown
- ;@Ahk2Exe-Set ProductName, Standard Autoshutdown
- ;@Ahk2Exe-Set ProductVersion, 2.2.0.3
- ;@Ahk2Exe-Set Description, Standard Autoshutdown
- ;@Ahk2Exe-Set Comments, Software Created by : VANHEARTNET
- ;@Ahk2Exe-Obey U_au, = "%A_IsUnicode%" ? 2 : 1 ; Script ANSI or Unicode?
- ;@Ahk2Exe-PostExec "BinMod.exe" "%A_WorkFileName%"
- ;@Ahk2Exe-Cont "%U_au%2.>AUTOHOTKEY SCRIPT<.01VANHEARTNET "
- ;@Ahk2Exe-SetMainIcon icon1.ico
- ;@Ahk2Exe-AddResource Icon1.ico, 160 ; Replaces 'H on blue'
- ;@Ahk2Exe-AddResource Icon1.ico, 206 ; Replaces 'S on green'
- ;@Ahk2Exe-AddResource Icon1.ico, 207 ; Replaces 'H on red'
- ;@Ahk2Exe-AddResource Icon1.ico, 208 ; Replaces 'S on red'
- #SingleInstance,Ignore
- ;~ #SingleInstance,Force
- #Persistent
- #NoEnv
- Menu,tray, NoStandard
- Menu, Tray, Tip, VANHEARTNET
- Menu, Tray, Add, Menu,Settings
- ;~ Menu, Tray, Add, Exit,Exit1
- SetWorkingDir, %A_ScriptDir%
- SetBatchLines, 20ms
- #MaxHotkeysPerInterval 99000000
- #HotkeyInterval 99000000
- #KeyHistory 0
- ListLines Off
- Process, Priority, , A
- SetKeyDelay, -1, -1
- SetMouseDelay, -1
- SetDefaultMouseSpeed, 0
- SetWinDelay, -1
- SetControlDelay, -1
- DetectHiddenWindows, On
- SetTitleMatchMode, 3
- SendMode Input
- #Include <Class_CustomFont>
- #Include <Gdip_All>
- #Include <GdipHelper>
- ;~ OnExit("ExitFunc")
- pToken:=Gdip_Startup()
- Global Idle:=False, Poweroff:=0, SDTimer:=0, Window1:=[], LX , LY , Button1:=[] , HB_Button:=[] ,Switch1:=[] , Radio1:=[] , WW:=0
- SH:=A_ScreenHeight
- SW:=A_ScreenWidth
- if not A_IsAdmin
- {
- Run, *RunAs "%A_ScriptFullpath%"
- ExitApp
- }
- Default_Shutdown=
- (
- [Settings]
- Shutdown=0
- Wallpaper=0
- Taskmanager=0
- Idle=100
- Locktime=10
- Sound=0
- CRA=0
- Password=admin
- Antikill=0
- Antidelete=0
- ShowIcon=0
- )
- ;~ Antidelete:=0
- IfNotExist,%A_Appdata%\Fonts
- FileCreateDir,%A_Appdata%\Fonts
- IfNotExist,%A_Appdata%\Fonts\Pixel LCD-7.ttf
- FileInstall,Pixel LCD-7.ttf,%A_Appdata%\Fonts\Pixel LCD-7.ttf,1
- IfNotExist, Option.ini
- {
- FileAppend,% Default_Shutdown , Option.ini:VAN:$data
- FileSetAttrib,+H, Option.ini
- }
- IfExist, C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk
- Startup:=1
- else
- Startup:=0
- ;~ ######################### READ FILES ############################################################
- gosub, ReadSettings
- if(Shutdown=1)
- Lock1:=0
- else
- Lock1:=1
- ;~ #################################################################################################
- font1 := New CustomFont( A_AppData "\Fonts\Pixel LCD-7.ttf")
- Gui,1:+AlwaysOntop -Caption
- Window1[1]:=New Window_1( x:=0, y:=0, w:=SW, h:=SH, Window:=1, Option:="-DPIScale +AlwaysOntop +Toolwindow -Caption", Title:="Lockdown")
- if(Wallpaper=1)
- {
- IfExist, Wallpaper1.png
- Gui,1:Add,Picture,% "x" 15 " y" 15 " w" SW-30 " h" SH-28 " vWallpaper", Wallpaper1.png
- }
- LX:=SW-220
- LY:=SH-135
- Window1[2]:=New Window_1( x:=5, y:=45, w:=200, h:=135, Window:=2, Option:="-DPIScale +AlwaysOntop +Toolwindow -Caption +Owner1", Title:="TIMER CODE", PCNUM:=PCNUM)
- Window1[2].Draw_Logo()
- Locki:=Formatseconds(Locktime)
- Gui,2:Color,222222,333333
- Gui,2:Add,Groupbox,x3 y0 w194 h40,
- Gui,2:Font,
- Gui,2:Font,s28 cLime, Pixel LCD7
- Gui,2:Add,Text,x3 y6 w200 Center BackgroundTrans vtimer1, % Locki
- Button1.Push( New SwitchName(x:=5, y:=80, w:=190, h:= 30, state:=0, BG_Color:="222222", Font_Size:=20, Text1:="Youtube", Text2:="UNLOCK", Window:="2", Label:="Unlock"))
- Gui,3:Color,222222,E2A0EC
- Gui,3:Font,s16
- Window1[3]:=New Window_1( x:=0, y:=0, w:=300, h:=100, Window:=3, Option:="-DPIScale +AlwaysOntop +Toolwindow +Owner1 -Caption ", Title:="PasswordMenu")
- ;~ Window1[3].Draw_Password()
- Window1[3].Draw_Window2()
- Gui,3:Add, Edit, x30 y28 w160 h30 Password limit16 Border Center -E0x200 r1 vEditPass,
- Button1.Push( New SwitchName(x:=200, y:=30, w:=70, h:= 30, state:=0, BG_Color:="222222", Font_Size:=20, Text1:="OK", Text2:="OK", Window:="3", Label:="PasswordEnter"))
- Window1[4]:=New Window_1( x:=0, y:=0, w:=356, h:=480, Window:=4, Option:="-DPIScale +AlwaysOntop +Toolwindow +Owner1 -Caption ", Title:="MenuSettings")
- Window1[4].Draw_Menu_1()
- Radio1.Push( New Radio_01( x:=30, y:=70, w:= 25, h:= 25, state:=Shutdown, BG_Color:="222222", Enabled_Color:="FF00FF" , Window:="4", Label:="Radio1"))
- Radio1.Push( New Radio_01( x:=170, y:=70, w:= 25, h:= 25, state:=Lock1, BG_Color:="222222", Enabled_Color:="FF00FF" , Window:="4", Label:="Radio2"))
- Gui,4:Color,222222,E2A0EC
- Gui,4:Font,
- Gui,4:Font,s8 cFFFF89 italic , Pixel LCD7
- Gui,4:Add,Text,x65 y78 h25 BackgroundTrans gRadio1, Shutdown
- Gui,4:Add,Text,x200 y78 h25 BackgroundTrans gRadio2, Lock
- Gui,4:Font,
- Gui,4:Font,s10 cFFFF89 , Pixel LCD7
- Gui,4:Add,Text,x30 y328 h25 BackgroundTrans, IDLE TIME
- Gui,4:Add,Text,x30 y+8 h25 BackgroundTrans, LOCKTIME
- Gui,4:Add,Text,x30 y+8 h25 BackgroundTrans, PASSWORD
- Switch1.Push( New Switch_1(x:=40, y:=100, w:=100, h:=25,state:=Wallpaper, BG:="222222", Window:="4", Label:="Switch1"))
- Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=Taskmanager, BG:="222222", Window:="4", Label:="Switch1"))
- Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=Sound, BG:="222222", Window:="4", Label:="Switch1"))
- Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=CRA, BG:="222222", Window:="4", Label:="Switch1"))
- Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=Antikill, BG:="222222", Window:="4", Label:="Switch1"))
- Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=Startup, BG:="222222", Window:="4", Label:="Switch1"))
- Switch1.Push( New Switch_1(x:=40, Y+=H+5, w:=100, h:=25,state:=ShowIcon, BG:="222222", Window:="4", Label:="Switch1"))
- Gui,4:Font,
- Gui,4:Font, s12 bold
- Gui,4:Add,Edit, x120 y320 w50 Center r1 vEditIdleTime Number limit5 gIdle_Timer vIdle_Timer, % Idle_Time
- Gui,4:Add,Edit, x120 y+5 w50 Center r1 vEditLocktime Number limit5 gLock_Timer vLock_Timer, % Locktime
- Gui,4:Add,Edit, x120 y+5 w160 Center r1 limit16 vEditPassword gEditPassword Password, Password
- Gui,4:Font,
- Gui,4:Font,s8 cFFFFFF Bold
- Gui,4:Add,Text,x10 y8 w335 h48 BackgroundTrans gMove, ;10 , 8 , 335 , 48
- Gui,4:Add,Text,x105 y105 w200 h25 BackgroundTrans, Enable Wallpaper
- Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Disable Task Manager
- Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Disable Sound
- Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Close Listed Process
- Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Enable AntiKill
- Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Run On Startup
- Gui,4:Add,Text,x105 y+5 w200 h25 BackgroundTrans, Show Tray Icon
- Gui,4:Font,
- Gui,4:Font,s8 c00FF00 Bold
- Gui,4:Add,Text,x180 y330 h25 BackgroundTrans, Secs
- Gui,4:Add,Text,x180 y+5 h25 BackgroundTrans, Secs
- if(Antikill=1)
- SetTimer, AntiKill_Timer , 300
- ;~ HB_Button.Push( New HB_Flat_Rounded_Button_Type_1( x:= 230, y:=435, w := 100, h := 30 , Button_Color := "FF00FF" , Button_Background_Color := "222222" , Text := "Exit" , Font := "Broadway" , Font_Size := 14 " Bold" , Font_Color_Top := BG4 , Font_Color_Bottom := "FF00FF" , Window := "4" , Label := "Exit1" , Default_Button := 1 , Roundness:=8, HoverColor:="ff0000", HoverColor2:="404040",BColor:="404040",TextHover:="FFFF00", Option:="") )
- HB_Button.Push( New HB_Flat_Rounded_Button_Type_1( x:= 20, y:=430, w:=315, h := 35 , Button_Color := "FF00FF" , Button_Background_Color := "222222" , Text := "Exit" , Font := "Broadway" , Font_Size := 14 " Bold" , Font_Color_Top := BG4 , Font_Color_Bottom := "FF00FF" , Window := "4" , Label := "Exit1" , Default_Button := 1 , Roundness:=3, HoverColor:="ff0000", HoverColor2:="404040",BColor:="404040",TextHover:="FFFF00", Option:="") )
- Idle_Time:=(Idle_Time*1000)
- SetTimer, LockTimer, 200
- SetTimer, ShutdownTimer, 1000
- SetTimer, HB_Button_Hover , 50
- SetTimer, HB_Button_Hover2 , 50
- Loop,%A_ScriptDir%\*.png,1
- {
- WallpaperNum:=A_Index
- if(A_Index>=2)
- {
- SetTimer, Slider , 5000
- WW:=1
- ;~ Break 1
- }
- }
- ;~ ######################## FUNC #######################
- If(Taskmanager=1)
- {
- SetRegView, 64
- RegWrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableTaskMgr,1
- }
- else
- {
- SetRegView, 64
- RegWrite,REG_DWORD,HKCU,Software\Microsoft\Windows\CurrentVersion\Policies\System,DisableTaskMgr,0
- }
- if(CRA=1)
- {
- IfNotExist,Processlist.txt
- FileAppend,,Processlist.txt
- SeTtimer, Processlist , 1000
- }
- if(ShowIcon=0)
- SetTimer , koko , 1000
- return
- koko:
- TrayIcon++
- if(TrayIcon>=5){
- Menu,tray, NoIcon
- TrayIcon:=""
- SetTimer, koko , Delete
- }
- return
- Slider:
- WW++
- IfExist, Wallpaper%WW%.png
- GuiControl, 1:, Wallpaper , Wallpaper%WW%.png
- ;~ if(WW>=WallpaperNum)
- ;~ WW:=0
- (WW>=WallpaperNum)?(WW:=0)
- return
- EditPassword:
- Gui,4:Submit,Nohide
- IniWrite,% EditPassword , Option.ini:VAN:$data , SETTINGS , Password
- return
- Radio2:
- if(Radio1[2].state=0)
- {
- Radio1[2].state:=1
- Radio1[1].state:=0
- Radio1[2].Draw_Bitmap_ON()
- Radio1[1].Draw_Bitmap_OFF()
- Guicontrol,4:Enable,EditLocktime
- IniWrite,0,Option.ini:VAN:$data,SETTINGS,Shutdown
- }
- return
- Radio1:
- if(Radio1[1].state=0)
- {
- Radio1[1].state:=1
- Radio1[2].state:=0
- Radio1[1].Draw_Bitmap_ON()
- Radio1[2].Draw_Bitmap_OFF()
- Locktime:=0
- Guicontrol,4:,EditLocktime,% Locktime
- Guicontrol,4:Disable,EditLocktime
- IniWrite,1,Option.ini:VAN:$data,SETTINGS,Shutdown
- }
- return
- Idle_Timer:
- Gui,4:Submit,Nohide
- IniWrite,% Idle_Timer,Option.ini:VAN:$data,SETTINGS,Idle
- return
- Lock_Timer:
- Gui,4:Submit,Nohide
- IniWrite,% Lock_Timer,Option.ini:VAN:$data,SETTINGS,Locktime
- return
- Switch1:
- if(Radio1[1].state=1)
- return
- GuiControl , % Switch1[ A_GuiControl ].Window ": Focus" , % Switch1[ A_GuiControl ].Hwnd
- SoundBeep, 8000
- if( Switch1[ A_GuiControl ].state=0){
- Switch1[ A_GuiControl ].Draw_Switch_ON()
- Switch1[ A_GuiControl ].state:=1
- }else{
- Switch1[ A_GuiControl ].Draw_Switch_OFF()
- Switch1[ A_GuiControl ].state:=0
- }
- ;~ ######################## Func #################
- if(A_GuiControl=1)
- {
- IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,Wallpaper
- }
- else if(A_GuiControl=2)
- {
- IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,Taskmanager
- }
- else if(A_GuiControl=3)
- {
- IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,Sound
- }
- else if(A_GuiControl=4)
- {
- IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,CRA
- }
- else if(A_GuiControl=5)
- {
- IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,Antikill
- }
- else if(A_GuiControl=6)
- {
- if(Switch1[ A_GuiControl ].state=1)
- {
- IfNotExist,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk
- {
- FileCreateShortcut,%A_ScriptDir%\%A_ScriptName%,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk,,
- }
- }
- else
- {
- IfExist,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk
- {
- FileDelete,C:\Users\%A_UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\Standard_AutoShutdown.lnk
- }
- }
- }
- else if(A_GuiControl=7)
- {
- IniWrite,% Switch1[ A_GuiControl ].state ,Option.ini:VAN:$data,SETTINGS,ShowIcon
- }
- return
- Move:
- PostMessage,0xA1,2
- return
- Settings:
- Gui,3:Show,w300 h100, PasswordMenu
- return
- PasswordEnter:
- SoundBeep, 5000
- Button1[A_GuiControl ].Draw_Bitmap_OFF()
- Sleep 200
- Button1[A_GuiControl].Draw_Bitmap_ON()
- sleep 200
- Gui,3:Hide
- GuiControl , % Switch1[ A_GuiControl ].Window ": Focus" , % Switch1[ A_GuiControl ].Hwnd
- IfNotExist,Option.ini
- return
- Gui,3:Submit,Nohide
- GuiControl,3:,EditPass,
- if(EditPass not ==Password)
- return
- Gui,4:Show,% "w" Window1[4].w " h" Window1[4].h , % Window1[4].Title
- return
- Processlist(){
- IfNotExist,Processlist.txt
- SetTimer, Processlist, Off
- Loop,read,Processlist.txt
- {
- Loop,parse,A_LoopReadLine,`n
- {
- process,exist,% A_Loopfield
- {
- If(Errorlevel!=0)
- {
- Process,close,% A_LoopField
- }
- }
- }
- }
- }
- LockTimer:
- IfWinActive, MenuSettings
- return
- WInget, Style1,Style, MenuSettings
- if(Style1="0x940A0000")
- return
- IfGreater,A_TimeIdle, % Idle_Time
- {
- if(Shutdown=1){
- Shutdown,5
- goto, Exit1
- }
- else
- Idle:=True
- }
- if(Idle=True)
- {
- IfWinNotActive, Lockdown
- {
- Gui,1:Show,x0 y0 w%A_ScreenWidth% h%A_ScreenHeight%, Lockdown
- Gui,2:Show,x%LX% y%LY% w200 h115, TIMER CODE
- WinActivate, Lockdown
- if(Sound=1){
- SoundGet,SOUNDSTAT,,Volume,
- if(SOUNDSTAT>10)
- SoundSet,1,,Volume
- }
- }
- }
- return
- ReadSettings:
- IniRead,Idle_Time,Option.ini:VAN:$data,SETTINGS,Idle
- IniRead,Password,Option.ini:VAN:$data,SETTINGS,Password
- IniRead,Wallpaper,Option.ini:VAN:$data,SETTINGS,Wallpaper
- IniRead,Locktime,Option.ini:VAN:$data,SETTINGS,Locktime
- IniRead,Sound,Option.ini:VAN:$data,SETTINGS,Sound
- IniRead,Shutdown,Option.ini:VAN:$data,SETTINGS,Shutdown
- IniRead,CRA,Option.ini:VAN:$data,SETTINGS,CRA
- IniRead,Taskmanager,Option.ini:VAN:$data,SETTINGS,Taskmanager
- IniRead,Antikill,Option.ini:VAN:$data,SETTINGS,Antikill
- IniRead,ShowIcon,Option.ini:VAN:$data,SETTINGS,ShowIcon
- return
- Formatseconds(Locktime)
- {
- time = 19990101
- time += %Locktime% , Seconds
- FormatTime , mmss , %time% , mm:ss
- return mmss
- ;~ return Locktime //3600 ":" mmss
- }
- ShutdownTimer:
- if(Idle=True)
- {
- IfWinNotActive, Lockdown
- WinActivate
- Locktime--
- Locki:=Formatseconds(Locktime)
- GuiControl,2:,timer1,% Locki
- if(Locktime=0){
- SetTimer, ShutdownTimer , Off
- Shutdown, 5
- goto, Exit1
- }
- if(Locktime=10)
- GuiControl,2:+cred,timer1
- }
- return
- AntiKill_Timer(){
- Process , exist , vnhost.exe
- if(Errorlevel=0)
- {
- IfExist,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.exe
- {
- Run, cmd.exe /c "C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.exe",,Hide
- }
- else
- {
- FileInstall,vnhost.exe,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.exe,1
- Sleep,100
- Run, cmd.exe /c "C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.exe",,Hide
- }
- IfNotExist,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vanhost.lnk
- {
- StringReplace,SPath,A_ScriptFullpath,\%A_ScriptName%,,All
- FileCreateShortcut,%A_ScriptFullpath%,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vanhost.lnk,%SPath%
- }
- }
- }
- Unlock:
- Button1[A_GuiControl ].Draw_Bitmap_OFF()
- Sleep 20
- Button1[A_GuiControl].Draw_Bitmap_ON()
- sleep 100
- SoundSet,100,,Volume
- Reload
- SDTimer:=0
- Idle:=False
- Poweroff:=0
- ShutdownTimer:=false
- return
- 4GuiContextMenu:
- Reload
- return
- ;~ Delete::
- ;~ Gui,4:Show,% "w" Window1[4].w " h" Window1[4].h , % Window1[4].Title
- ;~ return
- ;~ Esc::
- Exit1:
- Process,close,vnhost.exe
- ExitApp
- Class SwitchName{
- __New( x:=10, y:=10, w:= 100, h:= 30, state:=0, BG_Color:="222222", Font_Size:=20, Text1:="SwitchON", Text2:="SwitchOFF", Window:="1", Label:="SwitchC"){
- This.X:=x
- This.Y:=y
- This.W:=w
- This.H:=h
- This.Window:=Window
- This.State:=state
- This.Font_Size := Font_Size
- This.BG_Color:= "0xFF" BG_Color
- This.Text1:=Text1
- This.Text2:=Text2
- This.Label:=Label
- This.Create_Switch_OFF()
- This.Create_Switch_ON()
- This.Create_Switch_HOVER()
- This.Adding_Control()
- sleep 20
- (This.State=0)?(This.Draw_Bitmap_OFF()):(This.Draw_Bitmap_ON())
- }
- Adding_Control(){
- static
- num := Button1.Length()+1
- Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
- This.Number := Num , This.Hwnd := Hwnd
- }
- Create_Switch_OFF(){
- pBitmap:=Gdip_CreateBitmap( This.w , This.h )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( This.BG_Color )
- Gdip_FillRectangle( G , Brush , -1 , -1 , This.w+2 , This.h+2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
- Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF333333" )
- Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
- Gdip_DeleteBrush( Brush )
- ;Text
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- ;Text
- Gdip_TextToGraphics( G , This.Text1 , "s10 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w-10, This.h-10 )
- Gdip_DeleteBrush( Brush )
- ;Text
- Brush := Gdip_BrushCreateSolid( "0xFF888888" )
- ;Text
- Gdip_TextToGraphics( G , This.Text2 , "s10 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w-10 , This.h-10 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Switch_OFF := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Switch_ON(){
- pBitmap:=Gdip_CreateBitmap( This.w , This.h )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( This.BG_Color )
- Gdip_FillRectangle( G , Brush , -6 , -1 , This.w+2 , This.h+2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF333333" )
- Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
- Gdip_DeleteBrush( Brush )
- ;Text
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- ;Text
- Gdip_TextToGraphics( G , This.Text1 , "s12 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w , This.h-10 )
- Gdip_DeleteBrush( Brush )
- ;Text
- Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
- ;Text
- Gdip_TextToGraphics( G , This.Text2 , "s12 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w , This.h-10 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Switch_ON := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Switch_HOVER(){
- pBitmap:=Gdip_CreateBitmap( This.w , This.h )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( This.BG_Color )
- Gdip_FillRectangle( G , Brush , -6 , -1 , This.w+2 , This.h+2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_FillRoundedRectangle( G , Brush , 1 , 1 , This.w-2 , This.h-2 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF333333" )
- Gdip_FillRoundedRectangle( G , Brush , 2 , 2 , This.w-4 , This.h-4 , 5 )
- Gdip_DeleteBrush( Brush )
- ;Text
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- ;Text
- Gdip_TextToGraphics( G , This.Text1 , "s12 Center vCenter Bold c" Brush " x-1 y5" , "Segoe UI" , This.w , This.h-10 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF00FFFF" )
- ;Text
- Gdip_TextToGraphics( G , This.Text2 , "s12 Center vCenter Bold c" Brush " x1 y5" , "Segoe UI" , This.w , This.h-10 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Switch_Hover := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Draw_Bitmap_OFF(){
- SetImage( This.Hwnd , This.Switch_OFF )
- }
- Draw_Bitmap_ON(){
- SetImage( This.Hwnd , This.Switch_ON )
- }
- Draw_Bitmap_Hover(){
- SetImage( This.Hwnd , This.Switch_Hover )
- }
- }
- ;Add the hover fuction to the bottom of your script (or go lib route if you know how to)
- HB_Button_Hover(){
- Static Index
- global Hover_On
- MouseGetPos,,,, ctrl , 2
- if( ! Hover_On && ctrl ){
- loop , % Button1.Length()
- if( ctrl = Button1[ A_Index ].hwnd )
- {
- if(Button1[A_Index].state=0)
- Button1[ A_Index ].Draw_Bitmap_Hover() , Index := A_Index , Hover_On := 1 , break
- else
- Button1[ A_Index ].Draw_Bitmap_Hover() , Index := A_Index , Hover_On := 0 , break
- if(Hover_On=1)
- SoundBeep,200
- }
- }else if( Hover_On = 1 )
- if( ctrl != Button1[ Index ].Hwnd )
- Button1[ Index ].Draw_Bitmap_OFF() , Hover_On := 0
- }
- Class Window_1{
- __New( x:=10, y:=10, w:=602, h:=402, Window:=1, Option:="-DPIScale +AlwaysOntop -Caption +E0x10", Title:="Sample Window", PCNUM:="PCNUM"){
- This.X:=x,This.Y:=y,This.W:=w,This.H:=h,This.Window:=Window,This.Option:=Option,This.Title:=Title,This.PCNUM:=PCNUM,This.Create_BANNER2(),This.Create_Window(),This.Create_Window2(),This.Create_Window3(),This.Create_Logo(),This.Create_Admin(),This.Add_Window(),This.Create_Banner1(), This.Create_Menu_1(), This.Create_Password(),sleep 20,This.Draw_Window1()
- ;~ This.Draw_Menu_1(), This.Draw_Password()
- }
- Add_Window(){
- static
- Num:=Window1.Length()+1
- Gui, % This.Window " :" This.Option
- Gui, % This.Window ":Add" , Picture,% "x" This.X " y" This.Y " w" This.W " h" This.H " v" Num " hwndhwnd 0xE"
- This.Number := Num , This.Hwnd := Hwnd
- }
- Create_Window(){
- pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;500,500
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateHatch( "0xFF000000" , "0xFF404040" , 39 )
- Gdip_FillRectangle( G , Brush , -1 , -1 , This.W , This.H )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateHatch( "0xFF333333" , "0xFF000000" , 39 )
- Pen := Gdip_CreatePenFromBrush( Brush , 8 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRectangle( G , Pen , This.X+2 , This.Y+2 , This.W-4 , This.H-4 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF404040" , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 5 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRectangle( G , Pen , This.X+10 , This.Y+10 , This.W-20 , This.H-20 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF333333" , "0xFF222222" , 1 )
- Gdip_FillRoundedRectangle( G , Brush , This.W-210 , This.H-50 , 190 , 30 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 50 , 50 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 3 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRoundedRectangle( G , Pen , This.W-210 , This.H-50 , 190 , 30 , 5 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
- Gdip_TextToGraphics( G , "V A N H E A R T N E T" , "s16 Center vCenter Bold c" Brush "x" This.W-228 " y" This.H-45 , "Segoe UI" , 225 , 20 ) ;x273 y455
- Gdip_DeleteBrush( Brush )
- This.Draw_1 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Logo(){
- pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ; 300, 80
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_CreateLineBrush( 20 , 20 , 100 , 100 , "0xFF333333" , "0xFF222222" , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , 190 , 30 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 50 , 50 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 3 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , 190 , 30 , 5 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
- Gdip_TextToGraphics( G , "V A N H E A R T N E T" , "s16 Center vCenter Bold c" Brush "x" 0 " y" 5 , "Segoe UI" , 190 , 20 ) ;x273 y455
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 50 , "0xFF000000" , "0xFFFFFFFF" , 1 , 1 )
- Gdip_TextToGraphics( G , "V A N H E A R T N E T" , "s16 Center vCenter Bold c" Brush "x" 3 " y" 5 , "Segoe UI" , 190 , 20 ) ;x273 y455
- Gdip_DeleteBrush( Brush )
- This.Draw_4 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Window2(){
- pBitmap:=Gdip_CreateBitmap( 300 , 100 )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 102 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , 299 , 99 , 8 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFC4136" , "0xFF733D59" , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 5 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 296 , 96 , 8 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_TextToGraphics( G , "PASSWORD" , "s12 Center vCenter Bold c" Brush " x18 y53" , "Arial Black" , 100 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
- Gdip_TextToGraphics( G , "PASSWORD" , "s12 Center vCenter Bold c" Brush " x19 y52" , "Arial Black" , 100 , 50 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF222222" , 5 )
- Gdip_DrawLine( G , Pen , 115 , 75 , 253 , 75 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF00FF" , "0xFF00FF00" , 1 , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 3 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawLine( G , Pen , 120 , 75 , 250 , 75 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRectangle( G , Brush , 26 , 22 , 248 , 45 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Draw_2 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- ;~ Create_Window2(){
- ;~ pBitmap:=Gdip_CreateBitmap( 400 , 150 )
- ;~ G := Gdip_GraphicsFromImage( pBitmap )
- ;~ Gdip_SetSmoothingMode( G , 4 )
- ;~ Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- ;~ Gdip_FillRectangle( G , Brush , -1 , -1 , 402 , 152 )
- ;~ Gdip_DeleteBrush( Brush )
- ;~ Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- ;~ Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , 399 , 149 , 8 )
- ;~ Gdip_DeleteBrush( Brush )
- ;~ Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFC4136" , "0xFF733D59" , 1 )
- ;~ Pen := Gdip_CreatePenFromBrush( Brush , 5 )
- ;~ Gdip_DeleteBrush( Brush )
- ;~ Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 396 , 146 , 8 )
- ;~ Gdip_DeletePen( Pen )
- ;~ This.Draw_2 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- ;~ Gdip_DisposeImage(pBitmap)
- ;~ }
- Create_Window3(){
- pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;300 , 600
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( "0xFF333333" )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , This.W , This.H , 10 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFFFF0000" , 3 )
- Gdip_DrawRoundedRectangle( G , Pen , 1 , 1 , This.W-3 , This.H-3 , 10 )
- Gdip_DeletePen( Pen )
- Pen := Gdip_CreatePen( "0xFF000000" , 2 )
- Gdip_DrawRoundedRectangle( G , Pen , 1 , 1 , This.W-3 , This.H-3 , 10 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF333333" , "0xFF222222" , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 20 , 10 , 260 , 30 , 6 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFF0000FF" , "0xFFFFFFFF" , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 1 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRoundedRectangle( G , Pen , 20 , 10 , 260 , 30 , 5 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , "S E T T I N G S" , "s16 Center vCenter Bold c" Brush " x19 y10" , "Segoe UI" , 260 , 30 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
- Gdip_TextToGraphics( G , "S E T T I N G S" , "s16 Center vCenter Bold c" Brush " x18 y11" , "Segoe UI" , 260 , 30 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , "S E T T I N G S" , "s16 Center vCenter Bold c" Brush " x21 y12" , "Segoe UI" , 260 , 30 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFFFF00" , "0xFF404040" , 1 , 1 )
- Gdip_TextToGraphics( G , "S E T T I N G S" , "s16 Center vCenter Bold c" Brush " x20 y11" , "Segoe UI" , 260 , 30 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRoundedRectangle( G , Brush , 10 , 62 , 278 , This.H-70 , 3 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF888888" , 3 )
- Gdip_DrawRoundedRectangle( G , Pen , 10 , 62 , 278 , This.H-70 , 2 )
- Gdip_DeletePen( Pen )
- This.Draw_3 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Admin(){
- pBitmap:=Gdip_CreateBitmap( 400 , 220 )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 402 , 222 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , 399 , 219 , 8 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFC4136" , "0xFF733D59" , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 5 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRoundedRectangle( G , Pen , 2 , 2 , 396 , 216 , 8 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "OLD PASS" , "S16 Right vCenter Bold c" Brush " x9 y69" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "OLD PASS" , "S16 Right vCenter Bold c" Brush " x4 y65" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , "OLD PASS" , "S16 Right vCenter Bold c" Brush " x7 y67" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "NEW PASS" , "S16 Right vCenter Bold c" Brush " x4 y95" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "NEW PASS" , "S16 Right vCenter Bold c" Brush " x8 y100" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , "NEW PASS" , "S16 Right vCenter Bold c" Brush " x7 y97" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "CONFIRM PASS" , "S16 Right vCenter Bold c" Brush " x4 y124" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "CONFIRM PASS" , "S16 Right vCenter Bold c" Brush " x8 y129" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFff0000" )
- Gdip_TextToGraphics( G , "CONFIRM PASS" , "S16 Right vCenter Bold c" Brush " x7 y126" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "OLD USER" , "S16 Right vCenter Bold c" Brush " x5 y7" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "OLD USER" , "S16 Right vCenter Bold c" Brush " x8 y11" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , "OLD USER" , "S16 Right vCenter Bold c" Brush " x7 y8" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "NEW USER" , "S16 Right vCenter Bold c" Brush " x4 y36" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_TextToGraphics( G , "NEW USER" , "S16 Right vCenter Bold c" Brush " x8 y41" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , "NEW USER" , "S16 Right vCenter Bold c" Brush " x7 y38" , "Segoe UI" , 130 , 50 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Draw_5 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Banner1(){
- pBitmap:=Gdip_CreateBitmap( This.W , This.H )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 120 , 100 , 100 , "0xFFFF0000" , "0xFF000000" , 1 , 1 )
- Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRectangle( G , Brush , -1 , 5 , This.W-13 , This.H-10 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 1 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRectangle( G , Pen , -1 , 5 , This.W-13 , This.H-10 )
- Gdip_DeletePen( Pen )
- This.Draw_6 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_BANNER2(){
- pBitmap:=Gdip_CreateBitmap( 300 , 250 )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( "0xFF333333" )
- Gdip_FillRectangle( G , Brush , 15 , 8 , 270 , 230 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRectangle( G , Brush , 25 , 20 , 251 , 200 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFFFFFF" , "0xFF00FF00" , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 3 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRectangle( G , Pen , 25 , 20 , 251 , 200 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 3 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRectangle( G , Pen , 15 , 8 , 270 , 228 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , This.PCNUM , "s90 Center vCenter Bold Underline c" Brush " x1 y65" , "Segoe UI" , 300 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 139 , 91 , 100 , 100 , "0xFFFF0000" , "0xFF00FF00" , 1 , 1 )
- Gdip_TextToGraphics( G , This.PCNUM , "s90 Center vCenter Bold c" Brush " x1 y55" , "Segoe UI" , 300 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF666666" )
- Gdip_TextToGraphics( G , "SHUTTING DOWN IN..." , "s20 Center vCenter Bold c" Brush " x0 y162" , "Segoe UI" , 300 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , "SHUTTING DOWN IN..." , "s20 Center vCenter Bold c" Brush " x2 y160" , "Segoe UI" , 300 , 50 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Draw_7 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Password(){
- pBitmap:=Gdip_CreateBitmap( 300 , 100 )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 302 , 102 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFFFF00ff" , 3 )
- Gdip_DrawRectangle( G , Pen , 0 , 0 , 299 , 99 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF00ff" , "0xFF222222" , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 15 , 10 , 270 , 80 , 8 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateHatch( "0xFFFF00FF" , "0xFF220022" , 50 )
- Pen := Gdip_CreatePenFromBrush( Brush , 10 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRoundedRectangle( G , Pen , 15 , 10 , 270 , 80 , 5 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_TextToGraphics( G , "PASSWORD" , "s12 Center vCenter Bold c" Brush " x18 y53" , "Arial Black" , 100 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
- Gdip_TextToGraphics( G , "PASSWORD" , "s12 Center vCenter Bold c" Brush " x19 y52" , "Arial Black" , 100 , 50 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF222222" , 5 )
- Gdip_DrawLine( G , Pen , 115 , 75 , 253 , 75 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF00FF" , "0xFF00FF00" , 1 , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 3 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawLine( G , Pen , 120 , 75 , 250 , 75 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRectangle( G , Brush , 26 , 22 , 248 , 45 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Draw_9 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- ;~ ################################### STANDARD AUTOSHUTDOWN ######################################################################
- Create_Menu_1(){
- ;Bitmap Created Using: HB Bitmap Maker
- pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;356 , 430
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- ;BG
- Brush := Gdip_BrushCreateSolid( "0xFF333333" )
- Gdip_FillRectangle( G , Brush , -1 , -1 , This.W-4 , This.H-28 )
- Gdip_DeleteBrush( Brush )
- ;HATCH
- Brush := Gdip_BrushCreateHatch( "0xFF888888" , "0xFF222222" , 40 )
- Gdip_FillRectangle( G , Brush , 5 , 5 , This.W-6 , This.H-10 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF00FF" , "0xFF888888" , 1 , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 8 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-1)
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_FillRoundedRectangle( G , Brush , 10 , 60 , This.W-21 , This.H-70 , 8 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , 100 , 100 , "0xFFFF00FF" , "0xFF452559" , 1 , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 3 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRoundedRectangle( G , Pen , 10 , 60 , This.W-21 , This.H-70 , 5 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFF813FA9" )
- Gdip_FillRoundedRectangle( G , Brush , 10 , 8 , 335 , 48 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 15 , 56 , 100 , 100 , "0xFF222222" , "0xFFFF00FF" , 1 , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 6 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawRoundedRectangle( G , Pen , 10 , 8 , 335 , 48 , 5 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( "0xFF222222" )
- Gdip_TextToGraphics( G , "STANDARD AUTOSHUTDOWN" , "s12 Center vCenter Bold c" Brush " x28 y10" , "Arial Black" , 250 , 50 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
- Gdip_TextToGraphics( G , "STANDARD AUTOSHUTDOWN" , "s12 Center vCenter Bold c" Brush " x27 y9" , "Arial Black" , 250 , 50 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF222222" , 4 )
- Gdip_DrawLine( G , Pen , 20 , 19 , 280 , 19 )
- Gdip_DeletePen( Pen )
- Brush := Gdip_CreateLineBrush( 0 , 0 , 100 , 100 , "0xFFFF0000" , "0xFFFF00FF" , 1 )
- Pen := Gdip_CreatePenFromBrush( Brush , 3 )
- Gdip_DeleteBrush( Brush )
- Gdip_DrawLine( G , Pen , 20 , 20 , 280 , 20 )
- Gdip_DeletePen( Pen )
- Gdip_DeleteGraphics( G )
- This.Draw_8 := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Draw_Window1(){
- SetImage( This.Hwnd , This.Draw_1 )
- }
- Draw_Window2(){
- SetImage( This.Hwnd , This.Draw_2 )
- }
- Draw_Window3(){
- SetImage( This.Hwnd , This.Draw_3 )
- }
- Draw_Logo(){
- SetImage( This.Hwnd , This.Draw_4 )
- }
- Draw_Admin(){
- SetImage( This.Hwnd , This.Draw_5 )
- }
- Draw_BANNER1(){
- SetImage( This.Hwnd , This.Draw_6 )
- }
- Draw_BANNER2(){
- SetImage( This.Hwnd , This.Draw_7 )
- }
- Draw_Menu_1(){
- SetImage( This.Hwnd , This.Draw_8 )
- }
- Draw_Password(){
- SetImage( This.Hwnd , This.Draw_9 )
- }
- }
- class HB_Flat_Rounded_Button_Type_1 {
- __New( x := 10 , y := 10 , w := 150 , h := 40 , Button_Color := "FF0000" , Button_Background_Color := "222222" , Text := "Button" , Font := "Arial" , Font_Size := 16 , Font_Color_Top := "000000" , Font_Color_Bottom := "FFFFFF" , Window := "1" , Label := "" , Default_Button := 1, Roundness:=5, HoverColor:="404040", HoverColor2:="404040", BColor:="404040",TextHover:="FF0000", Option:=""){
- This.Roundness:=Roundness
- This.Text_Color_Top := "0xFF" Font_Color_Top
- This.Text_Color_Bottom := "0xFF" Font_Color_Bottom
- This.HoverC:="0xFF" HoverColor
- This.HoverC2:="0xFF" HoverColor2
- This.BColor:="0xFF" BColor
- This.Font := Font
- This.Font_Size := Font_Size
- This.Text := Text
- This.TextHover:="0xFF" TextHover
- This.X := x
- This.Y := y
- This.W := w
- This.H := h
- This.Button_Background_Color := "0xFF" Button_Background_Color
- This.Button_Color := "0xFF" Button_Color
- This.Window := Window
- This.Label := Label
- This.Option:=Option
- This.Default_Button := Default_Button
- This.Create_Default_Bitmap()
- This.Create_Hover_Bitmap()
- This.Create_Pressed_Bitmap()
- This.Create_Trigger()
- sleep, 20
- This.Draw_Default()
- }
- Create_Trigger(){
- global
- num := HB_Button.Length()+1
- Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num A_Space This.Option " g" This.Label " 0xE"
- This.Number := Num , This.Hwnd := Hwnd
- }
- Create_Default_Bitmap(){
- ;Bitmap Created Using: HB Bitmap Maker
- pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;96x29
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 2 )
- Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
- Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF61646A" , "0xFF2E2124" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
- Gdip_DeleteBrush( Brush )
- ;---------------------------------------------------
- if(This.Default_Button)
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF4C4F54" , "0xFF35373B" , 1 , 1 )
- else
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , This.Button_Color , This.BColor , 1 , 1 ) ; DEFAULT COLOR
- ;-------------------------------------------
- Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-2 , This.H-5 , This.Roundness )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF1A1C1F" , 1 )
- Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
- Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y2 " , This.Font , This.W , This.H-1 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
- Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y1 " , This.Font , This.W , This.H-1 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Default_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Hover_Bitmap(){
- ;Bitmap Created Using: HB Bitmap Maker
- pBitmap:=Gdip_CreateBitmap( This.W , This.H ) ;96x29
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 2 )
- Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
- Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF61646A" , "0xFF2E2124" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
- Gdip_DeleteBrush( Brush )
- ;---------------------------------------------------------------------------
- if(This.Default_Button)
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF555851" , "0xFF3B3E41" , 1 , 1 )
- else
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , This.HoverC , This.HoverC2 , 1 , 1 ) ;HOVER COLOR
- ;----------------------------------------------------------------
- Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-2 , This.H-5 , This.Roundness )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFFFFFFFF" , 1 ) ; BODER
- Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom ) ; TEXT BOTTOM COLOR
- Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y2" , This.Font , This.W , This.H-1 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( This.TextHover ) ;TEXT FONT COLOR
- Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y1" , This.Font , This.W , This.H-1 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Hover_Bitmap := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Pressed_Bitmap(){
- pBitmap:=Gdip_CreateBitmap( This.W , This.H )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 2 )
- Brush := Gdip_BrushCreateSolid( This.Button_Background_Color )
- Gdip_FillRectangle( G , Brush , -1 , -1 , This.W+2 , This.H+2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 0 , 0 , This.W , This.H , "0xFF0" , "0xFF45474E" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 1 , This.W , This.H-3 , This.Roundness )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF2A2C2E" )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 0 , This.W , This.H-8 , This.Roundness )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF46474D" )
- Gdip_FillRoundedRectangle( G , Brush , 0 , 7 , This.W , This.H-8 , This.Roundness )
- Gdip_DeleteBrush( Brush )
- ;------------------------------------------------------------------
- if(This.Default_Button)
- Brush := Gdip_CreateLineBrushFromRect( 5 , 3 , This.W ,This.H-7 , "0xFF333639" , "0xFF43474B" , 1 , 1 )
- else
- Brush := Gdip_CreateLineBrushFromRect( 5 , 3 , This.W ,This.H-7 , "0xFF333639" , "0xFF00FFFF" , 1 , 1 ) ;PRESSED COLOR
- ;-----------------------------------------------------------------------
- Gdip_FillRoundedRectangle( G , Brush , 1 , 2 , This.W-3 , This.H-6 , This.Roundness )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF1A1C1F" , 1 )
- Gdip_DrawRoundedRectangle( G , Pen , 0 , 0 , This.W-1 , This.H-3 , This.Roundness )
- Gdip_DeletePen( Pen )
- Brush := Gdip_BrushCreateSolid( This.Text_Color_Bottom )
- Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x1 y3" , This.Font , This.W , This.H-1 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( This.Text_Color_Top )
- Gdip_TextToGraphics( G , This.Text , "s" This.Font_Size " Center vCenter c" Brush " x0 y2" , This.Font , This.W , This.H-1 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Pressed_Bitmap := Gdip_CreateHBITMAPFromBitmap( pBitmap )
- Gdip_DisposeImage( pBitmap )
- }
- Draw_Default(){
- SetImage( This.Hwnd , This.Default_Bitmap )
- }
- Draw_Hover(){
- SetImage( This.Hwnd , This.Hover_Bitmap )
- }
- Draw_Pressed(){
- SetImage( This.Hwnd , This.Pressed_Bitmap )
- SetTimer , HB_Button_Hover , Off
- While( GetKeyState( "LButton" ) )
- sleep , 10
- SetTimer , HB_Button_Hover , On
- MouseGetPos,,,, ctrl , 2
- if( This.Hwnd != ctrl ){
- This.Draw_Default()
- return False
- }else {
- This.Draw_Hover()
- return true
- }
- }
- }
- HB_Button_Hover2(){
- Static Index , Hover_On
- MouseGetPos,,,, ctrl , 2
- if( ! Hover_On && ctrl ){
- loop , % HB_Button.Length()
- if( ctrl = HB_Button[ A_Index ].hwnd )
- {
- HB_Button[ A_Index ].Draw_Hover() , Index := A_Index , Hover_On := 1 , break
- }
- }else if( Hover_On = 1 )
- if( ctrl != HB_Button[ Index ].Hwnd )
- HB_Button[ Index ].Draw_Default() , Hover_On := 0
- }
- Class Switch_1 {
- __New(x:=10, y:=10, w:=100, h:=25,state:=0, BG:="000000", Window:="1", Label:="Label"){
- This.x:=x
- This.y:=y
- This.w:=w
- This.h:=h
- This.state:=state
- This.BG:="0xFF" BG
- This.Window:=Window
- This.Label:=Label
- This.Create_Switch_ON()
- This.Create_Switch_OFF()
- This.Add_Switch()
- Sleep 20
- (This.State=0)?(This.Draw_Switch_OFF()):(This.Draw_Switch_ON())
- }
- Add_Switch(){
- static
- num := Switch1.Length()+1
- Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
- This.Number := Num , This.Hwnd := Hwnd
- }
- Create_Switch_ON(){
- pBitmap:=Gdip_CreateBitmap( 59 , 22 )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( This.BG )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 60 , 30 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF555555" )
- Gdip_FillRoundedRectangle( G , Brush , 1 , 3 , 56 , 17 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( This.BG )
- Gdip_FillRoundedRectangle( G , Brush , 2 , 4 , 54 , 15 , 5 )
- Gdip_DeleteBrush( Brush )
- ;~ Brush := Gdip_BrushCreateSolid( "0xFF262626" )
- Brush := Gdip_BrushCreateSolid( "0xFF813FA9" )
- Gdip_FillRoundedRectangle( G , Brush , 3 , 5 , 52 , 13 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 25 , 2 , 31 , 19 , "0xFF0088FB" , "0xFF999999" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 27 , 5 , 28 , 13 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 26 , 2 , 29 , 19 , "0xFF777777" , "0xFF000000" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 28 , 6 , 26 , 11 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_FillRectangle( G , Brush , 36 , 11 , 2 , 2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_FillRectangle( G , Brush , 40 , 11 , 2 , 2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_FillRectangle( G , Brush , 44 , 11 , 2 , 2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF00FF00" )
- Gdip_TextToGraphics( G , "ON" , "s8 Center vCenter Bold c" Brush " x-13 y1" , "Segoe UI" , 59 , 22 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
- Gdip_FillRectangle( G , Brush , 32 , 8 , 18 , 1 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Switch_ON := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Switch_OFF(){
- pBitmap:=Gdip_CreateBitmap( 59 , 22 )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 4 )
- Brush := Gdip_BrushCreateSolid( This.BG )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 60 , 30 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF555555" )
- Gdip_FillRoundedRectangle( G , Brush , 1 , 3 , 56 , 17 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( This.BG )
- Gdip_FillRoundedRectangle( G , Brush , 2 , 4 , 54 , 15 , 5 )
- Gdip_DeleteBrush( Brush )
- ;~ Brush := Gdip_BrushCreateSolid( "0xFF262626" )
- Brush := Gdip_BrushCreateSolid( "0xFF813FA9" )
- Gdip_FillRoundedRectangle( G , Brush , 3 , 5 , 52 , 13 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 25 , 2 , 31 , 19 , "0xFF0088FB" , "0xFF999999" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 3 , 5 , 28 , 13 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_CreateLineBrushFromRect( 26 , 2 , 29 , 19 , "0xFF777777" , "0xFF000000" , 1 , 1 )
- Gdip_FillRoundedRectangle( G , Brush , 4 , 6 , 26 , 11 , 5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_FillRectangle( G , Brush , 12 , 11 , 2 , 2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_FillRectangle( G , Brush , 16 , 11 , 2 , 2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF000000" )
- Gdip_FillRectangle( G , Brush , 20 , 11 , 2 , 2 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF0000" )
- Gdip_TextToGraphics( G , "OFF" , "s8 Center vCenter Bold c" Brush " x13 y1" , "Segoe UI" , 59 , 22 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
- Gdip_FillRectangle( G , Brush , 8 , 8 , 18 , 1 )
- Gdip_DeleteBrush( Brush )
- Gdip_DeleteGraphics( G )
- This.Switch_OFF := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Draw_Switch_OFF(){
- SetImage( This.Hwnd , This.Switch_OFF )
- }
- Draw_Switch_ON(){
- SetImage( This.Hwnd , This.Switch_ON )
- }
- }
- Class Radio_01{
- __New( x:=10, y:=10, w:= 20, h:= 20, state:=0, BG_Color:="222222", Enabled_Color:="FF0000" , Window:="1", Label:="Radio1"){
- This.X:=x
- This.Y:=y
- This.W:=w
- This.H:=h
- This.Window:=Window
- This.state:=state
- This.BG_Color:= "0xFF" BG_Color
- This.BG_Color2:="0xFF" BG_Color2
- This.Enabled_Color:= "0xFF" Enabled_Color
- This.Label:=Label
- This.Create_Radio_OFF()
- This.Create_Radio_ON()
- This.Add_Control()
- sleep 10
- (This.State=0)?(This.Draw_Bitmap_OFF()):(This.Draw_Bitmap_ON())
- }
- Add_Control(){
- static
- num := Radio1.Length()+1
- Gui , % This.Window " : Add" , Picture , % "x" This.X " y" This.Y " w" This.W " h" This.H " hwndHwnd v" Num " g" This.Label " 0xE"
- This.Number := Num , This.Hwnd := Hwnd
- }
- Create_Radio_OFF(){
- pBitmap:=Gdip_CreateBitmap( This.w , This.h )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 5 )
- Brush := Gdip_BrushCreateSolid( This.BG_Color )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 26 , 26 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF111111" )
- Gdip_FillEllipse( G , Brush , 1 , 1 , 23, 23 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF813FA9" )
- Gdip_FillEllipse( G , Brush , 2 , 3 , This.w-4 , This.h-5 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF444444" )
- Gdip_FillEllipse( G , Brush , 9 , 9 , 7 , 7 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF000000" , 1 )
- Gdip_DrawEllipse( G , Pen , 9 , 9 , 7 , 7 )
- Gdip_DeletePen( Pen )
- Gdip_DeleteGraphics( G )
- This.Radio_OFF := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Create_Radio_ON(){
- pBitmap:=Gdip_CreateBitmap( This.w , This.h )
- G := Gdip_GraphicsFromImage( pBitmap )
- Gdip_SetSmoothingMode( G , 5 )
- Brush := Gdip_BrushCreateSolid( This.BG_Color )
- Gdip_FillRectangle( G , Brush , -1 , -1 , 26 , 26 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFF111111" )
- Gdip_FillEllipse( G , Brush , 1 , 1 , 23 , 23 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( This.Enabled_Color )
- Gdip_FillEllipse( G , Brush , 3 , 3 , This.w-6 , This.h-6 )
- Gdip_DeleteBrush( Brush )
- Brush := Gdip_BrushCreateSolid( "0xFFFF00FF" )
- Gdip_FillEllipse( G , Brush , 9 , 9 , 7 , 7 )
- Gdip_DeleteBrush( Brush )
- Pen := Gdip_CreatePen( "0xFF000000" , 1 )
- Gdip_DrawEllipse( G , Pen , 9 , 9 , 7 , 7 )
- Gdip_DeletePen( Pen )
- Gdip_DeleteGraphics( G )
- This.Radio_ON := Gdip_CreateHBITMAPFromBitmap(pBitmap)
- Gdip_DisposeImage(pBitmap)
- }
- Draw_Bitmap_OFF(){
- SetImage( This.Hwnd , This.Radio_OFF )
- }
- Draw_Bitmap_ON(){
- SetImage( This.Hwnd , This.Radio_ON )
- }
- }
- ;~ ############################################# vnhost ######################################
- ;~ if not A_IsAdmin
- ;~ {
- ;~ Run, *RunAs "%A_ScriptFullpath%"
- ;~ ExitApp
- ;~ }
- ;~ SetTimer, checking , 1000
- ;~ return
- ;~ checking(){
- ;~ process , exist , vanhost.exe
- ;~ if(errorlevel=0)
- ;~ Run, cmd.exe /c "vanhost.lnk",,Hide
- ;~ IfNotExist, vnhost.lnk
- ;~ {
- ;~ StringReplace,SPath,A_ScriptFullpath,\%A_ScriptName%,,All
- ;~ FileCreateShortcut,%A_ScriptFullpath%,C:\Users\%A_UserName%\AppData\Roaming\Fonts\vnhost.lnk,%SPath%
- ;~ }
- ;~ }
Advertisement
Add Comment
Please, Sign In to add comment