AutoHotkey Community

It is currently May 26th, 2012, 12:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Event Log: Read / Write
PostPosted: May 9th, 2005, 3:04 pm 
Offline

Joined: September 14th, 2004, 11:03 pm
Posts: 21
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 ?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2005, 9:27 pm 
Offline

Joined: March 3rd, 2005, 12:26 am
Posts: 13
Location: Terminus of Tears
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2005, 10:58 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 9th, 2005, 11:47 pm 
Offline

Joined: September 14th, 2004, 11:03 pm
Posts: 21
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++ ? :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2005, 10:13 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
valenock wrote:
Perhaps, I, finally, managed to face the limit of Autohotkey and should write this on some C++ ? :D
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2005, 10:14 pm 
Offline

Joined: March 3rd, 2005, 12:26 am
Posts: 13
Location: Terminus of Tears
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2005, 10:16 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 10th, 2005, 10:26 pm 
Offline

Joined: September 14th, 2004, 11:03 pm
Posts: 21
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 :D

I will evaluate the solution with DllCall whenever it is avaiable

Thanks for answering, Chris and Gehn !


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: jyloup, Yahoo [Bot] and 4 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