win_notify v0.0.1 WinNotify

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 and returns a hash code to identify it by

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(integer) :: :ok | {:error, String.t}

Releases all resources used by the notify icon.

Example

iex> icon = WinNotify.init_notify_icon
iex> WinNotify.destroy_icon icon
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()

Specs

init_notify_icon :: integer

Creates a notification icon and returns a hash code to identify it by.

Example

iex> WinNotify.init_notify_icon
iex> 12345
list_icons()

Specs

list_icons :: [integer]

List of all existing icons hash codes

Example

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

Specs

set_icon(integer, String.t) ::
  :ok |
  {:error, String.t} |
  exception

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

Example

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

Specs

set_text(integer, String.t) ::
  :ok |
  {:error, String.t}

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

Example

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

Specs

show_balloon_tip(integer, String.t, String.t, atom) ::
  :ok |
  {:error, String.t}

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> icon = WinNotify.init_notify_icon
iex> WinNotify.set_icon icon, ~S"path/to/icon.ico"
iex> WinNotify.show_balloon_tip icon, "title", "text", :info
iex> :ok
toggle_visibility(icon)

Specs

toggle_visibility(integer) :: :ok | {:error, String.t}

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

Example

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

Specs

wipe_all_icons :: :ok

Destroys all existing icons.

Example

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