Sign in to follow this  
Followers 0
ryandao

Lock out user input

7 posts in this topic

Hi everyone,

I'm trying to push out a exe utiltiy and some users are pressing the Cancel button so the utility doesn't get install. The utility doesn't have a quiet install option. Is there a way to lock out user input or lockout the Cancel option?

Thank you

RD

Share this post


Link to post
Share on other sites



Hi everyone,

I'm trying to push out a exe utiltiy and some users are pressing the Cancel button so the utility doesn't get install.  The utility doesn't have a quiet install option.  Is there a way to lock out user input or lockout the Cancel option?

Thank you

RD

<{POST_SNAPBACK}>

BlockInput

--------------------------------------------------------------------------------

Disable/enable the mouse and keyboard.

BlockInput ( flag )

Parameters

flag 1 = Disable user input

0 = Enable user input

Return Value

None.

Remarks

If BlockInput is enabled, the Alt keypress cannot be sent!

The table below shows how BlockInput behavior depends on Windows' version; however, pressing Ctrl+Alt+Del on any platform will re-enable input due to a Windows API feature.

Operating System "BlockInput" Results

Windows 95 No effect.

Windows 98/Me User input is blocked but AutoIt is also unable to simulate input.

Windows NT 4 (Without ServicePack 6) No effect.

Windows NT 4 (With ServicePack 6) User input is blocked and AutoIt can simulate most input.

Windows 2000 User input is blocked and AutoIt can simulate most input.

Windows XP User input is blocked and AutoIt can simulate most input. See exceptions below.

If you are using Windows XP then you should be aware that a hotfix released inbetween SP1 and SP2 limited Blockinput so that the ALT key could NOT be sent. This is fixed in XP SP2.

Note that functions such as WinMove() will still work on Windows 98/Me when BlockInput is enabled.


Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

Check the ControlDisable function.

Share this post


Link to post
Share on other sites

I was able to block user iput...Thx BD

Slim - I would prefer to block user from only the Cancel button if posible. What does ControlDisable control? I wasn't able to get the ControlDisable to do anything.

Thx

Share this post


Link to post
Share on other sites

ControlDisable disables any control (like a button, text area, combobox/dropdown box, etc).

Use AutoIt3 Spy (found in your start menu), to check what the name is of the button.

With that information you can disable the Cancel button.

Share this post


Link to post
Share on other sites

Also, a loooooooooooooooooooooooooooooooong time ago (Late 1900's) I wrote a script where I made a window maximized but transparent without the control buttons. I stayed on top of eveything until the script was done running. They could try to click on stuff but it was like I placed a big piece of glass on it :lmao:

Share this post


Link to post
Share on other sites

Example of ControlDisable with Notepad:

$title = "Untitled - Notepad"
Run("notepad")
WinWait($title)
ControlSend($title, "", "Edit1", "some sample text")
WinMenuSelectItem($title, "", "&File", "E&xit") ;close notepad

; Wait for the "Do you want to save changes?" dialog
; Let's disable the Cancel button on that dialog :)
$title = "Notepad"
WinWait($title)
ControlDisable($title, "", "Cancel")

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

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