⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 traynot.cpp

📁 用过恒迅达交换机的人都知道。恒迅达交换机是需要在交换机内部运行中间程序来给脚本提供数据接口并且监控机器运行状态的。本程序即是完成以上功能!用C++开发、调用了数据库(sqlserver2000)存储过
💻 CPP
字号:
#include "stdafx.h"
#include "TrayNot.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTrayNot

CTrayNot::CTrayNot ( CWnd* pWnd, UINT uCallbackMessage,
							LPCTSTR szTip, HICON* pList )
{
	// this is only for Windows 95 (or higher)
	m_bEnabled = ( GetVersion() & 0xff ) >= 4 ;
	if (!m_bEnabled)
		return ;

	// load up the NOTIFYICONDATA structure
	m_tnd.cbSize = sizeof(NOTIFYICONDATA) ;
	m_tnd.hWnd = pWnd->GetSafeHwnd() ;
	m_tnd.uID = 0 ;
	m_tnd.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP ;	
	m_tnd.uCallbackMessage = uCallbackMessage;  
	strcpy ( m_tnd.szTip, "应用业务服务器");
	//or you could use:
	//strcpy ( m_tnd.szTip, AfxGetApp()->m_pszAppName);
	//this will display the app name instead of the string you specify 

 
 
	// save the pointer to the icon list and set the initial
	// default icon.
	m_pIconList = pList ;
	m_tnd.hIcon = m_pIconList[0] ;
	Shell_NotifyIcon (NIM_ADD,&m_tnd);
 


}

CTrayNot::~CTrayNot()
{
	if (m_bEnabled)
		Shell_NotifyIcon (NIM_DELETE, &m_tnd);
}

void CTrayNot::SetState(int id)
{
	if (!m_bEnabled)
		return;
	m_tnd.hIcon = m_pIconList[id];
	//Ive found in windows XP that this command makes the icon not visable in the system tray....we dont want that now
	//do we?
//	Shell_NotifyIcon(NIM_MODIFY, &m_tnd);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -