Ok, can I just call connect event, or do I need two veriables? Sean. -----Original Message----- From: Aaron Smith [mailto:[EMAIL PROTECTED] Sent: 03 August 2008 17:53 To: [email protected] Subject: Re: Client.OnShutdown query
You don't want to disconnect your FocusWindowEvent event during your FocusWindowEvent routine, otherwise, you'll get one focus notification, and then no more until your script runs again. Aaron Sean Farrow wrote: > Hi: > After writing a shutdown event, window-eyes now sems to freeze after > closing the specific application. > Please could someone help, code below. > Any ideas apreciated. > Sean. > 'code vbscript. > '--- > 'Scripts for codegear rad studio 2007. > 'Copyright (c) 2008, Sean Farrow. > 'All rights reserved. > 'Connect the event wich finds the TAppBuilder class. This is needed, to > allow us to detect the correct 'focus once inside the application. > dim FocusWindowEvent > Dim ShutdownEvent > > FocusWindowEvent = ConnectEvent(DesktopWindow, "OnChildFocus", > "ProcessOnChildFocus") > ShutdownEvent = ConnectEvent(ClientInformation, "OnShutDown", > "ProcessOnShutdown") > > Sub ProcessOnChildFocus(windowObject) > ' React to OnChildFocus events > if strComp(windowObject.ClassName, "TAppBuilder", vbBinaryCompare) =0 > then > 'Change the window we are detecting child focus events for, to the > TAppBuilderClass. > Disconnect(FocusWindowEvent) > FocusWindowEvent = ConnectEvent(windowObject, > "OnChildFocus", "ProcessOnChildFocus") > end if > End Sub > > Sub ProcessOnShutdown() > ' Disconnect events and any other cleanup procedures required. > Disconnect(ShutdownEvent) > Disconnect(FocusEvent) > End Sub > > -----Original Message----- > From: Tom Kingston [mailto:[EMAIL PROTECTED] > Sent: 03 August 2008 14:32 > To: [email protected] > Subject: Re: Client.OnShutdown query > > Virtually every script should be using this event to disconnect events > if > nothing else. The sub can be anything you want because it's named in the > > ConnectEvent call as follows. Let's say you have two events connected. > Here's how it would look. > > Dim winEvents(1) ' Note: arrays are 0 indexed. > winEvents(0) = ConnectEvent(ClientInformation.Overlap, "OnChildFocus", > "ProcessOnChildFocus") > winEvents(1) = ConnectEvent(ClientInformation, "OnShutDown", > "ProcessOnShutdown") > > Sub ProcessOnChildFocus(windowObject) > ' React to OnChildFocus events > End Sub > > Sub ProcessOnShutdown() > ' Disconnect events and any other cleanup procedures required. > End Sub > > Hth, > Tom > > ----- Original Message ----- > From: "Sean Farrow" <[EMAIL PROTECTED]> > > > Hi: > Are there currently any scripts using the onshutdown event. I carn't > seem to get it to work. > Should I be using > Sub ClientInformation.OnShutdown() > Or sub OnShutdown() > Do I need to connect to this event as per normal? > Cheers > Sean. > > -----Original Message----- > From: Aaron Smith [mailto:[EMAIL PROTECTED] > Sent: 02 August 2008 15:14 > To: [email protected] > Subject: Re: Client.OnShutdown query > > Sean, > > OnShutdown is only fired when the application that launched the script > is closing, or the case of a global script, when Window-Eyes is closing. > > Aaron > > Sean Farrow wrote: >> Hi: >> When is the client.OnShutdown event called, I understand this is > called >> when an application closes, is it also called when an application > loses >> focus? >> Cheers >> Sean. >> Sean >> >> >> __________ Information from ESET NOD32 Antivirus, version of virus >> signature database 3318 (20080801) __________ >> >> The message was checked by ESET NOD32 Antivirus. >> >> http://www.eset.com >> >> > -- To insure that you receive proper support, please include all past correspondence (where applicable), and any relevant information pertinent to your situation when submitting a problem report to the GW Micro Technical Support Team. Aaron Smith GW Micro Phone: 260/489-3671 Fax: 260/489-2608 WWW: http://www.gwmicro.com FTP: ftp://ftp.gwmicro.com Technical Support & Web Development __________ Information from ESET NOD32 Antivirus, version of virus signature database 3322 (20080803) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __________ Information from ESET NOD32 Antivirus, version of virus signature database 3322 (20080803) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com
