AutoHotkey Community

It is currently May 27th, 2012, 1:30 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: November 20th, 2009, 3:04 pm 
Offline

Joined: October 30th, 2007, 1:40 pm
Posts: 20
When starting autohotkey, I get the following error message:
Warning: The keyboard and/or mouse hook could not be activated; some parts of the script will not function

I thought the problem might be with one of the memory resident programs that I have running in the background. So, I shutdown all memory resident programs, tried to start autohotkey again and still continue to get the same message. I also tried including some directives at the beginning of the script to force keyboard and mouse hooks to install, but this did not work either.

Any advice on what to do?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 8:51 pm 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
post your script


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 9:06 pm 
Offline

Joined: October 30th, 2007, 1:40 pm
Posts: 20
The problem isn't with any particular script. It is with any script that has a
hotkey. Scripts without a hotkey work fine; while those with a hotkey all of
a sudden no longer work when they did work properly previously. There
seems to be something that is preventing any script with a hotkey from
registering with the PC. I have the same scripts elsewhere without any issues.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 9:23 pm 
Offline

Joined: December 24th, 2008, 3:25 am
Posts: 1401
Location: :noitacoL
Quote:
As mentioned in the help file under #UseHook, most scripts (i.e. those that use no hotkeys or just some simple keyboard hotkeys) do not need the keyboard hook, and thus it is not activated. Similarly, the mouse hook is not active unless your script uses mouse hotkeys or includes the #InstallMouseHook directive.


If you don't need them, take them out.

Quote:
Scripts without a hotkey work fine; while those with a hotkey all of
a sudden no longer work when they did work properly previously

Take out the hook as a test, does it still wonk out?



Quote:
Any advice on what to do?

Even though you may not see an error, and things DO work on other PC's, it doesn't mean that posting your code will still not help us to help you. We can 'guess' all day at what the problem is, but "A picture is worth a thousand words". If there is 'secret' stuff, take out what you can, and rename other things.

Leef_me wrote:
post your script


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 9:49 pm 
Offline

Joined: October 30th, 2007, 1:40 pm
Posts: 20
Here's an example of a script that does not work.

Code:
#SingleInstance  force
#Hotstring SE K10

#NoEnv
#MaxMem 1
#KeyHistory 0
SetWinDelay 0
SetKeyDelay 100
SetTitleMatchMode 2


Menu, mnuMain, Add  ; Add a separator line.
Menu, mnuMain, Add, &A Menu item A, mhMain
Menu, mnuMain, Add  ;-----------------

#Right::Menu, mnuMain, Show     ,500,750   

return  ; End of script's auto-execute section.

mhMain:
 cmd := substr(A_ThisMenuItem,2,1)

 if cmd = A
 {
   send,123
 }


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2009, 10:00 pm 
Offline

Joined: October 30th, 2007, 1:40 pm
Posts: 20
Has anyone had the same problem activating scripts?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 28th, 2011, 10:29 am 
Recently I've started to get this message. Probably the machine got compromised since I haven't done any changes to it.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 7th, 2012, 6:24 am 
Offline

Joined: January 7th, 2012, 6:13 am
Posts: 1
This is due to your AV/Firewall program (eg. ZoneAlarm). You told it to block the program (likely SciTE4AutoHotKey) from injecting code into other programs, and now it has remembered that setting.

To fix this:

In ZA 10.x, go Show Monitor--> Computer -->Application Control -->Settings-->Advanced Settings--> Application Control-->View Programs--> select SciTE.exe-->Options-->Security-->then select Allow Application Interaction under Advanced Application Control.

Click OK and re-launch your program and you will be good to go.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], bobbysoon, iDrug, Ohnitiel, Yahoo [Bot] and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group