Sign in to follow this  
Followers 0
Tim H.

BlockInput() not working for me

5 posts in this topic

Running 3.3.0.0, even the canned BlockInput help example doesn't function correctly.

BlockInput(1)

Run("notepad")
WinWaitActive("[CLASS:Notepad]")
Send("{F5}")  ;pastes time and date

BlockInput(0)

Running the example, compiled or not, I'm able to mouse around and type in the notepad session that opens. Has anyone else seen this?

(USB keyboard & XP SP3)

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

When you run this script, can you also mouse around or type during the 60 second sleep() ?

Jos

BlockInput(1)
Run("notepad")
WinWaitActive("[CLASS:Notepad]")
Send("{F5}");pastes time and date

Sleep(60000)
BlockInput(0)
Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

The script ends before you have time to type anything. BlockInput(0) is being called right after notepad is opened and the date/time is added.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I just realized there was no sleep in the example. When I put one in, the example worked fine. Now I have to figure out why the real script isn't functioning properly. I took someone elses word for it and thought I reproduced the problem with the example script. (duh).

Thanks and sorry for the oversight.

Running 3.3.0.0, even the canned BlockInput help example doesn't function correctly.

BlockInput(1)

Run("notepad")
WinWaitActive("[CLASS:Notepad]")
Send("{F5}")  ;pastes time and date

BlockInput(0)

Running the example, compiled or not, I'm able to mouse around and type in the notepad session that opens. Has anyone else seen this?

(USB keyboard & XP SP3)

Thanks

Edited by Tim H.

Share this post


Link to post
Share on other sites

Turns out the person that was able to mouse and type during the BlockInput() was remoted into the machine that was running the script. As far as I'm concerned, in that scenario, all bets are off. BlockInput() was working fine from the local user's perspective.

Thanks again.

I just realized there was no sleep in the example. When I put one in, the example worked fine. Now I have to figure out why the real script isn't functioning properly. I took someone elses word for it and thought I reproduced the problem with the example script. (duh).

Thanks and sorry for the oversight.

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