Sign in to follow this  
Followers 0
AppTux

PowerSlide2Unlock

45 posts in this topic

#1 ·  Posted (edited)

I made this program a while ago, it's a program what shows a screen with a slider so you can 'unlock' your computer.

Things annoying me:

- Fade in is slow on my PC, but I heard from other people it's not on theirs.

- Timer so you have to hold it right for a few seconds still doesn't work.

Things I want to do:

- Password usage (HALF DONE see Edit 15-02-2011) :D

- Let the window always stay on top (DONE)

If you know how to fix it or you have any suggestions, please let me know!! :idiot:

Together we can make it way better :D

If you don't understand something of the code, let me know and I'll explain.

EDIT: News: I'm gonna rewrite the whole code. So any help will be appreciated! :idiot:

Code and Images: PS2U.zip

EDIT:

Made the slider bar a bit smaller for lazy guys.

End animations same as the start animations

Please use the updated code below this instead of the one in the attachment or you won't have the edited parts. :D

EDIT 14-02-2011:

-The Bars are a bit transparent;

-The program don't use screenshots anymore: The bars are a window with transparency of 250, the 'overlay' so you can't touch the windows behind has a transparency of 1 :D

-Deleted some comments

EDIT/UPDATE 15-02-2011:

-Added Password protection (still hard coded in script, so it's easy to hack so far ;) gonna make it better in next version ;) )

-Window always stays on top

I think I'm gonna focus on the clarity of the code, because in my opinion the code is not so clear :)

The most updated code: (not included in the .zip, just too lazy for that)

#region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GUIEdit.au3>
#include <StaticConstants.au3>
#include <String.au3>
#include <WinAPI.au3>
#include <Timers.au3>

Global $SW = @DesktopWidth, $SH = @DesktopHeight, $PwdOpen = 0, $Password = "1234"

$MGUI = GUICreate("WindowSlideToUnlock", $SW, $SH, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000, $MGUI)
$TOPBACK = GUICtrlCreatePic("Data\s2u-b-b.bmp", 0, 0, $SW, 50)
$BOTTOMBACK = GUICtrlCreatePic("Data\s2u-u-b.bmp", 0, $SH - 250, $SW, 250)
$BARLEFT = GUICtrlCreatePic("Data\s2u-b-l.bmp", 197.5, $SH - 151, 21, 52)
$BARMIDDLE = GUICtrlCreatePic("Data\s2u-b-m.bmp", 218.5, $SH - 151, $SW - 437, 52)
$BARRIGHT = GUICtrlCreatePic("Data\s2u-b-r.bmp", $SW - 223.5, $SH - 151, 21, 52)
$BARLABEL = GUICtrlCreateLabel("Fill in Password", 200, $SH - 151, $SW - 400, 52, $SS_NOTIFY & $SS_CENTER)
$TIME = GUICtrlCreateLabel("", ($SW - 100) /2, 2, 100, 45, $SS_NOTIFY & $SS_CENTER)
$ARROW = GUICtrlCreatePic("Data\s2u-b-sign.bmp", ($SW - 35) /2,$SH -250,35,35)

_SETSTATEANDFONT()

_SETTHETIME()

WinSetTrans($MGUI, "", 0)

;---Create overlay window so you can't touch the window behind
$OVERLAY = GUICreate("Overlay",$SW,$SH - 300,0, 50, $WS_POPUP, $WS_EX_TOPMOST, $MGUI)
WinSetTrans($OVERLAY, "",1)

GUISetState(@SW_SHOW, $OVERLAY)

$TOPRGN = _WinAPI_CreateRectRgn(0,0,$SW,50)
$BOTTOMRGN = _WinAPI_CreateRectRgn(0,$SH - 250,$SW, $SH)
_WinAPI_CombineRgn($TOPRGN, $TOPRGN, $BOTTOMRGN,$RGN_OR)
_WinAPI_SetWindowRgn($MGUI,$TOPRGN)

GUISetState(@SW_SHOW, $MGUI)

$PwdGui = GUICreate("Password input",250,100,-1,$SH - 348, $WS_POPUP, $WS_EX_TOPMOST, $MGUI)
GUISetBkColor(0x000000,$PwdGui)
$PwdBack = GUICtrlCreatePic("Data\s2u-p-b.bmp",0,0,250,100, $GUI_DISABLE)
$PwdInput = GUICtrlCreateInput("", 25,10,200,60, BitOR ($ES_PASSWORD,$SS_CENTER,$SS_CENTERIMAGE))
GUICtrlSetLimit (-1,4)
GUICtrlSetBkColor (-1,0xFFFFFF)
GUICtrlSetFont (-1, 35-1,"","Lucida Sans")
GUICtrlSetColor (-1, 0x000000)
WinSetTrans("Password input","",250)
GUISetState(@SW_HIDE, $PwdGui)

$wSlide = GUICreate("HH", 60, 45, 200, $SH - 147.5, $WS_POPUP, $WS_EX_TOPMOST, $MGUI)
$slider = GUICtrlCreatePic("Data\s2u-b-u.bmp", 0, 0, 60, 45)
WinSetTrans($wSlide,"",0)
GUISetState(@SW_HIDE, $wSlide)

For $TRANS = 0 To 250 Step 15
    WinSetTrans($wSlide, "", $TRANS)
    WinSetTrans($MGUI, "", $TRANS)
    If $TRANS >= 250 Then
        ExitLoop
    EndIf
Next

WinSetTrans($MGUI, "", 250)

While 1
    If $PwdOpen = 0 Then
        If Not WinActive ($MGUI,"") Then WinActivate ($MGUI,"")
    Else
        If Not WinActive ($PwdGui,"") Then WinActivate ($PwdGui,"")
    EndIf
    If StringLen(GUICtrlRead($PwdInput)) = 4 Then
        If GUICtrlRead($BARLABEL) <> "Slide To Unlock" Then
            GUICtrlSetData($BARLABEL,"Slide To Unlock")
            GUISetState(@SW_SHOW, $wSlide)
        EndIf
    Else
        If GUICtrlRead($BARLABEL) <> "Fill in Password" Then
            GUICtrlSetData($BARLABEL,"Fill in Password")
            GUISetState(@SW_HIDE, $wSlide)
        EndIf
    EndIf
    _SETTHETIME()
    $MINFO = GUIGetCursorInfo($wSlide)
    $hMsg = GUIGetMsg()
    If $hMsg = $ARROW Then
        _ShowPassWord()
    ElseIf $hMsg = $GUI_EVENT_CLOSE Then
        Exit
    EndIf
    If $MINFO[4] = $slider Then
        $POS = 1
        $MINFO = GUIGetCursorInfo($wSlide)
        While $MINFO[4] = $slider
            $MINFO = GUIGetCursorInfo($wSlide)
            If $MINFO[2] = 1 Then
                $MINFO = GUIGetCursorInfo($wSlide)
                $MPOS = MouseGetPos()
                ConsoleWrite($MPOS[0] & @CRLF)
                $CONTROLPOS = $MPOS[0] - 200
                While $MINFO[2] = 1
                    $MINFO = GUIGetCursorInfo($wSlide)
                    $POS = MouseGetPos()
                    $POS = $POS[0] - $CONTROLPOS
                    If $POS <= 200 Then
                        WinMove("HH", "", 200, $SH - 147.5)
                    ElseIf $POS >= $SW - 265 Then
                        WinMove($wSlide, "", $SW - 265, $SH - 147.5)
                        _Timer_SetTimer($MGUI,1000, _SLIDEFULL(),-1)
                    Else
                        WinMove("HH", "", $POS, $SH - 147.5)
                    EndIf
                    Sleep(5)
                WEnd
                Do
                    WinMove("HH", "", $POS, $SH - 147.5)
                    $POS = $POS - 40
                    Sleep(5)
                Until $POS <= 200
                WinMove("HH", "", 200, $SH - 147.5)
            EndIf
            Sleep(10)
        WEnd
    EndIf
    Sleep(1)
WEnd

Func _ShowPassWord()
    ConsoleWrite("_ShowPassWord() function called"&@CR)
    If $PwdOpen = 0 Then
        GUICtrlSetImage($ARROW,"Data\s2u-b-sign-inverse.bmp")
        GUISetState(@SW_SHOW, $PwdGui)
        $PwdOpen = 1
    ElseIf $PwdOpen = 1 Then
        GUICtrlSetImage($ARROW,"Data\s2u-b-sign.bmp")
        GUISetState(@SW_HIDE, $PwdGui)
        $PwdOpen = 0
    EndIf
EndFunc

Func _SETSTATEANDFONT()
    GUICtrlSetColor($BARLABEL, 0x373737)
    GUICtrlSetBkColor($BARLABEL, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont($BARLABEL, 21, 400, "", "Lucida Sans")
    GUICtrlSetBkColor($TIME, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont($TIME, 20, 400, "", "Lucida Sans")
    GUICtrlSetColor($TIME, 0xFFFFFF)

    For $X = $TOPBACK To $BARRIGHT
        GUICtrlSetState($X, $GUI_DISABLE)
    Next
EndFunc   ;==>_SETSTATEANDFONT

Func _SETTHETIME()
    $MIN = @MIN
    $HOUR = @HOUR
    $T = GUICtrlRead($TIME)
    If $T <> $HOUR &":"& $MIN Then
        GUICtrlSetData($TIME, $HOUR&":"&$MIN)
    EndIf
EndFunc   ;==>_SETTHETIME

Func _SLIDEFULL()
    If GUICtrlRead($PwdInput) = $Password Then
        GUISetState(@SW_HIDE, $PwdGui)
        $TRANS = 250
        For $TRANS = 250 To 0 Step -25
            WinSetTrans($wSlide, "", $TRANS)
            WinSetTrans($MGUI, "", $TRANS)
            ConsoleWrite($TRANS&@CR)
            If $TRANS <= 0 Then
                ExitLoop
            EndIf
        Next
        Exit
    Else
        $PwdOpen = 0
        _ShowPassWord()
        GUICtrlSetBkColor($PwdInput,0xbb0000)
    EndIf
EndFunc   ;==>_SLIDEFULL

For the 2nd time: Suggestions are welcome!!

All the files are in the Attachments

Edited by AppTux

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites



Looks good AppTux :)

For me the slider flickers a lot when I move it. If you make the slider like this

$wSlide=GUICreate("HH", 60, 45, 22.5, $SH - 147.5,$WS_POPUP)
$slider=GUICtrlCreatePic("Data\s2u-b-u.bmp", 0, 0, 60, 45,-1,$GUI_WS_EX_PARENTDRAG)
Guisetstate()
winsetontop($wSlide,"",1)

then it's much better, but then there is some extra work needed to ensure the slider window stays on top.

I would also prefer it if I didn't need to move the slider so far, but I'm just lazy.

On an iPad it unlocks when you slide to the end and hold it there for a short time rather than just get to the end and I prefer the iPad way.

When I move the slider to the far right the controls start to move and flicker. I would prefer that they just disappeared.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Thanks for your reply;

I think it's possible to hold it a short time right and unlock it then, today I can't do it anymore, but tomorrow I'll try and update the code.

First I was going to do a single window for the slider, but it's a lot of work and code to do it. The minor problem of that is the y position on the screen. I haven't enough experience with that, but I'll try to make it work good.

And the distance of the movement of the slider: That's possible and not too much work in the code. I'll do it tomorrow!

About the last animations: what about the same animation in the begin???


PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites

Thanks for your reply;

I think it's possible to hold it a short time right and unlock it then, today I can't do it anymore, but tomorrow I'll try and update the code.

First I was going to do a single window for the slider, but it's a lot of work and code to do it. The minor problem of that is the y position on the screen. I haven't enough experience with that, but I'll try to make it work good.

And the distance of the movement of the slider: That's possible and not too much work in the code. I'll do it tomorrow!

About the last animations: what about the same animation in the begin???

I don't think the y position of the window is a problem because it will be the same as your button because your window is full screen. You can also ignore some of what I said because the parent drag idea isn't needed.

It only needs a simple change to your script I think.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****5
#include <File.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GUIEdit.au3>
#include <File.au3>
#include <StaticConstants.au3>
#include <String.au3>
#include <ScreenCapture.au3>
#include <SQLite.au3>

$SW = @DesktopWidth
$SH = @DesktopHeight

_ScreenCapture_Capture("C:\Documents and Settings\martin\Local Settings\Temp\data\Data\s2u-back.bmp", 0, 0, $SW, $SH-250, False)
$MGUI = GUICreate("WindowSlideToUnlock", $SW, $SH, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000, $MGUI)
$BACK = GUICtrlCreatePic("Data\s2u-back.bmp", 0, 0, $SW, $SH-250)
$TOPBACK = GUICtrlCreatePic("Data\s2u-b-b.bmp", 0, 0, $SW, 50)
$BOTTOMBACK = GUICtrlCreatePic("Data\s2u-u-b.bmp", 0, $SH - 250, $SW, 250)
$BARLEFT = GUICtrlCreatePic("Data\s2u-b-l.bmp", 20, $SH - 151, 21, 52)
$BARMIDDLE = GUICtrlCreatePic("Data\s2u-b-m.bmp", 41, $SH - 151, $SW - 61, 52)
$BARRIGHT = GUICtrlCreatePic("Data\s2u-b-r.bmp", $SW - 41, $SH - 151, 21, 52)
$BARLABEL = GUICtrlCreateLabel("Verschuif om te ontgrendelen", 20, $SH - 151, $SW - 42, 52, $SS_NOTIFY & $SS_CENTER)
;$SLIDER = GUICtrlCreatePic("Data\s2u-b-u.bmp", 22.5, $SH - 147.5, 60, 45)
$TIME1 = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 - 75, 2, 30, 45)
$TIMEF1 = GUICtrlCreateLabel("", $SW / 2 - 75, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)
$TIME2 = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 - 45, 2, 30, 45)
$TIMEF2 = GUICtrlCreateLabel("", $SW / 2 - 45, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)
$TIMEDP = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 - 15, 2, 30, 45)
$TIMEDPF = GUICtrlCreateLabel(":", $SW / 2 - 15, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)
$TIME3 = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 + 15, 2, 30, 45)
$TIMEF3 = GUICtrlCreateLabel("", $SW / 2 + 15, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)
$TIME4 = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 + 45, 2, 30, 45)
$TIMEF4 = GUICtrlCreateLabel("", $SW / 2 + 45, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)

