jvanegmond Posted October 19, 2007 Share Posted October 19, 2007 (edited) TrayAlarmDescription:TrayAlarm is a a lightweight alarm clock application that minimizes to the tray. It's very simple to set up.When the alarm goes off the following things happen:A sound is played repeatedly to warn you, even when you are not at your PC.A big window pops up to warm you the alarm is going off, even when your sound is off.You have to click a button to stop the alarm.In the new version, the main window minimizes to the tray.. in stead of sticking to your desktop.2011 edit: Since this is quite old, but I still use it frequently. Some public service announcements: - The original source has been lost. The icons used, the compiled executable: All gone. - I reposted the original source in the original post. The source was also a few posts down. - I have fixed the original source code posted to work with AutoIt v3.3.6.1 - Project name changed from Mini Alarm to TrayAlarm because it fits better.expandcollapse popup#NoTrayIcon #include <Constants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "Minimize") Dim $AlarmON = 0, $FirstTime = 1 $GUI = GUICreate("Mini Alarm", 169, 63, @DesktopWidth * (2 / 3), 0) GUISetFont(10, 400, 0, "Verdana") $Label1 = GUICtrlCreateLabel("Alarm Time:", 5, 8, 82, 20) $Input1 = GUICtrlCreateInput(@HOUR & ":" & @MIN, 90, 5, 76, 24, BitOR($ES_CENTER, $ES_AUTOHSCROLL)) $Button1 = GUICtrlCreateButton("Set Alarm Time", 5, 35, 160, 25) GUISetState(@SW_SHOW, $GUI) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE GUISetState(@SW_HIDE, $GUI) TraySetState(1) If $FirstTime Then TrayTip("Mini Alarm", "Mini Alarm is minimized to the tray. Click on the tray icon here to restore the window.", 10) $FirstTime = 0 EndIf Case $Button1 If Not $AlarmON Then GUICtrlSetState($Input1, $GUI_DISABLE) GUICtrlSetData($Button1, "Cancel Alarm") $AlarmON = 1 Else GUICtrlSetState($Input1, $GUI_ENABLE) GUICtrlSetData($Button1, "Set Alarm Time") $AlarmON = 0 EndIf EndSwitch If $AlarmON And (GUICtrlRead($Input1) = @HOUR & ":" & @MIN) Then GUICtrlSetState($Button1, $GUI_DISABLE) Alarm() GUICtrlSetState($Input1, $GUI_ENABLE) GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetData($Button1, "Set Alarm Time") $AlarmON = 0 Minimize() EndIf WEnd Func Alarm() $GUIAlarm = GUICreate("Alarm!!", 294, 77, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI,$WS_MINIMIZEBOX)) $Button2 = GUICtrlCreateButton("Stop Alarm", 5, 40, 285, 30, 0) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") GUICtrlCreateLabel("ALARM!! ALARM!! ALARM!!", 5, 5, 285, 29) GUICtrlSetFont(-1, 16, 400, 0, "Verdana") GUISetState(@SW_SHOW, $GUIAlarm) WinSetOnTop($GUIAlarm, "", 1) $Beep = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button2 ExitLoop EndSwitch If TimerDiff($Beep) > 1300 Then SoundPlay(@WindowsDir & "\media\ringout.wav", 0) $Beep = TimerInit() EndIf WEnd GUIDelete($GUIAlarm) EndFunc ;==>Alarm Func Minimize() TraySetState(2) GUISetState(@SW_SHOW, $GUI) GUISetState(@SW_RESTORE, $GUI) EndFunc ;==>Minimize Edited February 18, 2011 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
Dhilip89 Posted October 19, 2007 Share Posted October 19, 2007 Nice, thanks for sharing. Btw, where do you get the skin ? [u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote] Link to comment Share on other sites More sharing options...
gseller Posted October 19, 2007 Share Posted October 19, 2007 Nice, simple and easy to use. I might suggest adding minimize to tray as an option.or a set of hot keys to hide it and bringit back when called. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 19, 2007 Author Share Posted October 19, 2007 (edited) Nice, thanks for sharing.Btw, where do you get the skin ?I have WindowBlinds 5.5 Acrylic skin. Edited February 18, 2011 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
jvanegmond Posted October 19, 2007 Author Share Posted October 19, 2007 Nice, simple and easy to use. I might suggest adding minimize to tray as an option.or a set of hot keys to hide it and bringit back when called.I'll do a minimize to tray feature.Click on the minus, and it goes to the tray, click on the tray and it is back. Thanks for the suggestion. github.com/jvanegmond Link to comment Share on other sites More sharing options...
jvanegmond Posted October 20, 2007 Author Share Posted October 20, 2007 Nice, simple and easy to use. I might suggest adding minimize to tray as an option.or a set of hot keys to hide it and bringit back when called.Done. Thanks to JamesB for the example. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Dhilip89 Posted October 20, 2007 Share Posted October 20, 2007 I downloaded WindowBlinds 5.5 for free and got the Acrylic skin.I don't use WB because my PC has only 128MB of RAM. [u]My Projects[/u]:General:WinShell (Version 1.6)YouTube Video Downloader Core (Version 2.0)Periodic Table Of Chemical Elements (Version 1.0)Web-Based:Directory Listing Script Written In AutoIt3 (Version 1.9 RC1)UDFs:UnicodeURL UDFHTML Entity UDF[u]My Website:[/u]http://dhilip89.hopto.org/[u]Closed Sources:[/u]YouTube Video Downloader (Version 1.3)[quote]If 1 + 1 = 10, then 1 + 1 ≠ 2[/quote] Link to comment Share on other sites More sharing options...
AlmarM Posted October 20, 2007 Share Posted October 20, 2007 Nice and Siple. Its very usefull for me Ty ^^ Keep going Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 20, 2007 Author Share Posted October 20, 2007 Nice and Siple.Its very usefull for me Ty ^^Keep going Thanks for the compliments.I mainly made it because I needed this for a game where you have to push a button at random times. Like 15:21, so I would just set up the alarm and done! github.com/jvanegmond Link to comment Share on other sites More sharing options...
etusa Posted October 28, 2007 Share Posted October 28, 2007 Thanks for the compliments.I mainly made it because I needed this for a game where you have to push a button at random times. Like 15:21, so I would just set up the alarm and done! The link seems to be broken to download this. Can someone post it again?Or can Manadar or someone post the source in a message?Thanks Link to comment Share on other sites More sharing options...
jvanegmond Posted October 28, 2007 Author Share Posted October 28, 2007 The link seems to be broken to download this. Can someone post it again? Or can Manadar or someone post the source in a message? ThanksI just tried the link and it worked. It has worked for others. Maybe it was down, but now it is up again. Anyway, I'll post the source here, although it becomes cooler when you use the icon. expandcollapse popup#NoTrayIcon #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_icon=icon.ico #AutoIt3Wrapper_outfile=MiniAlarm.exe #AutoIt3Wrapper_Res_Comment=Made by Manadar on 19 oktober 2007 #AutoIt3Wrapper_Res_Description=This is a mini alarm made for the AutoIt community. #AutoIt3Wrapper_Res_LegalCopyright=Free to copy, including source. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #Region AutoIt3Wrapper directives section #EndRegion #include <Constants.au3> #include <GUIConstants.au3> Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 1) TraySetOnEvent($TRAY_EVENT_PRIMARYUP, "Minimize") Dim $AlarmON = 0, $FirstTime = 1 $GUI = GUICreate("Mini Alarm", 169, 63, @DesktopWidth * (2 / 3), 0) GUISetFont(10, 400, 0, "Verdana") $Label1 = GUICtrlCreateLabel("Alarm Time:", 5, 8, 82, 20) $Input1 = GUICtrlCreateInput(@HOUR & ":" & @MIN, 90, 5, 76, 24, BitOR($ES_CENTER, $ES_AUTOHSCROLL)) $Button1 = GUICtrlCreateButton("Set Alarm Time", 5, 35, 160, 25) GUISetState(@SW_SHOW, $GUI) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_MINIMIZE GUISetState(@SW_HIDE, $GUI) TraySetState(1) If $FirstTime Then TrayTip("Mini Alarm", "Mini Alarm is minimized to the tray. Click on the tray icon here to restore the window.", 10) $FirstTime = 0 EndIf Case $Button1 If Not $AlarmON Then GUICtrlSetState($Input1, $GUI_DISABLE) GUICtrlSetData($Button1, "Cancel Alarm") $AlarmON = 1 Else GUICtrlSetState($Input1, $GUI_ENABLE) GUICtrlSetData($Button1, "Set Alarm Time") $AlarmON = 0 EndIf EndSwitch If $AlarmON And (GUICtrlRead($Input1) = @HOUR & ":" & @MIN) Then GUICtrlSetState($Button1, $GUI_DISABLE) Alarm() GUICtrlSetState($Input1, $GUI_ENABLE) GUICtrlSetState($Button1, $GUI_ENABLE) GUICtrlSetData($Button1, "Set Alarm Time") $AlarmON = 0 Minimize() EndIf WEnd Func Alarm() $GUIAlarm = GUICreate("Alarm!!", 294, 77, -1, -1, BitXOR($GUI_SS_DEFAULT_GUI,$WS_MINIMIZEBOX)) $Button2 = GUICtrlCreateButton("Stop Alarm", 5, 40, 285, 30, 0) GUICtrlSetFont(-1, 10, 400, 0, "Verdana") GUICtrlCreateLabel("ALARM!! ALARM!! ALARM!!", 5, 5, 285, 29) GUICtrlSetFont(-1, 16, 400, 0, "Verdana") GUISetState(@SW_SHOW, $GUIAlarm) WinSetOnTop($GUIAlarm, "", 1) $Beep = 0 While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Button2 ExitLoop EndSwitch If TimerDiff($Beep) > 1300 Then SoundPlay(@WindowsDir & "\media\ringout.wav", 0) $Beep = TimerInit() EndIf WEnd GUIDelete($GUIAlarm) EndFunc ;==>Alarm Func Minimize() TraySetState(2) GUISetState(@SW_SHOW, $GUI) GUISetState(@SW_RESTORE, $GUI) EndFunc ;==>Minimize github.com/jvanegmond Link to comment Share on other sites More sharing options...
Achilles Posted October 28, 2007 Share Posted October 28, 2007 Nice simple example! It should be good at helping new people to understand AutoIt better... My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
iceberg Posted October 29, 2007 Share Posted October 29, 2007 (edited) hi Manadar, nice script there. good job! however, i have modified your codes a little so that the Alarm has the "purpose" fucntion. you may be using it for your games, but i believe for most of us we need the alarm to remind us why the alarm was set in the first place. i m a little busy at work and the "purpose" function will definitely be a big help. edit : big help....not bug help. Edited October 29, 2007 by iceberg mouse not found....scroll any mouse to continue. Link to comment Share on other sites More sharing options...
jvanegmond Posted October 29, 2007 Author Share Posted October 29, 2007 hi Manadar,nice script there. good job!however, i have modified your codes a little so that the Alarm has the "purpose" fucntion.you may be using it for your games, but i believe for most of us we need the alarm to remind us why the alarm was set in the first place. i m a little busy at work and the "purpose" function will definitely be a big help.edit : big help....not bug help. Nice little feature. github.com/jvanegmond Link to comment Share on other sites More sharing options...
James Posted November 11, 2007 Share Posted November 11, 2007 Hehe, thats cool! What theme are you using? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
jvanegmond Posted November 11, 2007 Author Share Posted November 11, 2007 Hehe, thats cool! What theme are you using?Acrylic from WindowBlinds. github.com/jvanegmond Link to comment Share on other sites More sharing options...
James Posted November 11, 2007 Share Posted November 11, 2007 Damn its Window Blinds. That is so crap, it breaks my computer everytime I use it. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
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