ChrisL Posted March 30, 2011 Posted March 30, 2011 I wrote some eventlog stuff ages ago have a look at this. [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
BrewManNH Posted March 30, 2011 Posted March 30, 2011 That's quite impressive, thanks for letting me know about your dll. I'm sure it will come in handy. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
kor Posted March 30, 2011 Posted March 30, 2011 (edited) Very nice! I re-wrote some parts into functions. (I like to deal with functions) #include "CustomEventLog.au3" _Information("MyApplication", "This is a test writing to the event log") _Warning("MyApplication", "Unknown username") _Error("MyApplication", "Applying group memberships") Func _Information($eventname, $eventtext) $eventlog = _SetLog($eventname, "AutoItEventMsg.dll") If Not @error Then _RegisterEvent($eventlog, $INFORMATION, 0x7, $eventtext) EndIf EndFunc ;==> _Information Func _Warning($eventname, $eventtext) $eventlog = _SetLog($eventname, "AutoItEventMsg.dll") If Not @error Then _RegisterEvent($eventlog, $WARNING, 0x7, $eventtext) EndIf EndFunc ;==> _Information Func _Error($eventname, $eventtext) $eventlog = _SetLog($eventname, "AutoItEventMsg.dll") If Not @error Then _RegisterEvent($eventlog, $ERROR, 0x7, $eventtext) EndIf EndFunc ;==> _Information Edited March 30, 2011 by kor
ChrisL Posted March 30, 2011 Posted March 30, 2011 Very nice! I re-wrote some parts into functions. (I like to deal with functions) #include "CustomEventLog.au3" _Information("MyApplication", "This is a test writing to the event log") _Warning("MyApplication", "Unknown username") _Error("MyApplication", "Applying group memberships") Func _Information($eventname, $eventtext) $eventlog = _SetLog($eventname, "AutoItEventMsg.dll") If Not @error Then _RegisterEvent($eventlog, $INFORMATION, 0x7, $eventtext) EndIf EndFunc ;==> _Information Func _Warning($eventname, $eventtext) $eventlog = _SetLog($eventname, "AutoItEventMsg.dll") If Not @error Then _RegisterEvent($eventlog, $WARNING, 0x7, $eventtext) EndIf EndFunc ;==> _Information Func _Error($eventname, $eventtext) $eventlog = _SetLog($eventname, "AutoItEventMsg.dll") If Not @error Then _RegisterEvent($eventlog, $ERROR, 0x7, $eventtext) EndIf EndFunc ;==> _Information I'm not entirely sure that simplifies matters at all. You register your application name first so the eventlog knows to look at my DLL and then you just use either my functions of the Autoit functions to register your error log message. With your functions your setting the application up every time there is an event. Each to there own [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now