_SETSTATEANDFONT()

WinSetTrans($MGUI, "", 0)

GUISetState()
;sleep(9000)

For $TRANS = 0 To 250 Step 15
    WinSetTrans($MGUI, "", $TRANS)
    If $TRANS >= 250 Then
        ExitLoop
    EndIf
    sleep(50)
Next

$wSlide=GUICreate("HH", 60, 45, 22.5, $SH - 147.5,$WS_POPUP)
$slider=GUICtrlCreatePic("Data\s2u-b-u.bmp", 0, 0, 60, 45);,-1,$GUI_WS_EX_PARENTDRAG)
Guisetstate()
winsetontop($wSlide,"",1)

;WinSetTrans($MGUI, "", 255)

While 1
    _SETTHETIME()
    $MINFO = GUIGetCursorInfo($wSlide)
    Switch GUIGetMsg($MGUI)
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    If $MINFO[4] = $SLIDER Then
        $POS = 1
        $MINFO = GUIGetCursorInfo($wSlide);$MGUI)
        While $MINFO[4] = $SLIDER
            $MINFO = GUIGetCursorInfo($wSlide)
            If $MINFO[2] = 1 Then
                $MINFO = GUIGetCursorInfo($wSlide)
                $MPOS = MouseGetPos()
                ConsoleWrite($mpos[0] & @CRLF)
                $CONTROLPOS = $MPOS[0] - 22.5
                While $MINFO[2] = 1
                    $MINFO = GUIGetCursorInfo($wSlide)
                    $POS = MouseGetPos()
                    $POS = $POS[0] - $CONTROLPOS
                    If $POS <= 20 Then
                        ;ControlMove("WindowSlideToUnlock", "", $SLIDER, 22.5, $SH - 147.5)
                        WinMove("WindowSlideToUnlock", "", 22.5, $SH - 147.5)
                    ElseIf $POS >= $SW - 82.5 Then
                        ;ControlMove("WindowSlideToUnlock", "", $SLIDER, $SW - 82.5, $SH - 147.5)
                        $wSlide("HH", "", $SW - 82.5, $SH - 147.5)
                        _SLIDEFULL()
                    Else
                        winmove( "HH", "", $POS, $SH - 147.5);controlmove("WindowSlideToUnlock", "",
                    EndIf
                    Sleep(5)
                WEnd
                Do
                    WinMove("HH", "", $POS, $SH - 147.5)
                    $POS = $POS - 25
                    Sleep(5)
                Until $POS <= 22.5
                WinMove("HH", "", 22.5, $SH - 147.5)
            EndIf
            Sleep(10)
        WEnd
    EndIf
    Sleep(1)
WEnd

Func _SETSTATEANDFONT()
    GUICtrlSetColor($BARLABEL, 0x373737)
    GUICtrlSetBkColor($BARLABEL, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont($BARLABEL, 21, 400, "", "Lucida Sans")
    For $X = $TIME1 To $TIMEF4
        GUICtrlSetBkColor($X, $GUI_BKCOLOR_TRANSPARENT)
        GUICtrlSetFont($X, 20, 400, "", "Lucida Sans")
        GUICtrlSetColor($X, 0xFFFFFF)
    Next

    For $X = $BACK To $BARRIGHT
        GUICtrlSetState($X, $GUI_DISABLE)
    Next
EndFunc   ;==>_SETSTATEANDFONT

Func _SETTHETIME()
    $MIN = @MIN
    $HOUR = @HOUR
    $H1 = StringTrimRight(@HOUR, 1)
    $H2 = StringTrimLeft(@HOUR, 1)
    $M1 = StringTrimRight(@MIN, 1)
    $M2 = StringTrimLeft(@MIN, 1)
    $T1 = GUICtrlRead($TIMEF1)
    $T2 = GUICtrlRead($TIMEF2)
    $T3 = GUICtrlRead($TIMEF3)
    $T4 = GUICtrlRead($TIMEF4)
    If $T1 & $T2 & $T3 & $T4 <> $HOUR & $MIN Then
        GUICtrlSetData($TIMEF1, $H1)
        GUICtrlSetData($TIMEF2, $H2)
        GUICtrlSetData($TIMEF3, $M1)
        GUICtrlSetData($TIMEF4, $M2)
    EndIf
EndFunc   ;==>_SETTHETIME

Func _SLIDEFULL()
    $BARPOS = $SH - 151
    $SLIDERPOS = $SH - 147.5
    $BOTTOMPOS = $SH - 250
    $TOPPOS = 0
    $TOPSCREEN = _ScreenCapture_Capture("Data\s2u-topscreen.bmp", 0, 0, $SW, 50, False)
    $TOPCTRLSCREEN = GUICtrlCreatePic("Data\s2u-topscreen.bmp", 0, 0, $SW, 50)
    GUICtrlSetState($TOPBACK, $GUI_HIDE)
    For $X = $TIME1 To $TIMEF4
        GUICtrlDelete($X)
        Sleep(1)
    Next
    Do
        ControlMove($MGUI, "", $TOPCTRLSCREEN, 0, $TOPPOS)
        ControlMove($MGUI, "", $BOTTOMBACK, 0, $BOTTOMPOS)
        ControlMove($MGUI, "", $BARLEFT, 20, $BARPOS)
        ControlMove($MGUI, "", $BARMIDDLE, 41, $BARPOS)
        ControlMove($MGUI, "", $BARRIGHT, $SW - 41, $BARPOS)
        ControlMove($MGUI, "", $BARLABEL, 20, $BARPOS)
        ControlMove($MGUI, "", $SLIDER, 22.5, $SLIDERPOS)
        $TOPPOS = $TOPPOS - 2
        $BOTTOMPOS = $BOTTOMPOS + 10
        $BARPOS = $BARPOS + 10
        $SLIDERPOS = $SLIDERPOS + 10
    Until BitAND($TOPPOS <= -50, $BOTTOMPOS >= $SH)
    FileDelete("Data\s2u-back.bmp")
    Exit
EndFunc   ;==>_Exit

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

$wSlide("HH", "", $SW - 82.5, $SH - 147.5)

???

Share this post


Link to post
Share on other sites

I don't think the y position of the window is a problem because it will be the same as your button because your window is full screen. You can also ignore some of what I said because the parent drag idea isn't needed.

It only needs a simple change to your script I think.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****5
#include <File.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GUIEdit.au3>
#include <File.au3>
#include <StaticConstants.au3>
#include <String.au3>
#include <ScreenCapture.au3>
#include <SQLite.au3>

$SW = @DesktopWidth
$SH = @DesktopHeight

_ScreenCapture_Capture("C:\Documents and Settings\martin\Local Settings\Temp\data\Data\s2u-back.bmp", 0, 0, $SW, $SH-250, False)
$MGUI = GUICreate("WindowSlideToUnlock", $SW, $SH, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000, $MGUI)
$BACK = GUICtrlCreatePic("Data\s2u-back.bmp", 0, 0, $SW, $SH-250)
$TOPBACK = GUICtrlCreatePic("Data\s2u-b-b.bmp", 0, 0, $SW, 50)
$BOTTOMBACK = GUICtrlCreatePic("Data\s2u-u-b.bmp", 0, $SH - 250, $SW, 250)
$BARLEFT = GUICtrlCreatePic("Data\s2u-b-l.bmp", 20, $SH - 151, 21, 52)
$BARMIDDLE = GUICtrlCreatePic("Data\s2u-b-m.bmp", 41, $SH - 151, $SW - 61, 52)
$BARRIGHT = GUICtrlCreatePic("Data\s2u-b-r.bmp", $SW - 41, $SH - 151, 21, 52)
$BARLABEL = GUICtrlCreateLabel("Verschuif om te ontgrendelen", 20, $SH - 151, $SW - 42, 52, $SS_NOTIFY & $SS_CENTER)
;$SLIDER = GUICtrlCreatePic("Data\s2u-b-u.bmp", 22.5, $SH - 147.5, 60, 45)
$TIME1 = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 - 75, 2, 30, 45)
$TIMEF1 = GUICtrlCreateLabel("", $SW / 2 - 75, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)
$TIME2 = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 - 45, 2, 30, 45)
$TIMEF2 = GUICtrlCreateLabel("", $SW / 2 - 45, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)
$TIMEDP = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 - 15, 2, 30, 45)
$TIMEDPF = GUICtrlCreateLabel(":", $SW / 2 - 15, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)
$TIME3 = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 + 15, 2, 30, 45)
$TIMEF3 = GUICtrlCreateLabel("", $SW / 2 + 15, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)
$TIME4 = GUICtrlCreatePic("Data\s2u-t-b.bmp", $SW / 2 + 45, 2, 30, 45)
$TIMEF4 = GUICtrlCreateLabel("", $SW / 2 + 45, 2, 30, 45, $SS_NOTIFY & $SS_CENTER)

