flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > Alarm - System tray clock / reminder [DONE] Goto page 1, 2 Next |
Author |
|
ATV 11 Apr 2006, 07:24
I have been looking alarm clock/reminder that stays on system tray,
but not found any good/small/easy to use. Only thing to do was write it. Notes: - Alarm.ini is loaded when program is started and saved after every change In [Alarms] section line format is: Alarm001=hh:mm dd.mm.yyyy msg Sound001=c:\fasmw\alarm\alarm.mp3 char between time and date is repeat interval (space = none, d = daily, w = weekly, m = monthly, y = yearly, D = weekdays, E = weekends, t = 2 weeks, f = 4 weeks, s = 6 weeks, e = 8 weeks) - on exit show warning if there is alarms left - maximum 100 different alarms in chronological order - maximum length of user message is 79 character - repeat alarm sound in 1 min intervals in next 10 minutes - you can modify your countrys bank holidays in setup window (format: dd.mm dd.mm dd.mm) used only by weekdays/weekends repeat intervals - to load at startup, use checkbox in setup window. remember uncheck it before you delete program edit1: ordered alarm list,ini handling rewritten,choice sound,date picker edit2: LogFile,added daily/weekly/monthly/yearly/weekdays/weekend repeat edit3: added 2/4/6/8 weeks repeat,edit_dialog,next alarm in tray tooltip edit4: MP3 support,holidays list,setup dialog,window sizing edit5: save window pos/size,some tooltips,listbox colors edit6: added handler for TaskbarCreated,sound test edit7: write2log,MB_TOPMOST,choose colors,day of week,tabstops in ownerdrawn listbox edit8: FindWindow,show same day alarms in edit dialog,confirm when delete alarm
Last edited by ATV on 27 Aug 2007, 07:14; edited 10 times in total |
||||||||||||||||||||
11 Apr 2006, 07:24 |
|
UCM 11 Apr 2006, 21:14
here's some code to add/remove the program from the local machine startup: (i tested the add section, dunno about the remove part)
Code: ;put this in data section SubKey db 'Alarm',0 RegRunKey db 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run',0 CurrentProgram db '"' ProgramName rb 514 ;put this in code section add_startup: invoke GetModuleFileName,NULL,ProgramName,512 ;get the file name test eax,eax jz .die;can't get name??? mov word [ProgramName+eax],'"' ;make sure it is enclosed in quotes in case of spaces lea esi,[eax+3] ;total length sub esp,4 invoke RegOpenKeyEx,HKEY_LOCAL_MACHINE,RegRunKey,0,KEY_WRITE,esp ;change HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER if necessary pop ebx test eax,eax jnz .die ;error invoke RegSetValueEx,ebx,SubKey,0,REG_SZ,CurrentProgram,esi test eax,eax jnz .die invoke RegCloseKey,ebx ret .die: ;error handling here. ret remove_startup: sub esp,4 invoke RegOpenKeyEx,HKEY_LOCAL_MACHINE,RegRunKey,0,KEY_WRITE,esp ;change HKEY_LOCAL_MACHINE to HKEY_CURRENT_USER if necessary pop ebx test eax,eax jnz .die ;error invoke RegDeleteValue,ebx,SubKey test eax,eax jnz .die invoke RegCloseKey,ebx ret .die: ;error handling here. ret _________________ This calls for... Ultra CRUNCHY Man! Ta da!! *crunch* |
|||
11 Apr 2006, 21:14 |
|
ATV 12 Apr 2006, 12:53
UCM, thank you, thats just right code and remove works too.
Only problem was that it dont set work dir for data file, like shortcut in startup menu. Just need copy of program path, not big deal. Maybe i need think little more, before messing with win register. If user just delete program, then run key is still there, and thats not good. vbVeryBeginner, and maybe total silence too. PS. I'll be back in next week, because here library are close whole Easter. |
|||
12 Apr 2006, 12:53 |
|
ATV 18 Apr 2006, 07:19
Above attachment updated
New features in v0.02 - ordered alarm list - ini handling rewritten - choice sound (NoSound/Wav/Beep/Siren) - date picker |
|||
18 Apr 2006, 07:19 |
|
ATV 31 Jul 2006, 09:04
Above attachment updated
New features in v0.03 - save to LogFile - counter for repeat sound - added daily/weekly/monthly/yearly/weekdays/weekend repeat |
|||
31 Jul 2006, 09:04 |
|
ATV 08 Sep 2006, 11:57
Above attachment updated
New features in v0.04 - added settopindex - added 2/4/6/8 weeks repeat - added edit_dialog - next alarm in tray tooltip |
|||
08 Sep 2006, 11:57 |
|
ATV 03 Oct 2006, 12:24
I have been testing MP3 support, what do you think is it good or bad thing.
This is only test version. edit: Attachment removed Last edited by ATV on 06 Oct 2006, 07:07; edited 1 time in total |
|||
03 Oct 2006, 12:24 |
|
vid 03 Oct 2006, 12:30
definitively good
|
|||
03 Oct 2006, 12:30 |
|
dead_body 04 Oct 2006, 08:17
it will be good to add each mp3 melody to each remind.(not only one mp3 to all datas and times).
|
|||
04 Oct 2006, 08:17 |
|
ATV 04 Oct 2006, 10:10
dead_body, it will need to rewrite ini file handling. Something like:
alarm01=09:00y24.12.2006 Merry Christmas! sound01=c:\mp3\Bing Crosby - White Christmas.mp3 but i will think about it. |
|||
04 Oct 2006, 10:10 |
|
ATV 06 Oct 2006, 07:09
Every alarm with own sound effect or mp3 file.
Note: ini format has changed, it is not compatible with old version. If you want use old alarm.ini close old alarm program Open alarm.ini with notepad and replace "Alarm=" with "Alarm001=" next alarm with "Alarm002=" , "Alarm003=" , ... Sound will use default settings This is still test version |
|||
06 Oct 2006, 07:09 |
|
ATV 13 Oct 2006, 09:09
Little bug that change mp3 filename when edit alarm, fixed.
+more speed when save alarm.ini WritePrivateProfileString was slow when there is many alarms in list, now using WriteFile edit: Attachment removed, now MP3 support is in first post Last edited by ATV on 16 Jan 2007, 08:06; edited 1 time in total |
|||
13 Oct 2006, 09:09 |
|
Karl20001 14 Jan 2007, 16:16
Hi, i really like your tool, but it would be nice to have it go to tray when starting. I tried to add
invoke ShowWindow,[hWnd],SW_HIDE mov [showflag],0 in .initdlg but the window is still staying. |
|||
14 Jan 2007, 16:16 |
|
ATV 15 Jan 2007, 13:04
Hi Karl20001, That's good idea I like it. I try to find way to do it.
Currently I have been testing bank holidays list and window sizing, they are working, but need little cleaning. I also like it to check if program is already running, It works if I use CreateWindowEx and FindWindow, but I can't find old program if it's using dialogbox. So I have still lots of learning ahead. |
|||
15 Jan 2007, 13:04 |
|
ATV 16 Jan 2007, 08:07
Hide window don't work in WM_INITDIALOG because it's called before window is shown.
Quick and dirty way to hide window at starting was setting extra timer that will be removed in first call. Maybe there is better way to do it, I just didn't find it. Above attachment updated New features in v0.08 - added holidays list - setup dialog - window sizing |
|||
16 Jan 2007, 08:07 |
|
dead_body 16 Jan 2007, 13:50
splendid
|
|||
16 Jan 2007, 13:50 |
|
ATV 05 Feb 2007, 08:32
Above attachment updated
New features in v0.09 - save window pos/size into ini file - some tooltips added - listbox background colors, green for today and yellow for tomorrow |
|||
05 Feb 2007, 08:32 |
|
OzzY 19 Apr 2007, 21:41
I've got exactly this thing as homework! But I have to do it in C! And yours in pure ASM looks better than mine trying to do GUI with GUI libraries. /me gets pwned. I hope I'll be able to read your code and learn things like minimize to tray, etc. And then translate to C. And I will really do it in pure C and Win32 API. |
|||
19 Apr 2007, 21:41 |
|
pierre 20 Apr 2007, 12:14
For a traybar app, you should also handle the TaskbarCreated event.
Otherwise your app won't be seen again if explorer.exe restarts. Try it for yourself, launch your app and kill "explorer.exe" in the taskmanager. Alarm.exe will still be in memory but won't be accessible anymore. Here under you'll find a slightly modified version of the tray.asm example. --- tray_orig.asm +++ tray.asm @@ -21,6 +21,7 @@ section '.data' data readable writeable szClass db "WNDCLASS", 0 + szTaskBarCreated db "TaskbarCreated", 0 szTitle db "SysTray Example", 0 szShowHide db "&Show/Hide", 0 szExit db "&Exit", 0 @@ -28,6 +29,7 @@ hInstance dd ? hTrayMenu dd ? hMainWnd dd ? + wm_taskbarcreated dd ? msg MSG wc WNDCLASSEX node NOTIFYICONDATA @@ -37,6 +39,9 @@ ; code section section '.code' code readable executable start: + invoke RegisterWindowMessageA, szTaskBarCreated + mov [wm_taskbarcreated], eax + invoke GetModuleHandle,0 mov [hInstance],eax @@ -91,6 +96,8 @@ je .wmcreate cmp eax,WM_DESTROY je .wmdestroy + cmp eax,[wm_taskbarcreated] + je .wm_taskbarcreated .defwndproc: invoke DefWindowProc, [hWnd],[uMsg],[wparam],[lparam] jmp .finish @@ -162,6 +169,11 @@ invoke PostMessage, [hWnd],WM_NULL,0,0 jmp .finish + .wm_taskbarcreated: + ; When Explorer crashes and restarts. + invoke Shell_NotifyIcon, NIM_ADD, node ; show icon to system tray + jmp .finish + .wmdestroy: invoke Shell_NotifyIcon, NIM_DELETE,node invoke DestroyMenu, [hTrayMenu]
|
|||||||||||
20 Apr 2007, 12:14 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.