#pragma once
// CSystemTray.h 头文件
class CSystemTray : public CWnd
{
DECLARE_DYNAMIC(CSystemTray)
public:
CSystemTray();
virtual ~CSystemTray();
protected:
DECLARE_MESSAGE_MAP()
private:
NOTIFYICONDATA m_nid; //系统托盘数据结构
public:
BOOL Create(HWND hWnd, UINT uID, UINT uCallbackMessage, HICON hIcon, LPCTSTR szTip); //创建系统托盘
BOOL ModefyTrayIcon(HICON hIcon); //更改托盘图标
BOOL ModefyTrayTip(LPCTSTR szTip); //更改托盘提示信息
BOOL ModefyTrayMenu(UINT uID, int nSub); //更改托盘菜单
BOOL DeleteTray();//删除托盘
HRESULT OnSystemTrayMsg(WPARAM wParam, LPARAM lParam); //托盘消息映射
};
// SystemTray.cpp 源文件
//
#include "stdafx.h"
#include "FreeIM.h"
#include "SystemTray.h"
// CSystemTray
IMPLEMENT_DYNAMIC(CSystemTray, CWnd)
CSystemTray::CSystemTray()
{
}
CSystemTray::~CSystemTray()
{
}
BEGIN_MESSAGE_MAP(CSystemTray, CWnd)
END_MESSAGE_MAP()
// CSystemTray 消息处理程序
BOOL CSystemTray::Create(HWND hWnd, UINT uID, UINT uCallback
vc 系统托盘类
最新推荐文章于 2022-03-23 21:28:36 发布