#include <windows.h>
LPCTSTR szAppName = TEXT("TrayHelper");
LPCTSTR szWndName = TEXT("TrayIcon");
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
NOTIFYICONDATA nid;
UINT WM_TASKBARCREATED;
// 不要修改TaskbarCreated,这是系统任务栏自定义的消息
WM_TASKBARCREATED = RegisterWindowMessage(TEXT("TaskbarCreated"));
switch (message)
{
case WM_CREATE:
nid.cbSize = sizeof(nid);
nid.hWnd = hwnd;
nid.uID = 0;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
nid.uCallbackMessage = WM_USER;
nid.hIcon = LoadIcon(NULL, IDI_APPLICATION);