DeskKey v 0.4

  • Hi Leute 8)
    ---------------------
    Möchte heute mein neues Programm vostellen (DeskKey):


    Features:

    *Desktop via Passwort sperren

    *Desktop durch Bild / Grafik blockieren

    *Taskmanager im gesperrten Modus blockiert :)


    Features neu bei 0.3.2:

    *Kleinen "FileOpenDialog" Bug behoben

    *Groß und Kleinschreibung wird nichtmehr ignoriert

    *Neuer Gui Background :)


    Features neu bei 0.4.0:

    *Weitere Bugfix

    *Fenstermode: Small / Big

    *Nun Einstellungen für gesperrten Modus
    _(Transparenz)
    _(Fensterfixierung)
    _("Desktopsymbole, Taskleiste" - anzeigen, ausblenden)


    Script + Exe : bisher nur unter WindowsVista getestet
    Version 0.3.1 = autoit.de/wcf/attachment/5635/

    Version 0.3.2 = autoit.de/wcf/attachment/5651/

    Version 0.4.0 = autoit.de/wcf/attachment/5734/


    Script:

    Spoiler anzeigen
    [autoit]


    #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('SendCapslockMode', 1)
    $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 (1000)
    $info2 = SplashTextOn ("info2","Version: 0.4.0 beta 4",300,45,@DesktopWidth /2 - 150 ,@DesktopHeight /2 - 22,1)
    $info2Trans = 255
    Sleep (1000)
    While 1
    WinSetTrans ($info2,"",$info2Trans)
    $info2Trans = $info2Trans -5
    Sleep (5)
    If $info2Trans <= 1 then ExitLoop
    WEnd
    SplashOff ()
    #Region ### START Koda GUI section ### Form=d:\prog\au3 files\deskkey\coda fd\v0.kxf
    $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,

    [/autoit] [autoit][/autoit] [autoit]

    $Button2 = GUICtrlCreateButton("|||||", 0, 184, 21, 20, $WS_GROUP,$BS_VCENTER)
    GUICtrlSetBkColor (-1, 0x99CCCC)
    GUICtrlSetFont (-1,"","","Stencil")
    GUICtrlSetTip ( -1,"Fenster verkleinern / vergrößern")
    $Tab1 = GUICtrlCreateTab(-2, 0, 327, 205,($TCS_VERTICAL))
    GUICtrlSetBkColor (-1,0x33518B)
    GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)

    $TabItem1 = GUICtrlCreateTabItem("Hauptmenü")
    GUICtrlSetFont (-1,7,"","","Arial Black")

    [/autoit] [autoit][/autoit] [autoit]

    $Input1 = GUICtrlCreateInput("", 24, 6, 240, 21, $ES_PASSWORD)
    GUICtrlSetTip (-1,"Passwort hier eingeben","","",1)
    $Input2 = GUICtrlCreateInput("", 24, 38, 240, 21, $ES_PASSWORD)
    GUICtrlSetTip (-1,"Passwort Wiederholen","","",1)
    $Input3 = GUICtrlCreateInput ("", 102, 70, 180, 17, $ES_READONLY)
    ControlDisable ($Form1_1,"",$Input3)
    $Edit1 = GUICtrlCreateEdit("Hier kannst du deine Nachricht hinterlassen...", 24, 94, 298, 105)
    $Button1 = GUICtrlCreateButton("ON", 274, 6, 43, 49, $WS_GROUP)
    GUICtrlSetTip ( -1,"In gesperrten / entsperrten Modus wechseln")
    GUICtrlSetFont (-1,10,"","","Arial Black")
    $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")
    $TabItem2 = GUICtrlCreateTabItem("Nebenmenü")
    $Input4 = GUICtrlCreateInput("Input1", 32, 172, 121, 21, BitOR($ES_AUTOHSCROLL,$ES_RIGHT,$ES_READONLY))
    ControlDisable ($Form1_1,"",$Input4)
    $Slider1 = GUICtrlCreateSlider(28, 28, 38, 141, BitOR($TBS_VERT,$TBS_AUTOTICKS,$TBS_BOTH))
    GUICtrlSetLimit (-1, 100, 0)
    ControlDisable ($Form1_1,"",$Slider1)
    $Label1 = GUICtrlCreateLabel("Optionen für gesperrten Modus", 32, 10, 200, 17)
    GUICtrlSetFont (-1, 11,"")
    $Checkbox1 = GUICtrlCreateCheckbox("Fenster fixieren", 120, 59, 180, 17)
    GUICtrlSetTip ( -1,"Fixiert das Programmfenster im gesperrten Modus")
    $Checkbox2 = GUICtrlCreateCheckbox("Transparenz an", 120, 123, 180, 17)
    GUICtrlSetTip ( -1,"Der Hintergrund kann beliebig Transparent eingestellt werden (Erlaubt ''Desktop anzeigen'')")
    $Checkbox3 = GUICtrlCreateCheckbox("Desktop anzeigen", 120, 91, 180, 17)
    GUICtrlSetTip ( -1,"Desktopsymbole und Taskleiste im gesperrten Modus anzeigen")
    ControlDisable ($Form1_1,"",$Checkbox3)
    GUISetState(@SW_HIDE)
    $FormTrans = 1
    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

    [/autoit] [autoit][/autoit] [autoit]

    ;$WinposTip = WinGetPos ($Form1_1,"")
    ;ToolTip ("Small Mode",$WinposTip[0] + 10 ,$WinposTip[1] + 215,"Klick Me",1,1)
    ;Sleep (2000)
    ;ToolTip ("")
    #EndRegion ### END Koda GUI section ###
    $1 = 0
    $2 = 0
    $4 = 0
    $5 = 0
    $8 = 0
    $10 = 4 ;Checkbox1
    $11 = 4 ;Checkbox2
    $20 = 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

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Close()
    Case $Button1
    OnOff()
    Case $Button2
    OnOff_WS_WB()
    Case $Button5
    $Pic = FileOpenDialog("Bild wählen",@DesktopDir,"Bilder (*.jpg;*.bmp;*.gif;)")
    $picW = 1
    If @error then $PicW = 0
    EndSwitch
    $ReadI4 = GUICtrlRead ($Slider1, 1)
    GUICtrlSetData ($Input4, $ReadI4 & " % Transparenz ")
    If $8 = 1 then WinA()
    If $8 = 0 then TransSlider() ;$8 = 0 also im entsperrten modus ;ließt Wert von Checkbox 2 & Enabeld/Disabled disbezüglich Slider
    If $8 = 0 then EnableCheck3() ;Prüft ob Transparenz eingestellt, wenn ja dann kann Desktop angezeigtw werden
    If $8 = 1 then WinAWightHight()
    Time()
    WinPos()
    WEnd
    ;=======================WIN_SMALL & WIN_BIG============================
    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

    [/autoit] [autoit][/autoit] [autoit]

    Func TransSlider()
    $ReadTransparenzE = GUICtrlRead ($Checkbox2, 0)
    If $ReadTransparenzE = 1 then
    ControlEnable ($Form1_1,"",$Slider1)
    Else
    ControlDisable ($Form1_1,"",$Slider1)
    EndIf
    EndFunc
    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()
    $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
    EndFunc
    Func WinBig()
    $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) ;1 - 1 zwecks bug behebung Oo
    $Win_B_S = 0 ;BigModeON gibt WinPos0 Wert
    EndFunc
    ;======================================================================
    Func WinAWightHight()
    If $Win_B_S = 0 then
    $WinsizeWight = 330
    $WinsizeHight = 230
    ElseIf $Win_B_S = 1 then
    $WinsizeWight = 288
    $WinsizeHight = 90
    EndIf
    EndFunc
    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
    ;========================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

    [/autoit] [autoit][/autoit] [autoit]

    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
    ;=======================================================================================
    Func Time()
    $Time = _NowTime(5)
    $Date = _NowDate()
    GUICtrlSetData ($Input3,"Time:"&" "&$Time&" || "&"Date:"&" "&$Date)
    EndFunc
    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

    [/autoit] [autoit][/autoit] [autoit]

    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
    ;==================ON-PHASE 1-3=====================
    Func on1() ;PHASE 1
    If $4 = 0 then on2()
    EndFunc
    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,"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,"")

    [/autoit] [autoit][/autoit] [autoit]

    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
    ;====================================================

    ;===================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,"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
    _MouseTrap()
    SplashOff()
    EndFunc
    ;=====================================================
    While 1
    Sleep (10)
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit]


    (Der Spoiler zerstörrt meine korrekten Zeilenumsprünge und Leehrtasten, darum ladet euch am besten das Script herunder - siehe oben)


    // Mfg. Freeðøm 

    8 Mal editiert, zuletzt von Freeðøm (12. August 2009 um 23:40)

  • Schlichte GUI, aber funktioniert tadellos. Das gefällt mir.
    Aber mit KillAllAutoIt ist es wie immer auszuhebeln ;)

  • Nettes Tool :thumbup: !!
    Du hast aber vergessen, dass manche Leute mehr als einen Bildschirm besitzen. Man kann zwar dort nichts auswählen, aber sollte dort sollte auch kein anderes Programm mehr zu sehen sein. Außerdem wird die Gui dann immer in den ersten Bildschirm geschoben.

  • So Neue Version raus (DeskKey 0.4.0) (Siehe Post 1) bisher bei WinVista gestestet, würde mir viel helfen wenn es jemand auf WinXp, Win2000, Win7 testet und mir ein Feedback gibt. mfg


    Zitat


    Nettes Tool :thumbup: !!
    Du hast aber vergessen, dass manche Leute mehr als einen Bildschirm besitzen. Man kann zwar dort nichts auswählen, aber sollte dort sollte auch kein anderes Programm mehr zu sehen sein. Außerdem wird die Gui dann immer in den ersten Bildschirm geschoben.

    funkey Sorry das mit dem Mehreren Monitoren hab ich noch nicht behoben, werden es demnächst versuchen.