Jump to content

inputbox capturing all user inputs


Recommended Posts

I want an inputbox, that cannot be alt-tabbed out of the way, that captures all the keystrokes, so they won't get to the below program, and also don't let the mouse to click outside it. It should be always on top and always active.

The part with mouseclicks was solved by making an invisible label on the entire screen, but someone could alt-tab, and then use Windows only with the keyboard. I don't want this.

In the simpliest form posible, the purpose of this is to have an inputbox, and if you don't know the password, you can't do anything to the computer.

Do you know how to do this?

Thank you!

Kiti :)

Edited by Kiti
Link to comment
Share on other sites

I want an inputbox, that cannot be alt-tabbed out of the way, that captures all the keystrokes, so they won't get to the below program, and also don't let the mouse to click outside it. It should be always on top and always active.

The part with mouseclicks was solved by making an invisible label on the entire screen, but someone could alt-tab, and then use Windows only with the keyboard. I don't want this.

In the simpliest form posible, the purpose of this is to have an inputbox, and if you don't know the password, you can't do anything to the computer.

Do you know how to do this?

Thank you!

Kiti :P

Turn on password protection for the screen saver and activate it.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

mmm try this:

#include <GUIConstants.au3>
#Include <Misc.au3>


$pass = GUICreate("Pass", 232, 166, 193, 125)
$lab = GUICtrlCreateLabel("Password", 16, 8, 194, 33, BitOR($SS_CENTER,$SS_CENTERIMAGE))
$input = GUICtrlCreateInput("", 16, 72, 193, 21)
$but = GUICtrlCreateButton("Ok", 56, 112, 121, 33, 0)
GUISetState(@SW_SHOW)

WinSetOnTop("Pass", "", 1)

While 1
    _MouseTrap(195,155,427,319)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $but
            $inputpass=GUICtrlRead($input)
            If $inputpass = "YOURPASS" Then ExitLoop
    EndSwitch
    
WEnd

;your code

use mousetrap and winsetontop

Edited by IvanDream
Link to comment
Share on other sites

Thank you, but I was curious if this can be done in AutoIt. :P

Run("rundll32.exe user32.dll,LockWorkStation")

...yes, it can.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

try to use WinActive and WinActivate in the loop like this

#include <GUIConstants.au3>
#Include <Misc.au3>


$pass = GUICreate("Pass", 232, 166, 193, 125)
$lab = GUICtrlCreateLabel("Password", 16, 8, 194, 33, BitOR($SS_CENTER,$SS_CENTERIMAGE))
$input = GUICtrlCreateInput("", 16, 72, 193, 21)
$but = GUICtrlCreateButton("Ok", 56, 112, 121, 33, 0)
GUISetState(@SW_SHOW)

WinSetOnTop("Pass", "", 1)

While 1
    _MouseTrap(195,155,427,319)
    If WinActive("Pass") = 0 Then WinActivate("Pass")
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $but
            $inputpass=GUICtrlRead($input)
            If $inputpass = "YOURPASS" Then ExitLoop
    EndSwitch
    
WEnd
Link to comment
Share on other sites

try to add wingetpos and winmove too. seems perfect, try it!

#include <GUIConstants.au3>
#Include <Misc.au3>

$pass = GUICreate("Pass", 232, 166, 193, 125)
$lab = GUICtrlCreateLabel("Password", 16, 8, 194, 33, BitOR($SS_CENTER,$SS_CENTERIMAGE))
$input = GUICtrlCreateInput("", 16, 72, 193, 21)
$but = GUICtrlCreateButton("Ok", 56, 112, 121, 33, 0)
GUISetState(@SW_SHOW)

WinSetOnTop("Pass", "", 1)

While 1
    _MouseTrap(195,155,427,319)
    If WinActive("Pass") = 0 Then WinActivate("Pass")
    $pos = WinGetPos("Pass")
    if $pos[0] <> 193 Or $pos[1] <> 125 Then WinMove("Pass","",193,125)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $but
            $inputpass=GUICtrlRead($input)
            If $inputpass = "YOURPASS" Then ExitLoop
    EndSwitch
    
WEnd
Edited by IvanDream
Link to comment
Share on other sites

try to add wingetpos and winmove too. seems perfect, try it!

#include <GUIConstants.au3>
#Include <Misc.au3>

$pass = GUICreate("Pass", 232, 166, 193, 125)
$lab = GUICtrlCreateLabel("Password", 16, 8, 194, 33, BitOR($SS_CENTER,$SS_CENTERIMAGE))
$input = GUICtrlCreateInput("", 16, 72, 193, 21)
$but = GUICtrlCreateButton("Ok", 56, 112, 121, 33, 0)
GUISetState(@SW_SHOW)

WinSetOnTop("Pass", "", 1)

While 1
    _MouseTrap(195,155,427,319)
    If WinActive("Pass") = 0 Then WinActivate("Pass")
    $pos = WinGetPos("Pass")
    if $pos[0] <> 193 Or $pos[1] <> 125 Then WinMove("Pass","",193,125)
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $but
            $inputpass=GUICtrlRead($input)
            If $inputpass = "YOURPASS" Then ExitLoop
    EndSwitch
    
WEnd

Yaay!! It works perfect! Thank you alot!

Link to comment
Share on other sites

np :P

with alt+space u can move the window but if u use the wingetpos and the winmove it's perfect :P

I've made some modifications, with a while loop getting the mouse position, and again after 100 ms. And if they were different, the loop exit and fall into the second loop, which shows the GUI. So the gui don't pop up unless you move your mouse. But I accidentaly deleted the second Exitloop so I felt in my own trap :D . I had to unplug the computer. My luck was that the script was saved before each run. :)

Thank you for your help again! :mad:

Link to comment
Share on other sites

... I accidentaly deleted the second Exitloop so I felt in my own trap :P . I had to unplug the computer.

Wouldn't have happened if you just used:
Run("rundll32.exe user32.dll,LockWorkStation")

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...