tray latest
Cross-platform, super tiny C99 implementation of a system tray icon with a popup menu and notifications.
tray.h File Reference

Definition of the tray API. More...

#include <Windows.h>
Include dependency graph for tray.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tray
 Tray icon. More...
 
struct  tray_menu
 Tray menu item. More...
 

Functions

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.
 

Detailed Description

Definition of the tray API.

Function Documentation

◆ tray_get_hwnd()

HWND tray_get_hwnd ( void )

Get the tray window handle.

Returns
The window handle.

◆ tray_init()

int tray_init ( struct tray * tray)

Create tray icon.

Parameters
trayThe tray to initialize.
Returns
0 on success, -1 on error.

◆ tray_loop()

int tray_loop ( int blocking)

Run one iteration of the UI loop.

Parameters
blockingWhether to block the call or not.
Returns
0 on success, -1 if tray_exit() was called.

◆ tray_update()

void tray_update ( struct tray * tray)

Update the tray icon and menu.

Parameters
trayThe tray to update.