_SETSTATEANDFONT()

WinSetTrans($MGUI, "", 0)

GUISetState()
;sleep(9000)

For $TRANS = 0 To 250 Step 15
    WinSetTrans($MGUI, "", $TRANS)
    If $TRANS >= 250 Then
        ExitLoop
    EndIf
    sleep(50)
Next

$wSlide=GUICreate("HH", 60, 45, 22.5, $SH - 147.5,$WS_POPUP)
$slider=GUICtrlCreatePic("Data\s2u-b-u.bmp", 0, 0, 60, 45);,-1,$GUI_WS_EX_PARENTDRAG)
Guisetstate()
winsetontop($wSlide,"",1)

;WinSetTrans($MGUI, "", 255)

While 1
    _SETTHETIME()
    $MINFO = GUIGetCursorInfo($wSlide)
    Switch GUIGetMsg($MGUI)
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
    If $MINFO[4] = $SLIDER Then
        $POS = 1
        $MINFO = GUIGetCursorInfo($wSlide);$MGUI)
        While $MINFO[4] = $SLIDER
            $MINFO = GUIGetCursorInfo($wSlide)
            If $MINFO[2] = 1 Then
                $MINFO = GUIGetCursorInfo($wSlide)
                $MPOS = MouseGetPos()
                ConsoleWrite($mpos[0] & @CRLF)
                $CONTROLPOS = $MPOS[0] - 22.5
                While $MINFO[2] = 1
                    $MINFO = GUIGetCursorInfo($wSlide)
                    $POS = MouseGetPos()
                    $POS = $POS[0] - $CONTROLPOS
                    If $POS <= 20 Then
                        ;ControlMove("WindowSlideToUnlock", "", $SLIDER, 22.5, $SH - 147.5)
                        WinMove("WindowSlideToUnlock", "", 22.5, $SH - 147.5)
                    ElseIf $POS >= $SW - 82.5 Then
                        ;ControlMove("WindowSlideToUnlock", "", $SLIDER, $SW - 82.5, $SH - 147.5)
                        $wSlide("HH", "", $SW - 82.5, $SH - 147.5)
                        _SLIDEFULL()
                    Else
                        winmove( "HH", "", $POS, $SH - 147.5);controlmove("WindowSlideToUnlock", "",
                    EndIf
                    Sleep(5)
                WEnd
                Do
                    WinMove("HH", "", $POS, $SH - 147.5)
                    $POS = $POS - 25
                    Sleep(5)
                Until $POS <= 22.5
                WinMove("HH", "", 22.5, $SH - 147.5)
            EndIf
            Sleep(10)
        WEnd
    EndIf
    Sleep(1)
WEnd

Func _SETSTATEANDFONT()
    GUICtrlSetColor($BARLABEL, 0x373737)
    GUICtrlSetBkColor($BARLABEL, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont($BARLABEL, 21, 400, "", "Lucida Sans")
    For $X = $TIME1 To $TIMEF4
        GUICtrlSetBkColor($X, $GUI_BKCOLOR_TRANSPARENT)
        GUICtrlSetFont($X, 20, 400, "", "Lucida Sans")
        GUICtrlSetColor($X, 0xFFFFFF)
    Next

    For $X = $BACK To $BARRIGHT
        GUICtrlSetState($X, $GUI_DISABLE)
    Next
EndFunc   ;==>_SETSTATEANDFONT

Func _SETTHETIME()
    $MIN = @MIN
    $HOUR = @HOUR
    $H1 = StringTrimRight(@HOUR, 1)
    $H2 = StringTrimLeft(@HOUR, 1)
    $M1 = StringTrimRight(@MIN, 1)
    $M2 = StringTrimLeft(@MIN, 1)
    $T1 = GUICtrlRead($TIMEF1)
    $T2 = GUICtrlRead($TIMEF2)
    $T3 = GUICtrlRead($TIMEF3)
    $T4 = GUICtrlRead($TIMEF4)
    If $T1 & $T2 & $T3 & $T4 <> $HOUR & $MIN Then
        GUICtrlSetData($TIMEF1, $H1)
        GUICtrlSetData($TIMEF2, $H2)
        GUICtrlSetData($TIMEF3, $M1)
        GUICtrlSetData($TIMEF4, $M2)
    EndIf
EndFunc   ;==>_SETTHETIME

Func _SLIDEFULL()
    $BARPOS = $SH - 151
    $SLIDERPOS = $SH - 147.5
    $BOTTOMPOS = $SH - 250
    $TOPPOS = 0
    $TOPSCREEN = _ScreenCapture_Capture("Data\s2u-topscreen.bmp", 0, 0, $SW, 50, False)
    $TOPCTRLSCREEN = GUICtrlCreatePic("Data\s2u-topscreen.bmp", 0, 0, $SW, 50)
    GUICtrlSetState($TOPBACK, $GUI_HIDE)
    For $X = $TIME1 To $TIMEF4
        GUICtrlDelete($X)
        Sleep(1)
    Next
    Do
        ControlMove($MGUI, "", $TOPCTRLSCREEN, 0, $TOPPOS)
        ControlMove($MGUI, "", $BOTTOMBACK, 0, $BOTTOMPOS)
        ControlMove($MGUI, "", $BARLEFT, 20, $BARPOS)
        ControlMove($MGUI, "", $BARMIDDLE, 41, $BARPOS)
        ControlMove($MGUI, "", $BARRIGHT, $SW - 41, $BARPOS)
        ControlMove($MGUI, "", $BARLABEL, 20, $BARPOS)
        ControlMove($MGUI, "", $SLIDER, 22.5, $SLIDERPOS)
        $TOPPOS = $TOPPOS - 2
        $BOTTOMPOS = $BOTTOMPOS + 10
        $BARPOS = $BARPOS + 10
        $SLIDERPOS = $SLIDERPOS + 10
    Until BitAND($TOPPOS <= -50, $BOTTOMPOS >= $SH)
    FileDelete("Data\s2u-back.bmp")
    Exit
EndFunc   ;==>_Exit

$wSlide("HH", "", $SW - 82.5, $SH - 147.5)

???

Share this post


Link to post
Share on other sites

$wSlide("HH", "", $SW - 82.5, $SH - 147.5)

???

I think you have to replace this with this:
WinMove($wSlide,"HH", "", $SW - 82.5, $SH - 147.5)

It works now, but on my computer it's a bit weird fade out, I think I'm gonna do the same animation in the begin of the program..


PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites

I think you have to replace this with this:

WinMove($wSlide,"HH", "", $SW - 82.5, $SH - 147.5)

It works now, but on my computer it's a bit weird fade out, I think I'm gonna do the same animation in the begin of the program..

Yes,it's a bit weird fade out.

Share this post


Link to post
Share on other sites

$wSlide("HH", "", $SW - 82.5, $SH - 147.5)

???

Yes, it should be

WinMove("HH", "", $SW - 82.5, $SH - 147.5)

or

WinMove($wSlide, "", $SW - 82.5, $SH - 147.5)

but not

WinMove($wSlide,"HH", "", $SW - 82.5, $SH - 147.5)as AppTux says above.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Yes, it should be

WinMove("HH", "", $SW - 82.5, $SH - 147.5)

or

WinMove($wSlide, "", $SW - 82.5, $SH - 147.5)

but not

WinMove($wSlide,"HH", "", $SW - 82.5, $SH - 147.5)as AppTux says above.

Thank you, It worked, but it was a bit illogical :)

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites

Change this line and the slider won't hide again.

$wSlide = GUICreate("HH", 60, 45, 22.5, $SH - 147.5, $WS_POPUP, Default, $MGUI)

True, that's also possible, but I had this solution:

$wSlide = GUICreate("HH", 60, 45, 22.5, $SH - 147.5, $WS_POPUP, $WS_EX_TOPMOST)

And I set in the While:

WinSetOnTop($wSlide, "", 1)

Mine also works, but I can't say anything else than that yours is better :)


PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites

AppTux, I like your scripting work, but I've noticed that the black bar at the top and below are not always on top. I've searched to solve it, but I couldn't find a solution. It would be nice if you could solve it.

WimpieWindhoos


Yes! Windows is shutting down!

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

AppTux, I like your scripting work, but I've noticed that the black bar at the top and below are not always on top. I've searched to solve it, but I couldn't find a solution. It would be nice if you could solve it.

WimpieWindhoos

And can you explain exactly what you mean with "are not always on top"???

You mean that if you press Start+Tab and switch to another program???

I think that's also possible with

WinSetOnTop("WindowSlideToUnlock]", "", 1);the main window
WinSetOnTop("HH", "", 1);slider window
WinSetOnTop("Overlay", "", 1);Overlay window

This works not total properly because if you switch to another window, you see the other window, but if you click or whatever, the PS2U window come again in the front of your screen.

Edit: I found that the overlay and slider window are still in front of the other windows... I'm gonna try to get it working.

Edit2: Just add this line in the While:

If Not WinActive ($MGUI,"") Then WinActivate ($MGUI,"")
Edited by AppTux

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites

Does anyone have more suggestions??? It's quiet for a while.....


PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites

Hi AppTux,

did you try running it on a multi-monitor environment?

It only covers the first monitor. =)

Regards,

Hannes

:)


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

No, I haven't because I dont' have multiple monitors :)

But I think it would be possible...


PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites

omg that program is really cool! good job i like it.

Share this post


Link to post
Share on other sites

omg that program is really cool! good job i like it.

Thank you!! :)

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.

Share this post


Link to post
Share on other sites

Hey Tux, I really liked what you came up with. I was playing around with it and added a little feature for my own use.

Instead of just allowing anyone to slide to unlock, I added a password system to it.

Now, the screen size is my own, so I dunno if it will adjust to everyone elses (For the button placements) but if not, meh :P

Anyway, when you run the script it will ask for a password, and then open the GUI like yours. But instead of a time stamp (I didn't need it :D) I added the numbers 1-9 that you can scroll over to "press" to input the password. Before you enter the correct password you cannot slide the bar. If you enter an incorrect password it will flash a image stating it was invalid. If you enter the correct, it states you are granted to enter and allows you to slide to unlock.

Let me know what you think :)

#include <File.au3>
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <GUIEdit.au3>
#include <File.au3>
#include <StaticConstants.au3>
#include <String.au3>
#include <ScreenCapture.au3>
#include <SQLite.au3>

Global $DigitCount, $FirstDigitEntered, $Number[10], $FirstDigitTried, $SecondDigitTried, $ThirdDigitTried, $FourthDigitTried, $FourthDigitCorrect, $FirstDigitCorrect, $SecondDigitCorrect, $ThirdDigitCorrect, $DisplayGrantedEntry

