Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Blockinput not working in Windows 7


  • Please log in to reply
12 replies to this topic
padarrju
  • Members
  • 44 posts
  • Last active: May 25 2013 11:01 AM
  • Joined: 23 Jan 2006
Dear All,

I have developed one AHK script in which I have used blockinput,on command / function to restrict the mouse & keyboard movement from user side. But the script & compiled script are not working. I tried to change compatible mode as Windows 7 using properties by double clicking on .exe file but it couldn't give me success. I am working on Windows 7 plateform.

The code is as follows :

#Persistent
blockinput, on
sleep, 1000
run, C:\Program Files\Microsoft Office Communicator\communicator.exe
ESC::exitapp

Could you please help me how to resolve the problem ?

Thanks well in advance.

Regards,

Raju Padaria
Sr. Manager (IT)
FAG Bearings India Limited,
Maneja
Vadodara - 390 013

0x150--ISO
  • Members
  • 657 posts
  • Last active: Apr 07 2012 09:06 PM
  • Joined: 01 Jan 2011
at 1st glance it looks like your script needs a return before the hotkey
#Persistent
blockinput, on
sleep, 1000
run, C:\Program Files\Microsoft Office Communicator\communicator.exe
[color=#BF0000]Return[/color]
ESC::exitapp
Hope this helps.

padarrju
  • Members
  • 44 posts
  • Last active: May 25 2013 11:01 AM
  • Joined: 23 Jan 2006
Dear Sir,

I tried with the suggestion given by you but still the program is not working.

Thanks for your support.

Regards,

Raju Padaria
India

at 1st glance it looks like your script needs a return before the hotkey

#Persistent
blockinput, on
sleep, 1000
run, C:\Program Files\Microsoft Office Communicator\communicator.exe
[color=#BF0000]Return[/color]
ESC::exitapp
Hope this helps.



0x150--ISO
  • Members
  • 657 posts
  • Last active: Apr 07 2012 09:06 PM
  • Joined: 01 Jan 2011
When you say it doesnt work,
does your mouse and keyboard not freeze up?
does Communicator not run?
or the script never runs?

Please explain what aspect of your script that doesnt work.

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
have you tried running the script as Admin? See A_IsAdmin in the help

padarrju
  • Members
  • 44 posts
  • Last active: May 25 2013 11:01 AM
  • Joined: 23 Jan 2006

When you say it doesnt work,
does your mouse and keyboard not freeze up?
does Communicator not run?
or the script never runs?

Please explain what aspect of your script that doesnt work.


Dear Sir,

Yes, my mouse and keyboard do not freeze up.
During the execution, I am still able to move my mouse pointer & it allows me to use key-board also which I don't want.

Kindly help me.

Regards,

Raju Padaria
India

0x150--ISO
  • Members
  • 657 posts
  • Last active: Apr 07 2012 09:06 PM
  • Joined: 01 Jan 2011
As engunneer suggests please make sure you are running script with Admin credentials.
Msgbox % ( A_IsAdmin ? "Admin" : "Guest" ) " Level Access."
What message do you get?
Also what Operating System are you using?
What version of AHK are you using?
Do any scripts run? Or just this one fails?

padarrju
  • Members
  • 44 posts
  • Last active: May 25 2013 11:01 AM
  • Joined: 23 Jan 2006

As engunneer suggests please make sure you are running script with Admin credentials.

Msgbox % ( A_IsAdmin ? "Admin" : "Guest" ) " Level Access."
What message do you get?
Also what Operating System are you using?
What version of AHK are you using?
Do any scripts run? Or just this one fails?



Dear Sir,

I am using Autohotkey version : 1.0.48.05
O/S : Windows 7
Other scripts are running without any trouble. Only this one is not running.

Regards,

Raju Padaria
India

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
Typically, the first question is the most important one. The remaining questions are thing we know we may ask based on the answer of the first question.

Please help us help you by answering the first question. please put this code at the top of your script to help us determine what is going on
Msgbox % ( A_IsAdmin ? "Admin" : "Guest" ) " Level Access."


padarrju
  • Members
  • 44 posts
  • Last active: May 25 2013 11:01 AM
  • Joined: 23 Jan 2006

Typically, the first question is the most important one. The remaining questions are thing we know we may ask based on the answer of the first question.

Please help us help you by answering the first question. please put this code at the top of your script to help us determine what is going on

Msgbox % ( A_IsAdmin ? "Admin" : "Guest" ) " Level Access."


Dear sir,
I am getting the below message :
Guest Level Access.

Regards,

Raju

engunneer
  • Moderators
  • 9162 posts
  • Last active: Sep 12 2014 10:36 PM
  • Joined: 30 Aug 2005
So now my original reply comes into effect. When we ask you a question, it means we think the answer will help you solve your problem.

have you tried running the script as Admin? See A_IsAdmin in the help


Put this at the top of your script and see if blockinput gets any better. This is copy/paste directly from the help file in the section for A_IsAdmin.
(<!-- m -->http://www.autohotke...ariables.htm#os<!-- m -->)
if not A_IsAdmin
{
   DllCall("shell32\ShellExecuteA", uint, 0, str, "RunAs", str, A_AhkPath
      , str, """" . A_ScriptFullPath . """", str, A_WorkingDir, int, 1)
   ExitApp
}


padarrju
  • Members
  • 44 posts
  • Last active: May 25 2013 11:01 AM
  • Joined: 23 Jan 2006
Dear Guru,

Now I am able to run the script as an admin.

Thanks,

Regards,

Raju Padaria
FAG, India

yrtsh
  • Members
  • 13 posts
  • Last active: Apr 10 2018 09:21 AM
  • Joined: 11 Feb 2015

please add to the blockinput page that it only work as admin