Notify()

AutoHotkey Homepage
gwarble's tools

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,Image)

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

[15] Number of seconds to show notification.
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.

*** "Wait" to wait for a notification

Image

Number of icon from shell32.dll to use for image.
- or -
Filename of image or resource to use for image.

*** Gui Number to "Wait" for

Need Options details here...

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