$Password = Inputbox("Password", "Please input a four digit password..", "", "*")

$PasswordDigit1 = StringMid($Password, 1,1)
$PasswordDigit2 = StringMid($Password, 2,1)
$PasswordDigit3 = StringMid($Password, 3,1)
$PasswordDigit4 = StringMid($Password, 4,1)

$SW = @DesktopWidth
$SH = @DesktopHeight

_ScreenCapture_Capture("Data\s2u-back.bmp", 0, 0, $SW, $SH, False)
$MGUI = GUICreate("WindowSlideToUnlock", $SW, $SH, 0, 0, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000, $MGUI)
$BACK = GUICtrlCreatePic("Data\s2u-back.bmp", 0, 0, $SW, $SH)
$TOPBACK = GUICtrlCreatePic("Data\s2u-b-b.bmp", 0, 0, $SW, 50)
$BOTTOMBACK = GUICtrlCreatePic("Data\s2u-u-b.bmp", 0, $SH - 250, $SW, 250)
$BARLEFT = GUICtrlCreatePic("Data\s2u-b-l.bmp", 20, $SH - 151, 21, 52)
$BARMIDDLE = GUICtrlCreatePic("Data\s2u-b-m.bmp", 41, $SH - 151, $SW - 61, 52)
$BARRIGHT = GUICtrlCreatePic("Data\s2u-b-r.bmp", $SW - 41, $SH - 151, 21, 52)
$BARLABEL = GUICtrlCreateLabel("Slide to unlock", 20, $SH - 151, $SW - 42, 52, $SS_NOTIFY & $SS_CENTER)
$SLIDER = GUICtrlCreatePic("Data\s2u-b-u.bmp", 22.5, $SH - 147.5, 60, 45)
$Number[1] = GuiCtrlCreateLabel("1", $SW-1080, $SH- 895,21,32, $SS_NOTIFY)
$Number[2] = GuiCtrlCreateLabel("2", $SW-1000,$SH- 895,21,32, $SS_NOTIFY)
$Number[3] = GuiCtrlCreateLabel("3", $SW-920,$SH- 895,21,32, $SS_NOTIFY)
$Number[4] = GuiCtrlCreateLabel("4", $SW-840, $SH- 895,21,32, $SS_NOTIFY)
$Number[5] = GuiCtrlCreateLabel("5", $SW-760,$SH- 895,21,32, $SS_NOTIFY)
$Number[6] = GuiCtrlCreateLabel("6", $SW-680,$SH- 895,21,32, $SS_NOTIFY)
$Number[7] = GuiCtrlCreateLabel("7", $SW-600, $SH- 895,21,32, $SS_NOTIFY)
$Number[8] = GuiCtrlCreateLabel("8", $SW-520,$SH- 895,21,32, $SS_NOTIFY)
$Number[9] = GuiCtrlCreateLabel("9", $SW-440,$SH- 895,21,32, $SS_NOTIFY)

