📄 shellicon.cpp
字号:
// ShellIcon.cpp: implementation of the CShellIcon class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ShellIcon.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CShellIcon::CShellIcon()
{
}
//////////////////////////////////////////////////////////////////////
// 功能: 构造函数
// 参数:
// pMainWnd: 主窗口;
// hIcon : 在任务栏上显示的图标句柄
// strTip : 当鼠标位于其上显示的提示文本
// 返回值: 无
//////////////////////////////////////////////////////////////////////
CShellIcon::CShellIcon(CWnd* pMainWnd,HICON hIcon, UINT uMsg, CString strTip )
{
m_pMainWnd = pMainWnd;
m_hIcon = hIcon;
m_strTip = strTip;
m_uMsg = uMsg;
}
CShellIcon::~CShellIcon()
{
}
void CShellIcon::AddIcon()
{
memset(&m_tndData,0,sizeof(NOTIFYICONDATA));
m_tndData.cbSize = sizeof(NOTIFYICONDATA);
m_tndData.hIcon = m_hIcon;
m_tndData.hWnd = m_pMainWnd->m_hWnd;
m_tndData.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
m_tndData.uID = 101;
m_tndData.uCallbackMessage = m_uMsg;
_tcscpy(m_tndData.szTip,m_strTip);
Shell_NotifyIcon(NIM_ADD,&m_tndData);
}
void CShellIcon::DeleteIcon()
{
m_tndData.uFlags = NIF_ICON;
Shell_NotifyIcon(NIM_DELETE,&m_tndData);
}
void CShellIcon::Init(CWnd* pMainWnd,UINT uMsg, CString strTip, HICON hIcon)
{
m_pMainWnd = pMainWnd;
m_hIcon = hIcon;
m_uMsg = uMsg;
m_strTip = strTip;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -