Hiho
Habe mein Script ausgebaut, und mit "guictrlsetonevent" statt "Switch" benutzt
Habe nun 2x "GuiCreate" eingebaut, eines startet versteckt und dient als Hotkey Optionsfenster, nur das Problem ich kann den Buttons dort keine Funtionen zuweisen...
Um das Ganze verständlicher zu machen, hier mein Script:
Spoiler anzeigen
;#RequireAdmin
#NoTrayIcon
#include <TabConstants.au3>
#Include <Date.au3>
#Include <Misc.au3>
#Include <WinAPI.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>
Opt('GUICloseOnESC', 0)
Opt("guioneventmode", 1)
Opt('SendCapslockMode', 1)
#Region;===========================Prüft ob DeskKey schon rennt
If WinExists ("DeskKey©","") then
MsgBox(16,"Error","DeskKey© is allways runnig")
Exit
Else
EndIf
#EndRegion;===========================END
#Region;===========================Nachricht mit Einblendeefeckt
$info1 = SplashTextOn ("info1","Made By Freeðøm ©",300,45,@DesktopWidth /2 - 150 ,@DesktopHeight /2 - 22,1)
$info1Trans = 1
While 1
WinSetTrans ($info1,"",$info1Trans)
$info1Trans = $info1Trans + 5
Sleep (5)
If $info1Trans >= 255 then ExitLoop
WEnd
Sleep (100)
$info2 = SplashTextOn ("info2","Version: 0.4.0 beta 5.5",300,45,@DesktopWidth /2 - 150 ,@DesktopHeight /2 - 22,1)
$info2Trans = 255
Sleep (100)
While 1
WinSetTrans ($info2,"",$info2Trans)
$info2Trans = $info2Trans -5
Sleep (5)
If $info2Trans <= 1 then ExitLoop
WEnd
SplashOff ()
#EndRegion;===========================END
#Region;===========================Prüft WindowsVersion
$OS = @OSVersion
If $OS = "WIN_VISTA" then
VISTA()
ElseIf $OS = "WIN_XP" then
XP()
Else
Msgbox (16,"Error","Betriebssytem nicht unterstützt")
Exit
EndIf
#EndRegion;===========================END
#Region;===========================GUI Create VISTA/XP
Func VISTA()
#Region ### START Koda GUI section ### Form=d:\prog\au3 files\deskkey\coda fd\v0.kxf
Global $Form1_1 = GUICreate("DeskKey©", 324, 204, 192, 124, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS,$WS_EX_LAYERED)) ;$WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,
Global $Button2 = GUICtrlCreateButton("|||||", 0, 184, 21, 20, $WS_GROUP,$BS_VCENTER)
GUICtrlSetBkColor (-1, 0x99CCCC)
GUICtrlSetFont (-1,"","","Stencil")
GUICtrlSetTip ( -1,"Fenster verkleinern / vergrößern")
Global $Tab1 = GUICtrlCreateTab(-2, 0, 327, 205,($TCS_VERTICAL))
GUICtrlSetBkColor (-1,0x33518B)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
Global $TabItem1 = GUICtrlCreateTabItem("Hauptmenü")
GUICtrlSetFont (-1,7,"","","Arial Black")
Global $Input1 = GUICtrlCreateInput("", 24, 6, 240, 21, $ES_PASSWORD)
GUICtrlSetTip (-1,"Passwort hier eingeben","","",1)
Global $Input2 = GUICtrlCreateInput("", 24, 38, 240, 21, $ES_PASSWORD)
GUICtrlSetTip (-1,"Passwort Wiederholen","","",1)
Global $Input3 = GUICtrlCreateInput ("", 102, 70, 180, 17, $ES_READONLY)
ControlDisable ($Form1_1,"",$Input3)
Global $Edit1 = GUICtrlCreateEdit("Hier kannst du deine Nachricht hinterlassen...", 24, 94, 298, 105)
Global $Button1 = GUICtrlCreateButton("ON", 274, 6, 43, 49, $WS_GROUP)
GUICtrlSetTip ( -1,"In gesperrten / entsperrten Modus wechseln")
GUICtrlSetFont (-1,10,"","","Arial Black")
Global $Button5 = GUICtrlCreateButton("Bild Wählen", 24, 70, 65, 17, $WS_GROUP)
GUICtrlSetTip ( -1,"Wähle Hintergrundbild was im gesperrten Modus angezeigt wird")
GUICtrlSetFont (-1,7,"","","Arial Black")
Global $TabItem2 = GUICtrlCreateTabItem("Nebenmenü")
Global $Input4 = GUICtrlCreateInput("Input1", 32, 172, 121, 21, BitOR($ES_AUTOHSCROLL,$ES_RIGHT,$ES_READONLY))
ControlDisable ($Form1_1,"",$Input4)
Global $Slider1 = GUICtrlCreateSlider(28, 28, 38, 141, BitOR($TBS_VERT,$TBS_AUTOTICKS,$TBS_BOTH))
GUICtrlSetLimit (-1, 100, 0)
ControlDisable ($Form1_1,"",$Slider1)
Global $Label1 = GUICtrlCreateLabel("Optionen für gesperrten Modus", 32, 10, 200, 17)
GUICtrlSetFont (-1, 11,"")
Global $Button6 = GUICtrlCreateButton("Optionen", 210, 135, 55, 17, $WS_GROUP)
GUICtrlSetTip ( -1,"")
Global $Checkbox1 = GUICtrlCreateCheckbox("Fenster fixieren", 120, 39, 180, 17)
GUICtrlSetTip ( -1,"Fixiert das Programmfenster im gesperrten Modus")
Global $Checkbox2 = GUICtrlCreateCheckbox("Transparenz an", 120, 103, 180, 17)
GUICtrlSetTip ( -1,"Der Hintergrund kann beliebig Transparent eingestellt werden (Erlaubt ''Desktop anzeigen'')")
Global $Checkbox3 = GUICtrlCreateCheckbox("Desktop anzeigen", 120, 71, 180, 17)
GUICtrlSetTip ( -1,"Desktopsymbole und Taskleiste im gesperrten Modus anzeigen")
ControlDisable ($Form1_1,"",$Checkbox3)
Global $Checkbox4 = GUICtrlCreateCheckbox("Hotkeys an", 120, 135, 80, 17)
GUICtrlSetTip ( -1,"Aktiviert benutzerdefinierte Hotkeys")
GUISetState(@SW_HIDE)
Global $FormTrans = 1
Global $ToolPos = "0"
While 1
WinSetTrans ($Form1_1,"",$FormTrans)
$FormTrans = $FormTrans + 7
Sleep (5)
If $FormTrans >= 255 then ExitLoop
If $FormTrans = 8 then GUISetState(@SW_SHOW) ;Das Fenster erscheint standartmäßig ohne transparenz, ohne diese funktion würde es kurz ohne transparenz erscheinen und dann erst transparenz 1 bis 255 gesetzt werden
WEnd
#EndRegion ### END Koda GUI section ###
EndFunc
Func XP()
#Region ### START Koda GUI section ### Form=d:\prog\au3 files\deskkey\coda fd\v0.kxf
Global $Form1_1 = GUICreate("DeskKey©", 324, 204, 192, 124, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS,$WS_EX_LAYERED)) ;$WS_MAXIMIZEBOX,$WS_MINIMIZEBOX,
Global $Button2 = GUICtrlCreateButton("|||||", 0, 184, 21, 20, $WS_GROUP,$BS_VCENTER)
GUICtrlSetBkColor (-1, 0x99CCCC)
GUICtrlSetFont (-1,"","","Stencil")
GUICtrlSetTip ( -1,"Fenster verkleinern / vergrößern")
Global $Tab1 = GUICtrlCreateTab(0, 0, 327, 205,BitOr($TCS_VERTICAL,$TCS_BUTTONS))
GUICtrlSetBkColor (-1,0x33518B)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
Global $TabItem1 = GUICtrlCreateTabItem("Hauptmenü")
GUICtrlSetFont (-1,7,"","","Arial Black")
Global $Input1 = GUICtrlCreateInput("", 24, 6, 240, 21, $ES_PASSWORD)
GUICtrlSetTip (-1,"Passwort hier eingeben","","",1)
Global $Input2 = GUICtrlCreateInput("", 24, 38, 240, 21, $ES_PASSWORD)
GUICtrlSetTip (-1,"Passwort Wiederholen","","",1)
Global $Input3 = GUICtrlCreateInput ("", 102, 70, 180, 17, $ES_READONLY)
ControlDisable ($Form1_1,"",$Input3)
Global $Edit1 = GUICtrlCreateEdit("Hier kannst du deine Nachricht hinterlassen...", 24, 94, 298, 115)
Global $Button1 = GUICtrlCreateButton("ON", 274, 6, 43, 49, $WS_GROUP)
GUICtrlSetTip ( -1,"In gesperrten / entsperrten Modus wechseln")
GUICtrlSetFont (-1,10,"","","Arial Black")
Global $Button5 = GUICtrlCreateButton("Bild Wählen", 24, 70, 65, 17, $WS_GROUP)
GUICtrlSetTip ( -1,"Wähle Hintergrundbild was im gesperrten Modus angezeigt wird")
GUICtrlSetFont (-1,7,"","","Arial Black")
Global $TabItem2 = GUICtrlCreateTabItem("Nebenmenü")
Global $Input4 = GUICtrlCreateInput("Input1", 32, 172, 121, 21, BitOR($ES_AUTOHSCROLL,$ES_RIGHT,$ES_READONLY))
ControlDisable ($Form1_1,"",$Input4)
Global $Slider1 = GUICtrlCreateSlider(28, 28, 38, 141, BitOR($TBS_VERT,$TBS_AUTOTICKS,$TBS_BOTH))
GUICtrlSetLimit (-1, 100, 0)
ControlDisable ($Form1_1,"",$Slider1)
Global $Label1 = GUICtrlCreateLabel("Optionen für gesperrten Modus", 32, 10, 200, 17)
GUICtrlSetFont (-1, 11,"")
Global $Checkbox1 = GUICtrlCreateCheckbox("Fenster fixieren", 120, 59, 180, 17)
GUICtrlSetTip ( -1,"Fixiert das Programmfenster im gesperrten Modus")
Global $Checkbox2 = GUICtrlCreateCheckbox("Transparenz an", 120, 123, 180, 17)
GUICtrlSetTip ( -1,"Der Hintergrund kann beliebig Transparent eingestellt werden (Erlaubt ''Desktop anzeigen'')")
Global $Checkbox3 = GUICtrlCreateCheckbox("Desktop anzeigen", 120, 91, 180, 17)
GUICtrlSetTip ( -1,"Desktopsymbole und Taskleiste im gesperrten Modus anzeigen")
ControlDisable ($Form1_1,"",$Checkbox3)
GUISetState(@SW_HIDE)
Global $FormTrans = 1
Global $ToolPos = "10"
While 1
WinSetTrans ($Form1_1,"",$FormTrans)
$FormTrans = $FormTrans + 7
Sleep (5)
If $FormTrans >= 255 then ExitLoop
If $FormTrans = 8 then GUISetState(@SW_SHOW) ;Das Fenster erscheint standartmäßig ohne transparenz, ohne diese funktion würde es kurz ohne transparenz erscheinen und dann erst transparenz 1 bis 255 gesetzt werden
WEnd
#EndRegion ### END Koda GUI section ###
EndFunc
#EndRegion;===========================END
#Region;===========================GUI Create Hotkeys Optionen
$Form1 = GUICreate(" Hotkeys Optionen", 200, 230, 192, 124, BitOR($WS_CLIPCHILDREN,$WS_CLIPSIBLINGS), BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Button7 = GUICtrlCreateButton("Speichern", 20, 168, 75, 25, $WS_GROUP)
$Button8 = GUICtrlCreateButton("Abbrechen", 106, 168, 75, 25, $WS_GROUP)
$Input5 = GUICtrlCreateInput("Input1", 115, 24, 73, 21)
$Input6 = GUICtrlCreateInput("Input2", 115, 56, 73, 21)
$Input7 = GUICtrlCreateInput("Input3", 115, 96, 73, 21)
$Input8 = GUICtrlCreateInput("Input4", 115, 128, 73, 21)
$Label1 = GUICtrlCreateLabel("DeskKey Ausblenden", 5, 24, 110, 25)
$Label2 = GUICtrlCreateLabel("DeskKey Einblenden", 5, 56, 110, 17)
$Label3 = GUICtrlCreateLabel("Desktopsperre an", 5, 96, 110, 17)
$Label4 = GUICtrlCreateLabel("Desktopsperre aus", 5, 128, 110, 17)
GUISetState(@SW_HIDE)
#EndRegion;===========================END
#Region;===========================VARIABLEN
$1 = 0
$2 = 0
$4 = 0
$5 = 0
$8 = 0
$10 = 4 ;Checkbox1
$11 = 4 ;Checkbox2
$20 = 0
$mcc = 0
$mcx = 0
$mcy = 0
$Exit = 0
$Pic = "standart.jpg"
$PicW = 0
$Click = 0
$Win_B_S = 0 ;Status 0=SmallMode / 1=BigMode
$read1_1 = ""
$PicError = 0
;Standart Winmode=Big
$WinsizeWight = 330
$WinsizeHight = 230
#EndRegion;===========================END
#Region;===========================ON_EVENT
guisetonevent ($GUI_EVENT_CLOSE, "Close", $Form1_1)
guictrlsetonevent ($Button1,"OnOff")
guictrlsetonevent ($Button2,"OnOff_WS_WB")
guictrlsetonevent ($Button5,"PicAuswahl")
guictrlsetonevent ($Button6,"ShowOptionen")
guictrlsetonevent ($Button8,"HideOptionen") ; Sollte $Button8 "HideOptionen" zuweisen, aber er tut sich nichts
GUISetOnEvent ($GUI_EVENT_PRIMARYUP, "Form1Move", $Form1)
#EndRegion;===========================END
#Region;===========================While Schleife
While 1
$ReadI4 = GUICtrlRead ($Slider1, 1)
GUICtrlSetData ($Input4, $ReadI4 & " % Transparenz ")
If $8 = 1 then
WinA()
WinAWightHight()
ElseIf $8 = 0 then
_MouseTrap()
TransSlider() ;$8 = 0 also im entsperrten modus ;ließt Wert von Checkbox 2 & Enabeld/Disabled disbezüglich Slider
EnableCheck3() ;Prüft ob Transparenz eingestellt, wenn ja dann kann Desktop angezeigtw werden
EndIf
Time()
WinPos()
WEnd
#EndRegion;===========================END
#Region;===========================Form1 Move
Func Form1Move()
$Winpos6 = WinGetPos ($Form1_1,"")
WinMove ($Form1,"",$Winpos6[0] + 330,$Winpos6[1])
EndFunc
#EndRegion;===========================END
#Region;===========================Form1 Hide
Func HideOptionen()
msgbox(0, "", "")
WinSetState ($Form1,"",@SW_HIDE)
EndFunc
#EndRegion;===========================END
#Region;===========================Form1 Show
Func ShowOptionen()
$Winpos6 = WinGetPos ($Form1_1,"")
WinMove ($Form1,"",$Winpos6[0] + 330,$Winpos6[1])
WinSetState ($Form1,"",@SW_SHOW)
EndFunc
#EndRegion;===========================END
#Region;===========================Form1_1 Bildauswahl
Func PicAuswahl()
$Pic = FileOpenDialog("Bild wählen",@DesktopDir,"Bilder (*.jpg;*.bmp;*.gif;)")
$picW = 1
If @error then $PicW = 0
EndFunc
#EndRegion;===========================END
#Region;===========================Prüft ob Trasparenz eingestellt, wenn ja dann kann der Desktop & Taskleiste sichtbar gemacht werden
Func EnableCheck3()
$ReadCheck2 = GUICtrlRead ($Checkbox2, 0)
$ReadCheck3 = GUICtrlRead ($Checkbox3, 0)
If ($ReadCheck2 = 4 and $ReadCheck3 = 1) then ControlClick ($Form1_1,"",$Checkbox3)
If $ReadCheck2 = 1 then
ControlEnable ($Form1_1,"",$Checkbox3)
Else
ControlDisable ($Form1_1,"",$Checkbox3)
EndIf
EndFunc
#EndRegion;===========================END
#Region;===========================Prüft ob Transparenz eingestellt ist
Func TransSlider()
$ReadTransparenzE = GUICtrlRead ($Checkbox2, 0)
If $ReadTransparenzE = 1 then
ControlEnable ($Form1_1,"",$Slider1)
Else
ControlDisable ($Form1_1,"",$Slider1)
EndIf
EndFunc
#EndRegion;===========================END
#Region;=======================WIN_SMALL & WIN_BIG============================
Func OnOff_WS_WB()
$20 = $20 + 1
If $20 = 2 then $20 = 0
If $20 = 0 then WinBig()
If $20 = 1 then WinSmall()
EndFunc
Func WinSmall()
If $OS = "WIN_VISTA" then
WinSmallVista()
ElseIf $OS = "WIN_XP" then
WinSmallXp()
EndIf
EndFunc
Func WinSmallVista() ;Wenn Os: Vista // Kleiner Modus
$mcc = Mousegetpos()
$mcx = $mcc[0]
$mcy = $mcc[1]
$WinposH = WinGetPos ("DeskKey","")
$MouseposH = MouseGetPos ()
If $8 = 0 then
MouseMove ($WinposH[0] + 10,$WinposH[1] + 50, 0)
MouseDown ("Left")
Sleep (100)
MouseUp ("Left")
Else
EndIf
MouseMove ($WinposH[0] + 255,$WinposH[1] + 80, 0)
WinMove ($Form1_1,"",$WinposH[0],$WinposH[1],288,90)
ControlHide ($Form1_1,"",$Input3)
ControlHide ($Form1_1,"",$Edit1)
ControlHide ($Form1_1,"",$Button5)
ControlHide ($Form1_1,"",$Tab1)
GUICtrlSetPos ($Input1,8,6)
GUICtrlSetPos ($Input2,8,38)
GUICtrlSetPos ($Button1,230, 6, 43, 38)
GUICtrlSetPos ($Button2,230, 44, 43, 20)
$Win_B_S = 1 ;SmallModeON gibt WinPos0 Wert
Mousemove($mcx, $mcy, 1)
EndFunc
Func WinSmallXp() ;Wenn Os: Xp // Kleiner Modus
$mcc = Mousegetpos()
$mcx = $mcc[0]
$mcy = $mcc[1]
$WinposH = WinGetPos ("DeskKey","")
$MouseposH = MouseGetPos ()
If $8 = 0 then
MouseMove ($WinposH[0] + 10,$WinposH[1] + 50, 0)
MouseDown ("Left")
Sleep (100)
MouseUp ("Left")
Else
EndIf
MouseMove ($WinposH[0] + 255,$WinposH[1] + 80, 0)
WinMove ($Form1_1,"",$WinposH[0],$WinposH[1],288,100)
ControlHide ($Form1_1,"",$Input3)
ControlHide ($Form1_1,"",$Edit1)
ControlHide ($Form1_1,"",$Button5)
ControlHide ($Form1_1,"",$Tab1)
GUICtrlSetPos ($Input1,8,6)
GUICtrlSetPos ($Input2,8,32)
GUICtrlSetPos ($Button1,230, 5, 43, 34)
GUICtrlSetPos ($Button2,230, 42, 43, 13)
$Win_B_S = 1 ;SmallModeON gibt WinPos0 Wert
Mousemove($mcx, $mcy, 1)
EndFunc
;===========================Os Abfrage
Func WinBig()
If $OS = "WIN_VISTA" then
WinBigVista()
ElseIf $OS = "WIN_XP" then
WinBigXp()
EndIf
EndFunc
;===========================END
Func WinBigVista() ;Wenn Os: Vista // Großer Modus
$WinposH = WinGetPos ("DeskKey","")
WinMove ($Form1_1,"",$WinposH[0],$WinposH[1],330, 230)
ControlShow ($Form1_1,"",$Input3)
ControlShow ($Form1_1,"",$Edit1)
ControlShow ($Form1_1,"",$Button5)
ControlShow ($Form1_1,"",$Tab1)
GUICtrlSetPos ($Input1,24, 6)
GUICtrlSetPos ($Input2,24,38)
GUICtrlSetPos ($Button1, 272, 6, 43, 49)
GUICtrlSetPos ($Button2, 1 - 1, 185, 21, 20)
$Win_B_S = 0 ;BigModeON gibt WinPos0 Wert
EndFunc
Func WinBigXp() ;Wenn Os: Xp // Großer Modus
$WinposH = WinGetPos ("DeskKey","")
WinMove ($Form1_1,"",$WinposH[0],$WinposH[1],330, 230)
ControlShow ($Form1_1,"",$Input3)
ControlShow ($Form1_1,"",$Edit1)
ControlShow ($Form1_1,"",$Button5)
ControlShow ($Form1_1,"",$Tab1)
GUICtrlSetPos ($Input1,24, 6)
GUICtrlSetPos ($Input2,24,38)
GUICtrlSetPos ($Button1, 272, 6, 43, 49)
GUICtrlSetPos ($Button2, 1 - 1, 168, 21, 20) ;1 - 1 zwecks bug behebung Oo
$Win_B_S = 0 ;BigModeON gibt WinPos0 Wert
EndFunc
#EndRegion;===========================END==========================================
#Region;===========================
Func WinAWightHight()
If $Win_B_S = 0 then
$WinsizeWight = 330
$WinsizeHight = 230
ElseIf $Win_B_S = 1 then
$WinsizeWight = 288
$WinsizeHight = 90
EndIf
EndFunc
#EndRegion;===========================END
#Region;===========================Gui im Vordergrund // Maus bleibt im Fensterbereich (im gesperrten Modus)
Func WinA()
$Mousepos = MouseGetPos ()
$Winpos = WinGetPos ("DeskKey","")
$Winstate = WinGetState ("DeskKey","") ;WinGetState
If $Winstate <= 8 then WinActivate ("DeskKey","")
If WinExists ("Windows Task-Manager") then WinKill ("Windows Task-Manager")
_MouseTrap ($winpos[0],$winpos[1],$winpos[0] + $WinsizeWight ,$winpos[1] + $WinsizeHight)
EndFunc
#EndRegion;===========================END
#Region;========================Window im Desktopbereich bleiben
Func WinPos()
If $10 = 1 then
WinMove ($Form1_1,"",@DesktopWidth /2 - 162 , @DesktopHeight /2 -102)
Else
WinPos0()
EndIf
EndFunc
Func WinPos0()
If $Win_B_S = 1 then
WinPos1() ;Small
Else
WinPos2() ;Big
EndIf
EndFunc
Func WinPos1() ;SmallMode
$winpos = WinGetPos ($Form1_1,"")
If $winpos[0] >= @DesktopWidth -288 then winmove_x()
If $winpos[1] >= @DesktopHeight -90 then winmove_y()
If $winpos[0] <= 0 then winmove_x2()
If $winpos[1] <= 0 then winmove_y2()
EndFunc
Func WinPos2() ;BigMode
$winpos = WinGetPos ($Form1_1,"")
If $winpos[0] >= @DesktopWidth -330 then winmove_x()
If $winpos[1] >= @DesktopHeight -230 then winmove_y()
If $winpos[0] <= 0 then winmove_x2()
If $winpos[1] <= 0 then winmove_y2()
EndFunc
Func winmove_x()
$winpos2 = WinGetPos ($Form1_1,"")
winmove($Form1_1,"",$winpos2[0] -5,$winpos2[1])
EndFunc
Func winmove_y()
$winpos3 = WinGetPos ($Form1_1,"")
winmove($Form1_1,"",$winpos3[0] ,$winpos3[1] -5)
EndFunc
Func winmove_x2()
$winpos4 = WinGetPos ($Form1_1,"")
winmove($Form1_1,"",$winpos4[0] +5,$winpos4[1])
EndFunc
Func winmove_y2()
$winpos5 = WinGetPos ($Form1_1,"")
winmove($Form1_1,"",$winpos5[0] ,$winpos5[1] +5)
EndFunc
#EndRegion;===========================END
#Region;===========================Zeit + Datum
Func Time()
$Time = _NowTime(5)
$Date = _NowDate()
GUICtrlSetData ($Input3,"Time:"&" "&$Time&" "&"Date:"&" "&$Date)
EndFunc
#EndRegion;===========================END
#Region;===========================Gui Exit
Func Close()
$FormTrans1 = 255
If $Exit = 0 then
While 1
WinSetTrans ($Form1_1,"",$FormTrans1)
$FormTrans1 = $FormTrans1 - 7
Sleep (5)
If $FormTrans1 <= 8 then Exit
WEnd
Else
ToolTip ("Gesperrt")
Sleep (2000)
ToolTip ("")
EndIf
EndFunc
#EndRegion;===========================END
#Region;===========================ON/Off Phase Auswahl
Func OnOff()
$1 = $1 + 1
If $1 = 2 then $1 = 0
If $1 = 0 then off1() ;durchläuft die phase off1 - off2
If $1 = 1 then on1() ;durchläuft die phase on1 - on3
EndFunc
#Region;==================ON-PHASE 1-3=====================
Func on1() ;PHASE 1
If $4 = 0 then on2()
EndFunc
#EndRegion;====================================================
Func on2() ;PHASE 2
$6 = GUICtrlRead ($Input1, 1) ;Passwort-Eingabefeld
$7 = GUICtrlRead ($Input2, 1) ;Passwort Wiederholen-Eingabefeld
Sleep (100)
if $6 == $7 then
on3()
Else
$Winpos2 = WinGetPos ("DeskKey","")
ToolTip (" ",$Winpos2[0] + 36,$winpos2[1] + 70 + $ToolPos,"WRONG",3,1)
Sleep (1500)
ToolTip ("")
$1 = 0 ;Eingabe Falsch, $1 wird wieder zurückgesetzt
EndIf
EndFunc
Func on3() ;PHASE 3
$2 = GUICtrlRead ($Input1, 1)
$10 = GUICtrlRead ($Checkbox1,0);Checkbox1
$11 = GUICtrlRead ($Checkbox3,0);Checkbox2
$12 = GUICtrlRead ($Checkbox2,0);Checkbox3
$13 = GUICtrlRead ($Slider1, 1) ;Transparenz
$4 = 1
$8 = 1
$Exit = 1
Sleep (100)
GUICtrlSetData ($Button1, "OFF")
ControlDisable ($Form1_1,"",$Input2)
ControlDisable ($Form1_1,"",$Button5)
ControlDisable ($Form1_1,"",$Edit1)
ControlDisable ($Form1_1,"",$Tab1)
GUICtrlSetData ($Input1,"")
GUICtrlSetData ($Input2,"")
If $11 = 4 then
Opt('WINTITLEMATCHMODE', 4)
ControlHide('classname=Shell_TrayWnd', '', '')
ControlHide('classname=Progman', '', '')
;winsetstate("Start", "", @SW_HIDE)
Else
EndIf
If $picW = 0 then
SplashTextOn ("DesKKey","",@DesktopWidth +2, @DesktopHeight +2, -2, -2, 1)
If $12 = 1 then WinSetTrans ("DesKKey","",255 - $13 * 2.55) ;(255 = MaxTransparenz) - (1 bis 100%) * (2.55 = 1%) ;schaut kompliziert aus isses aber nicht, der zweck ist gewünschte/Optimales Anzeige + Erleichterte weiterverarbeitung
ElseIf $picW = 1 then
SplashImageOn ("DesKKey",$Pic,@DesktopWidth +2, @DesktopHeight +2, -2, -2, 1)
If $12 = 1 then WinSetTrans ("DesKKey","",255 - $13 * 2.55) ;(255 = MaxTransparenz) - (1 bis 100%) * (2.55 = 1%)
EndIf
WinSetOnTop ($Form1_1,"",1)
EndFunc
#EndRegion;====================================================
#Region;===================OFF PHASE 1-2====================
Func off1()
If $4 = 1 then off2()
EndFunc
Func off2() ;PHASE 1
$3 = GUICtrlRead ($Input1, 1)
Sleep (100)
If $2 == $3 then
off3()
Else
$Winpos2 = WinGetPos ("DeskKey","")
ToolTip (" ", $Winpos2[0] + 36,$winpos2[1] + 40 + $ToolPos,"WRONG PASSWORT",3,1)
Sleep (1500)
ToolTip ("")
$1 = 1 ;Eingabe Falsch, $1 wird wieder zurückgesetzt
EndIf
EndFunc
Func off3() ;PHASE 2
$10 = 4 ;Checkbox1
$4 = 0
$8 = 0
$Exit = 0
ControlEnable ($Form1_1,"",$Input2)
ControlEnable($Form1_1,"",$Button5)
ControlEnable ($Form1_1,"",$Edit1)
ControlEnable ($Form1_1,"",$Tab1)
GUICtrlSetData ($Button1, "ON")
GUICtrlSetData ($Input1, "")
If $11 = 4 then
ControlShow('classname=Shell_TrayWnd', '', '')
ControlShow('classname=Progman', '', '')
;winsetstate("Start", "", @SW_SHOW)
;sleep (10)
;winsetstate("Start", "", @SW_SHOW)
;WinActivate ($Form1_1,"")
Else
EndIf
SplashOff()
;Sleep (500)
;_MouseTrap()
EndFunc
#EndRegion;=====================================================
While 1
Sleep (10)
WEnd
Das Ganze auch zum Download:
autoit.de/wcf/attachment/5835/
//Mfg. Freedom