6 posts in this topic
This topic is now closed to further replies.
while working on another project I was in need of desktop notifications. I wanted an own implementation and from time to time the code grew and I thought about sharing it with the world. I know that there is a similar UDF out there but when my project got bigger an UDF was the best choice for me. As you can see the UDF's differ in usage and style of notifications.
So, what do we have?
The UDF offers the usage of permanent desktop notifications for your own script in a very easy way. Notifications are starting in the bottom right corner of your main screen and will be shown on top until there is no more space. Further notifications will be shown if previous ones are closed. The notifications have a nice minimalistic design in two colors. By default they match the look of the dark taskbar in Windows 10, but colors and other things can be set differently if wished (see example scripts). The UDF works for GUIOnEventMode activated and deactivated and detects it automatically.
Each notification has its GUI, a title, the message, a seperating line, date label, time label and a closing button (and if activated, a border around the notification). The color of the title, message, seperating line, date, time and closing button (+ border if activated) have all the text color.
Right now notifications have a fixed size. I thought about variable sizes but did not add it because I didn't need it so far.
Some people may notice the shorter seperating line when border is activated, thats just because of better looks
Notifications will be colored as the following:
Windows 10: they match the design of the taskbar Windows 8/8.1: On most designs: they match the border color of active windows, else they are black with transparency (see screenshot) Windows 7 and earlier: black with transparency (sry aero)
How do I use notifications in my script?
include UDF call _Notifications_Startup() (after you determined if you want to use GUIOnEventMode or not) If GUIOneventMode deactivated: call _Notifications_CheckGUIMsg($__GUIMsg) in your main loop create a notification using _Notifications_Create($__title, $__message)
Between step 2 and 3 you can set various options:
_Notifications_SetAnimationTime _Notifications_SetBorder _Notifications_SetButtonText _Notifications_SetBkColor _Notifications_SetColor _Notifications_SetDateFormat _Notifications_SetSound _Notifications_SetTextAlign _Notifications_SetTimeFormat _Notifications_SetTransparency
You can also set own functions to be called when notifications are clicked (see advanced example).
You can find more information in the UDF.
There also are two example scripts to show the usage for GUIOnEventMode activated and deactivated. Another advanced example shows the usage of the Set-Functions.
Yup, have fun.
Notifications.au3 ( v1.2)
Notifications GUIMsg Example.au3
Notifications OnEvent Example.au3
Notifications Advanced Example.au3
I've recently updated to Windows 10 and saw that new and beatiful info center for notifications.
A lot of applications already support it, so I'm curious if I can get my autoit script to use the windows native notification system.
Any help is much appreciated
Thanks in advance
Creeper is a 'heads up display' notification window that appears at the bottom of the screen and moves to the top and fades away.
It is a window that is semi-transparent, and transparent to clicks.
Creeper is not a UDF, but rather a stand-alone script to be invoked from the command line or another script.
Many notifications can be launched this way in succession without complications.
Pressing right ctrl and left ctrl will remove all notifications from the screen at any time.
Creeper uses an embedded IE object and is thereby capable of rich html-based notifications.
The html framework provided consists of:
An optional title An optional image An optional html body (any html you want) The content parameters are:
title html image Full styling for the framework involves parameters:
bordercolor, borderwidth, borderstyle, padding, width backgroundcolor, color font, fontsize titlefont, titlecolor imagewidth, imageheight Special parameters are:
fmtini fmtname outhtml autodel
Specifying Command Line Parameters
Specification is made easy by using named parameters, so the command line parameters can look like:
"name1[,name2]..." "<value for name1>" "<value for name2>"
Parameters for a simple message could look like:
"title,html" "My Title" "Some html with <b>markup</b>"
To make this even easier, a formatting ini file can be referenced, and parameter values picked up from there:
"title,html,fmtini,fmtname" "My Title" "Some html with <b>markup</b>" "C:some.ini" "sectionname"
Even more, a registry key can be used for all parameters:
Templating is also supported, so if you have a html value that looks like:
Hi, my name is %(name)
...then your command line can look like:
"fmtini,fmtname,title,$name" "C:some.ini" "sectionname" "My Title" "George"
where the html value in this case is picked up from the ini
The other great feature of Creeper is that it can log its messages to a specific point in any html file:
"html,outhtml" "Log this html" "C:some.html"
Examine the code comment header. The file will run without parameters using internal defaults. Let me know if you have any issues or have any solutions to the issues given.
Its v0.1, so read the issues in the comments. The functions do not have thorough documentation headers since this is not a UDF, but the functions are simple and have single line explanations. Also, not a lot of error handling going on at this stage
Edit - Update to v0.1.1