Hi Martin,

I am no great scripter, but this line looks wrong:-

win.Overlap.Settings.General.Hotkeys = FALSE Sleep 5000

What it should be is:-

win.Overlap.Settings.General.Hotkeys = FALSE 
Sleep 5000

In other words, the Sleep statement should be on a new line I believe.

Of course, I may be way off beam, as I am a beginner to both VB and
scripting.

All the best

Steve



-----Original Message-----
From: martin webster [mailto:[EMAIL PROTECTED] 
Sent: Saturday 30 August 2008 12:43
To: [email protected]
Subject: can somebody help me with this?

Hi all,
I got an example from Doug which disables most hotkeys globally, but I can't
seem to get this routine to work in VB script.  I get the error, "cannot
call a sub with parentheses when calling a sub".  I've looked at some other
examples I have and this looks correct to me.  This script should disable
most hotkeys for 5 seconds, and then disconnect this event, in other words,
I want this action only to accur for 5 seconds, and then I want the hotkeys
to be enabled again.
Begin VB script.

ConnectEvent(DesktopWindow, "OnChildActivate", "MyOnChildActivate")
Sub MyOnChildActivate(win)
    win.Overlap.Settings.General.Hotkeys = FALSE
Sleep 5000
Disconnect(Desktop.Window)
Playsound, "c:\whistle wake.wav"
End Sub 

Warm regards.
Martin Webster.




      


Reply via email to