16,472
社区成员
发帖
与我相关
我的任务
分享
// 公司LOGO变量
CStatic m_Logo;
// 鼠标左键按下
void CTempViewDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
CRect rect;
m_Logo.GetWindowRect(&rect); // 获取屏幕位置座标
ScreenToClient(&rect); // 将屏幕位置转换成用户区位置座标
if (rect.PtInRect(point))
ShellExecute(AfxGetMainWnd()->m_hWnd,_T("open"),
_T(HOYOLA_HTTP),_T(""),NULL,SW_SHOW); // 打开公司网页
CDialog::OnLButtonDown(nFlags, point);
}
// 光标捕捉
BOOL CTempViewDlg::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: 光标进入公司LOGO时改变光标形状
CRect rect;
m_Logo.GetWindowRect(&rect);
ScreenToClient(&rect);
CPoint point;
GetCursorPos(&point);
ScreenToClient(&point);
if (rect.PtInRect(point) && m_hCursor)
{
SetCursor(m_hCursor);
return TRUE;
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}