| View previous topic :: View next topic |
| Author |
Message |
valenock
Joined: 14 Sep 2004 Posts: 17
|
Posted: Mon May 09, 2005 2:04 pm Post subject: Event Log: Read / Write |
|
|
As more and more users nowadays move from win9x platform to win2K/XP, it really makes sense to implement basic EventLog functions for Autohotkey.
To begin with, there could be only too of them EventLogRead / EventLogWrite(Log, Application, Id, Text) - both for the local machine only.
As far as I know these are not difficult to implement (at least in .NET it takes 10 lines).
Waiting for your comments !
BTW, is there a console application for EventLog read/write functions ? |
|
| Back to top |
|
 |
Gehn
Joined: 02 Mar 2005 Posts: 13 Location: Terminus of Tears
|
Posted: Mon May 09, 2005 8:27 pm Post subject: |
|
|
C:\windows\system32\eventquery.vbs
True to its name, it allows you to query the event log. Use the "-?" parameter for instructions on how to use it. Using no parameters will make it print out everything in your event logs. _________________ The dumber people think you are, the more surprised they're going to be when you kill them. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Mon May 09, 2005 9:58 pm Post subject: |
|
|
| Also, when DllCall is available, perhaps it could be used to access the Event Log. I'm unfamiliar with the Event Log API interface, so DllCall might not be enough to work with it until support for structures is added. |
|
| Back to top |
|
 |
valenock
Joined: 14 Sep 2004 Posts: 17
|
Posted: Mon May 09, 2005 10:47 pm Post subject: |
|
|
What I am looking for is the ability to make blocking ReadEvent calls, or set a CreateEvent() trap, so script will be notified when an Event is written to EventLog.
The reaction for the event could be different - from simple TrayTip to email sending or windows shutdown.
Running any external executable as VB or Perl every N seconds will produce a noticeable overhead on the computer.
Perhaps, I, finally, managed to face the limit of Autohotkey and should write this on some C++ ?  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Tue May 10, 2005 9:13 pm Post subject: |
|
|
| valenock wrote: | Perhaps, I, finally, managed to face the limit of Autohotkey and should write this on some C++ ?  | If the API functions can be called without needing any structures, you might be able to do it with DllCall when that feature comes out (I'm testing it now, so hopefully in a day or two).
But that is probably unlikely in this case, so you might want to write an external program that presses a hotkey (via keybd_event()) to notify the script whenever the program receives an event notification. |
|
| Back to top |
|
 |
Gehn
Joined: 02 Mar 2005 Posts: 13 Location: Terminus of Tears
|
Posted: Tue May 10, 2005 9:14 pm Post subject: |
|
|
Traps like the one you mentioned would be a great feature for AutoHotkey in general. There's several things I've thought about doing but I am a little leery of doing via polling. _________________ The dumber people think you are, the more surprised they're going to be when you kill them. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Tue May 10, 2005 9:16 pm Post subject: |
|
|
| The ability for a script to receive and respond to messages is tentatively planned. When coupled with DllCall, I don't know if this would support all or even any of these notification mechanisms. But hopefully progress will be made in these areas over time. |
|
| Back to top |
|
 |
valenock
Joined: 14 Sep 2004 Posts: 17
|
Posted: Tue May 10, 2005 9:26 pm Post subject: |
|
|
| Chris wrote: | | But that is probably unlikely in this case, so you might want to write an external program that presses a hotkey (via keybd_event()) to notify the script whenever the program receives an event notification. |
Yes, I am aware of this posibility - but it is kind of sad that I have to write it in C, not ahk
I will evaluate the solution with DllCall whenever it is avaiable
Thanks for answering, Chris and Gehn ! |
|
| Back to top |
|
 |
|