![]() |
tray latest
Cross-platform, super tiny C99 implementation of a system tray icon with a popup menu and notifications.
|
System tray implementation for Windows. More...
Classes | |
| struct | icon_info |
| Icon information. More... | |
Macros | |
| #define | ID_TRAY_FIRST 1000 |
| First tray identifier. | |
| #define | WC_TRAY_CLASS_NAME "TRAY" |
| Tray window class name. | |
| #define | WM_TRAY_CALLBACK_MESSAGE (WM_USER + 1) |
| Tray callback message. | |
Enumerations | |
| enum | IconType { REGULAR = 1 , LARGE , NOTIFICATION } |
| Icon type. More... | |
Functions | |
| struct icon_info | _create_icon_info (const char *path) |
| Create icon information. | |
| void | _destroy_icon_cache () |
| Destroy icon cache. | |
| HICON | _fetch_cached_icon (struct icon_info *icon_record, enum IconType icon_type) |
| Fetch cached icon. | |
| HICON | _fetch_icon (const char *path, enum IconType icon_type) |
| Fetch icon. | |
| void | _init_icon_cache (const char **paths, int count) |
| Initialize icon cache. | |
| void | tray_exit (void) |
| Terminate UI loop. | |
| HWND | tray_get_hwnd (void) |
| Get the tray window handle. | |
| int | tray_init (struct tray *tray) |
| Create tray icon. | |
| int | tray_loop (int blocking) |
| Run one iteration of the UI loop. | |
| void | tray_show_menu (void) |
| Force show the tray menu (for testing purposes). | |
| void | tray_update (struct tray *tray) |
| Update the tray icon and menu. | |
System tray implementation for Windows.
| enum IconType |
| struct icon_info _create_icon_info | ( | const char * | path | ) |
Create icon information.
| path | Path to the icon. |
Fetch cached icon.
| icon_record | Icon record. |
| icon_type | Icon type. |
| HICON _fetch_icon | ( | const char * | path, |
| enum IconType | icon_type ) |
Fetch icon.
| path | Path to the icon. |
| icon_type | Icon type. |
| void _init_icon_cache | ( | const char ** | paths, |
| int | count ) |
Initialize icon cache.
| paths | Paths to the icons. |
| count | Number of paths. |
| HWND tray_get_hwnd | ( | void | ) |
Get the tray window handle.
| int tray_init | ( | struct tray * | tray | ) |
Create tray icon.
| tray | The tray to initialize. |
| int tray_loop | ( | int | blocking | ) |
Run one iteration of the UI loop.
| blocking | Whether to block the call or not. |
| void tray_update | ( | struct tray * | tray | ) |
Update the tray icon and menu.
| tray | The tray to update. |