WinSetTrans($MGUI, "", 0)

GUISetState()

For $TRANS = 0 To 255 Step 25
    WinSetTrans($MGUI, "", $TRANS)
    If $TRANS >= 255 Then
        ExitLoop
    EndIf
Next

WinSetTrans($MGUI, "", 255)

_SETSTATEANDFONT()

While 1
    $MINFO = GUIGetCursorInfo($MGUI)
    Switch GUIGetMsg($MGUI)
        Case $GUI_EVENT_CLOSE
            Exit
        EndSwitch
        If $FirstDigitEntered = 0 Then
        For $Count = 1 To 9 Step +1
        If $MINFO[4] = $Number[$Count] Then
                $FirstDigitTried = $Count
                $FirstDigitEntered = 1
            GUICtrlSetBkColor($Number[$Count], 0xD2D2D2)
            Sleep(600)
            GUICtrlSetBkColor($Number[$Count], $GUI_BKCOLOR_TRANSPARENT)
            $MINFO = GUIGetCursorInfo($MGUI)
        EndIf
    Next
EndIf
                If $FirstDigitEntered = 1 Then
        For $Count = 1 To 9 Step +1
        If $MINFO[4] = $Number[$Count] Then
                $SecondDigitTried = $Count
                $FirstDigitEntered = 2
            GUICtrlSetBkColor($Number[$Count], 0xD2D2D2)
            Sleep(600)
            GUICtrlSetBkColor($Number[$Count], $GUI_BKCOLOR_TRANSPARENT)
            $MINFO = GUIGetCursorInfo($MGUI)
        EndIf
    Next
