win_notify v0.0.4 WinNotify.CSharp

Create and manage Windows notification icons.

Summary

Functions

Releases all resources used by the notify icon

Current number of existing icons

Creates a notification icon associated with reference

List of all existing icons hash codes

Sets the current icon. Requires an image with extension .ico

Sets the ToolTip text displayed when the mouse pointer rests on a notification area icon

Displays a balloon tip with the specified title, text, and icon in the taskbar for the specified time period. Notify icon must be visible and be set with an icon image

Toggles a value indicating whether the icon is visible in the notification area of the taskbar

Destroys all existing icons

Types

exception :: {:exception, String.t}

Functions

destroy_icon(icon)

Specs

destroy_icon(reference) :: :ok

Releases all resources used by the notify icon.

Example

iex> ref = make_ref
iex> WinNotify.init_notify_icon ref
iex> WinNotify.destroy_icon ref
iex> :ok
icon_count()

Specs

icon_count :: integer

Current number of existing icons

Example

iex> WinNotify.init_notify_icon
iex> WinNotify.init_notify_icon
iex> WinNotify.icon_count
iex> 2
init_notify_icon(reference)

Specs

init_notify_icon(reference) :: :ok

Creates a notification icon associated with reference.

Example

iex> ref = make_ref
iex> WinNotify.init_notify_icon ref
iex> :ok
list_icons()

Specs

list_icons :: [reference]

List of all existing icons hash codes

Example

iex> ref1 = make_ref
iex> ref2 = make_ref
iex> WinNotify.init_notify_icon ref1
iex> WinNotify.init_notify_icon ref2
iex> [i1, i2] = WinNotify.list_icons
set_icon(icon, path)

Specs

set_icon(reference, String.t) :: :ok

Sets the current icon. Requires an image with extension .ico.

Example

iex> ref = make_ref
iex> WinNotify.init_notify_icon ref
iex> WinNotify.set_icon ref, "path/to/icon.ico"
iex> :ok
set_text(icon, text)

Specs

set_text(reference, String.t) :: :ok

Sets the ToolTip text displayed when the mouse pointer rests on a notification area icon.

Example

iex> ref = make_ref
iex> WinNotify.init_notify_icon ref
iex> WinNotify.set_text ref, "text"
iex> :ok
show_balloon_tip(icon, title, text, type)

Specs

show_balloon_tip(reference, String.t, String.t, atom) :: :ok

Displays a balloon tip with the specified title, text, and icon in the taskbar for the specified time period. Notify icon must be visible and be set with an icon image.

Icon types

  • :error
  • :info
  • :none
  • :warning

Example

iex> ref = make_ref
iex> WinNotify.init_notify_icon ref
iex> WinNotify.set_icon ref, ~S"path/to/icon.ico"
iex> WinNotify.show_balloon_tip ref, "title", "text", :info
iex> :ok
toggle_visibility(icon)

Specs

toggle_visibility(reference) :: :ok

Toggles a value indicating whether the icon is visible in the notification area of the taskbar.

Example

iex> ref = make_ref
iex> WinNotify.init_notify_icon ref
iex> WinNotify.toggle_visibility ref
iex> :ok
wipe_all_icons()

Specs

wipe_all_icons :: :ok

Destroys all existing icons.

Example

iex> WinNotify.init_notify_icon make_ref
iex> WinNotify.init_notify_icon make_ref
iex> WinNotify.wipe_all_icons
iex> :ok