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

📄 mainicon.cpp

📁 vc数据库编程程序
💻 CPP
字号:
// MainIcon.cpp : implementation file
//

#include "stdafx.h"
#include "MySqlPlus.h"
#include "MainIcon.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainIcon

CMainIcon::CMainIcon()
{
	m_bMouseTracking = false;
	m_hCursor = AfxGetApp()->LoadStandardCursor( MAKEINTRESOURCE(32649) );

}

CMainIcon::~CMainIcon()
{
}


BEGIN_MESSAGE_MAP(CMainIcon, CStatic)
	//{{AFX_MSG_MAP(CMainIcon)
	ON_CONTROL_REFLECT(BN_CLICKED, OnClicked)
	ON_WM_MOUSEMOVE()
	ON_WM_SETCURSOR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMainIcon message handlers

void CMainIcon::OnClicked() 
{
	CString strLink = "mailto:gaochun@ec.necsi-sh.nec.com.cn";
	::ShellExecute(NULL,"open",strLink,NULL,NULL,SW_SHOWNORMAL);
}

void CMainIcon::OnMouseMove(UINT nFlags, CPoint point) 
{
	if( !m_bMouseTracking || GetCapture() != this )
	{
		OnMouseEnter();
	}
	else
	{
		CRect rc;
		GetClientRect(&rc);
		if(!rc.PtInRect(point))	// The mouse cursor is no longer above this button
		{
			OnMouseLeave();
		}
	}
	
	CStatic::OnMouseMove(nFlags, point);
}

void CMainIcon::OnMouseLeave()
{
	m_bMouseTracking = false;

	CDC *mydc = GetDC ();	
	CRect rc;
	GetClientRect(&rc);
	mydc->Draw3dRect (&rc,RGB(255,255,255),RGB(255,255,255));

	ReleaseCapture();

}

void CMainIcon::OnMouseEnter()
{
	m_bMouseTracking = true;

	CDC *mydc = GetDC ();	
	CRect rc;
	GetClientRect(&rc);
	mydc->Draw3dRect (&rc,RGB(12,12,121),RGB(32,34,234));

	SetCapture();

}

BOOL CMainIcon::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
{
	if (m_hCursor) 
	{
		::SetCursor(m_hCursor);
		return TRUE;
	}
	
	return CStatic::OnSetCursor(pWnd, nHitTest, message);
}

⌨️ 快捷键说明

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