EndIf
                If $FirstDigitEntered = 2 Then
        For $Count = 1 To 9 Step +1
        If $MINFO[4] = $Number[$Count] Then
                $ThirdDigitTried = $Count
                $FirstDigitEntered = 3
            GUICtrlSetBkColor($Number[$Count], 0xD2D2D2)
            Sleep(600)
            GUICtrlSetBkColor($Number[$Count], $GUI_BKCOLOR_TRANSPARENT)
            $MINFO = GUIGetCursorInfo($MGUI)
        EndIf
    Next
EndIf
                If $FirstDigitEntered = 3 Then
        For $Count = 1 To 9 Step +1
        If $MINFO[4] = $Number[$Count] Then
                $FourthDigitTried = $Count
                $FirstDigitEntered = 4
            GUICtrlSetBkColor($Number[$Count], 0xD2D2D2)
            Sleep(600)
            GUICtrlSetBkColor($Number[$Count], $GUI_BKCOLOR_TRANSPARENT)
            $MINFO = GUIGetCursorInfo($MGUI)
        EndIf
    Next
EndIf

If $FirstDigitEntered = 4 Then
    If $FirstDigitCorrect = 0 Then
    If $FirstDigitTried = $PasswordDigit1 Then
        $FirstDigitCorrect = 1
    Else
        $FirstDigitCorrect = 0
        SplashImageOn("", "Data\Invalid.bmp", $SW, $SH-300,0,50,1)
        Sleep(800)
        SplashOff()
        SplashImageOn("", "Data\Invalid.bmp", $SW, $SH-300,0,50,1)
        Sleep(800)
        SplashOff()
        $FirstDigitEntered = 0
        $FirstDigitTried = ""
        $SecondDigitTried = ""
        $ThirdDigitTried = ""
        $FourthDigitTried = ""
    EndIf
    If $FirstDigitCorrect = 1 Then
        If $SecondDigitTried = $PasswordDigit2 Then
            $SecondDigitCorrect = 1
        Else
            $FirstDigitCorrect = 0
            $SecondDigitCorrect = 0
            SplashImageOn("", "Data\Invalid.bmp", $SW, $SH-300,0,50,1)
            Sleep(800)
            SplashOff()
            SplashImageOn("", "Data\Invalid.bmp", $SW, $SH-300,0,50,1)
            Sleep(800)
            SplashOff()
            $FirstDigitEntered = 0
            $FirstDigitTried = ""
            $SecondDigitTried = ""
            $ThirdDigitTried = ""
            $FourthDigitTried = ""
        EndIf
    EndIf
        If $SecondDigitCorrect = 1 Then
        If $ThirdDigitTried = $PasswordDigit3 Then
            $ThirdDigitCorrect = 1
        Else
            $FirstDigitCorrect = 0
            $SecondDigitCorrect = 0
            $ThirdDigitCorrect = 0
            SplashImageOn("", "Data\Invalid.bmp", $SW, $SH-300,0,50,1)
            Sleep(800)
            SplashOff()
            SplashImageOn("", "Data\Invalid.bmp", $SW, $SH-300,0,50,1)
            Sleep(800)
            SplashOff()
            $FirstDigitEntered = 0
            $FirstDigitTried = ""
            $SecondDigitTried = ""
            $ThirdDigitTried = ""
            $FourthDigitTried = ""
        EndIf
    EndIf
            If $ThirdDigitCorrect = 1 Then
        If $FourthDigitTried = $PasswordDigit4 Then
            $FourthDigitCorrect = 1
        Else
            $FirstDigitCorrect = 0
            $SecondDigitCorrect = 0
            $ThirdDigitCorrect = 0
            $FourthDigitCorrect = 0
            SplashImageOn("", "Data\Invalid.bmp", $SW, $SH-300,0,50,1)
            Sleep(800)
            SplashOff()
            SplashImageOn("", "Data\Invalid.bmp", $SW, $SH-300,0,50,1)
            Sleep(800)
            SplashOff()
            $FirstDigitEntered = 0
            $FirstDigitTried = ""
            $SecondDigitTried = ""
            $ThirdDigitTried = ""
            $FourthDigitTried = ""
        EndIf
    EndIf
