Trying to create a small monitor application that displays current internet usage as percentage in system tray in C using win32 API.
Also wanting to use colour backgrou
The system tray only accepts icons to show, not text.
To get a text shown there, you have to first create a memory bitmap, draw your text on it, then convert that memory bitmap to a memory icon and have the system tray show that icon.
Example code below:
CDC dcMem;
dcMem.CreateCompatibleDC(NULL);
CBitmap* pOld = dcMem.SelectObject( &m_bmpIcon );
CBrush back( RGB(0,0,0) );
dcMem.FillRect( CRect(0,0,16,16), &back );
CBrush brush( COLORDOWN );
dcMem.FillRect( rcRecv, &brush );
dcMem.SelectObject( pOld );
HICON hIcon = CreateIconIndirect( &m_TaskBarIconInfo );