AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Event Log: Read / Write

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
valenock



Joined: 14 Sep 2004
Posts: 17

PostPosted: Mon May 09, 2005 2:04 pm    Post subject: Event Log: Read / Write Reply with quote

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
View user's profile Send private message
Gehn



Joined: 02 Mar 2005
Posts: 13
Location: Terminus of Tears

PostPosted: Mon May 09, 2005 8:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Mon May 09, 2005 9:58 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
valenock



Joined: 14 Sep 2004
Posts: 17

PostPosted: Mon May 09, 2005 10:47 pm    Post subject: Reply with quote

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++ ? Very Happy
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue May 10, 2005 9:13 pm    Post subject: Reply with quote

valenock wrote:
Perhaps, I, finally, managed to face the limit of Autohotkey and should write this on some C++ ? Very Happy
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
View user's profile Send private message Send e-mail
Gehn



Joined: 02 Mar 2005
Posts: 13
Location: Terminus of Tears

PostPosted: Tue May 10, 2005 9:14 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Tue May 10, 2005 9:16 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
valenock



Joined: 14 Sep 2004
Posts: 17

PostPosted: Tue May 10, 2005 9:26 pm    Post subject: Reply with quote

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 Very Happy

I will evaluate the solution with DllCall whenever it is avaiable

Thanks for answering, Chris and Gehn !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group