EndIf
EndIf
If $FourthDigitCorrect = 1 Then
    If $DisplayGrantedEntry = 0 Then
            SplashImageOn("", "Data\Valid.bmp", $SW, $SH-300,0,50,1)
            Sleep(800)
            SplashOff()
            SplashImageOn("", "Data\Valid.bmp", $SW, $SH-300,0,50,1)
            Sleep(800)
            SplashOff()
            $DisplayGrantedEntry = 1
            EndIf
    If $MINFO[4] = $SLIDER Then
        $POS = 1
        $MINFO = GUIGetCursorInfo($MGUI)
        While $MINFO[4] = $SLIDER
            $MINFO = GUIGetCursorInfo($MGUI)
            If $MINFO[2] = 1 Then
                $MINFO = GUIGetCursorInfo($MGUI)
                $MPOS = MouseGetPos()
                $CONTROLPOS = $MPOS[0] - 22.5
                While $MINFO[2] = 1
                    $MINFO = GUIGetCursorInfo($MGUI)
                    $POS = MouseGetPos()
                    $POS = $POS[0] - $CONTROLPOS
                    If $POS <= 20 Then
                        ControlMove("WindowSlideToUnlock", "", $SLIDER, 22.5, $SH - 147.5)
                    ElseIf $POS >= $SW - 82.5 Then
                        ControlMove("WindowSlideToUnlock", "", $SLIDER, $SW - 82.5, $SH - 147.5)
                        _SLIDEFULL()
                    Else
                        ControlMove("WindowSlideToUnlock", "", $SLIDER, $POS, $SH - 147.5)
                    EndIf
                    Sleep(5)
                WEnd
                Do
                    ControlMove("WindowSlideToUnlock", "", $SLIDER, $POS, $SH - 147.5)
                    $POS = $POS - 25
                    Sleep(5)
                Until $POS <= 22.5
                ControlMove("WindowSlideToUnlock", "", $SLIDER, 22.5, $SH - 147.5)
            EndIf
            Sleep(10)
        WEnd
    EndIf
EndIf
    Sleep(1)
WEnd

Func _SETSTATEANDFONT()
    GUICtrlSetColor($BARLABEL, 0x373737)
    GUICtrlSetBkColor($BARLABEL, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont($BARLABEL, 21, 400, "", "Lucida Sans")
    For $Count2 = 1 To 9 Step +1
        GUICtrlSetBkColor($Number[$Count2], 0x373737)
        GUICtrlSetBkColor($Number[$Count2], $GUI_BKCOLOR_TRANSPARENT)
        GUICtrlSetFont($Number[$Count2], 21, 400, "", "Lucida Sans")
    Next
    $Count = 0
    For $X = $BACK To $BARRIGHT
        GUICtrlSetState($X, $GUI_DISABLE)
    Next
EndFunc   ;==>_SETSTATEANDFONT


Func _SLIDEFULL()
    $BARPOS = $SH - 151
    $SLIDERPOS = $SH - 147.5
    $BOTTOMPOS = $SH - 250
    $TOPPOS = 0
    $TOPSCREEN = _ScreenCapture_Capture("Data\s2u-topscreen.bmp", 0, 0, $SW, 50, False)
    $TOPCTRLSCREEN = GUICtrlCreatePic("Data\s2u-topscreen.bmp", 0, 0, $SW, 50)
    GUICtrlSetState($TOPBACK, $GUI_HIDE)
    Do
        ControlMove($MGUI, "", $TOPCTRLSCREEN, 0, $TOPPOS)
        ControlMove($MGUI, "", $BOTTOMBACK, 0, $BOTTOMPOS)
        ControlMove($MGUI, "", $BARLEFT, 20, $BARPOS)
        ControlMove($MGUI, "", $BARMIDDLE, 41, $BARPOS)
        ControlMove($MGUI, "", $BARRIGHT, $SW - 41, $BARPOS)
        ControlMove($MGUI, "", $BARLABEL, 20, $BARPOS)
        ControlMove($MGUI, "", $SLIDER, 22.5, $SLIDERPOS)
        $TOPPOS = $TOPPOS - 2
        $BOTTOMPOS = $BOTTOMPOS + 10
        $BARPOS = $BARPOS + 10
        $SLIDERPOS = $SLIDERPOS + 10
    Until BitAND($TOPPOS <= -50, $BOTTOMPOS >= $SH)
    FileDelete("Data\s2u-back.bmp")
    Exit
EndFunc   ;==>_Exit

Invalid IMG:

http://i56.tinypic.com/2rdjgvk.jpg

Valid IMG:

http://i55.tinypic.com/k0w0j.jpg

Just put them as Invalid.bmp and Valid.bmp in the data folder that is already with the PS2U :)


MCR.jpg?t=1286371579

Most recent sig. I made

Quick Launcher W/ Profiles Topic Movie Database Topic & Website | LiveStreamer Pro Website | YouTube Stand-Alone Playlist Manager: Topic | Weather Desktop Widget: Topic | Flash Memory Game: Topic | Volume Control With Mouse / iTunes Hotkeys: Topic | Weather program: Topic | Paws & Tales radio drama podcast mini-player: Topic | Quick Math Calculations: Topic

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0