/////////////////////////////////////////////////////////////////////////////////////////
#include <acknex.h>
#include <default.c>
#include <windows.h>
//
//
//
//
/////////////////////////////////////////////////////////////////////////////////////////
//
#define NIM_ADD 0x00
#define NIM_MODIFY 0x01
#define NIM_DELETE 0x02
#define NIF_MESSAGE 0x001
#define NIF_ICON 0x002
#define NIF_TIP 0x004
#define NIF_INFO 0x010
#define IMAGE_ICON 0x0001
#define LR_LOADFROMFILE 0x00010
#define LR_VGACOLOR 0x00080
#define LR_SHARED 0x08000
//
//
//
typedef struct NOTIFYICONDATA
{
DWORD cbSize;
HWND hWnd;
UINT uID;
UINT uFlags;
UINT uCallbackMessage;
long hIcon;
char szTip[128];
DWORD dwState;
DWORD dwStateMask;
char szInfo[256];
DWORD uTimeout;
char szInfoTitle[64];
DWORD dwInfoFlags;
}NOTIFYICONDATA;
//
//
NOTIFYICONDATA _nid;
//
BOOL __stdcall Shell_NotifyIcon(DWORD dwMessage, NOTIFYICONDATA* lpData);
//
//
/////////////////////////////////////////////////////////////////////////////////////////
//
BOOL ShowBalloonTip(char* msg, char* title, char* icon, var Timeout)
{
_nid.cbSize =sizeof(NOTIFYICONDATA);
_nid.hWnd = hWnd;
_nid.uID = -hWnd;
_nid.uFlags = NIF_ICON | NIF_TIP | NIF_INFO;
_nid.uTimeout = 10000;
_nid.dwInfoFlags = NIF_MESSAGE;
strcpy(_nid.szInfo, ""); if(msg) strcpy(_nid.szInfo, msg);
strcpy(_nid.szInfoTitle, ""); if(title) strcpy(_nid.szInfoTitle, title);
strcpy(_nid.szTip, ""); if(icon) strcpy(_nid.szTip, icon);
_nid.hIcon = (long)LoadImage(GetModuleHandle(NULL),"26.ico", IMAGE_ICON, 16, 16,
LR_SHARED | LR_LOADFROMFILE | LR_VGACOLOR);
Shell_NotifyIcon(NIM_ADD, &_nid);
wait(-Timeout);
Shell_NotifyIcon(NIM_DELETE, &_nid);
}
//
//
/////////////////////////////////////////////////////////////////////////////////////////
//
//
//
/* USAGE - ALL text parameters are optional, use NULL for unused text's
...
ShowBalloonTip("Message text", "Title text", "icon text", 5); //delay is in seconds
//or
ShowBalloonTip(Message_string.chars, Title_string.chars, IconText_string.chars, 5);
...
*/