Notify()

gwarble's Tools
Download
Forum Thread

Create multiple simultaneous auto-positioning tray area notifications very simply. Use Notify() in any number of scripts and they will stack accordingly. Notifications are customizable in color and style, duration, and can call subroutines when clicked or timeout. Display information quickly and easily for debugging or end-user interfaces.

Notify([Title,Message,Duration,Options])

Standard Library [stdlib] compliant, drop in your Lib folder and call Notify() to use.

Parameters

Title

Title text of notification.

Title and Message can contain `n to show multiple lines.
Title is bold by default, change this with Options.

Message

Message text of notification.

Duration

Number of seconds to show notification. [Default: 30 seconds]
Use a 0 duration for duration until clicked (infinite)
Use a negative duration to force an ExitApp after duration or click.
Use "-0" (in quotes) to force an ExitApp after click, but last indefinitely

Options

Options string to set the style of this and following notifications.
See below for details. Example:

"TS=16 TM=8 TF=Times New Roman GC_=Blue SI_=1000"

Option String Details


GC     FFFFAA       ;      Gui Color	
GR     9            ;      Gui Radius	
GT     Off          ;      Gui Transparency	
TS     12           ;    Title Font Size	
TW     625          ;    Title Font Weight	
TC     Black        ;    Title Font Color	
TF     Arial        ;    Title Font Face	
MS     12           ;  Message Font Size	
MW     550          ;  Message Font Weight	
MC     Black        ;  Message Font Color	
MF     Arial        ;  Message Font Face	
BC     000000       ;   Border Colors	
BW     2            ;   Border Width/Thickness	
BR     13           ;   Border Radius	
BT     105          ;   Border Transpacency	
BF     300          ;   Border Flash Speed	
BK     Silver       ;   Border Flash Color	
SI     0            ;    Speed In      (AnimateWindow)	
SC     0            ;    Speed Clicked (AnimateWindow)	
ST     0            ;    Speed TimeOut (AnimateWindow)	
IW     32           ;    Image Width	
IH     32           ;    Image Height	
IN     0            ;    Image Icon Number (from shell32.dll if no Image used)	
PG		    ; Progress Bar initialize/set max value	
PC     Default      ; Progress bar color	
PB     Default      ; Progress bar background color	
PW     200          ; Progress bar width	
PH     Default      ; Progress bar height	
XF     Arial Black  ; X-Button Font Face	
XC     Default      ; X-Button Color	
XS     12           ; X-Button Font Size	
XW     800          ; X-Button Font Weight	

AC, AT, AX          ; Actions Clicked/Timeout/X-Close respectively (label to run)	
GF     50           ; First gui number to use	
GL     74           ; Last number to define range	

Wait                ; set to Notify ID (returned value) to wait for	
Update              ; set to Notify ID (returned value) to update Title, Message, Image, or Progress of	
Return              ; special call to obtain static values	

Returns

Gui Number used ***
0 if failed (too many open)

Related

ToasterPops, ToolTip(), TrayTip, MsgBox

Example

Notify() ;= all parameters optional
Notify("Title","Message")
Title = This is the title
Notify(Title)

Notify("T","M",5)  ;= lasts 5 seconds
Notify("T","M",-5) ;= ExitApp when clicked or 5 seconds
NotifyID := Notify("T","M",0)  ;= lasts until clicked
  Sleep, 5000
Notify("","",0,"Wait",NotifyID)   ;= kills an open notification, or
Notify("","",-5,"Wait",NotifyID)   ;= waits 5 seconds before killing
Notify("","",5,"Wait",NotifyID)   ;= waits 5 seconds or until clicked/timeouts before proceding without killing


Homepage  |  Command List