StaticURL.cpp
资源名称:WarH_2.10.rar [点击查看]
上传用户:tree100901
上传日期:2016-07-12
资源大小:182k
文件大小:2k
源码类别:
外挂编程
开发平台:
Visual C++
- // StaticURL.cpp : 实现文件
- //
- #include "stdafx.h"
- #include "WarH.h"
- #include "StaticURL.h"
- // CStaticURL
- IMPLEMENT_DYNAMIC(CStaticURL, CStatic)
- CStaticURL::CStaticURL()
- {
- int nCursorId = IDC_HAND;
- HINSTANCE hInstResource = NULL;
- // Destroy any previous cursor
- if (m_hCursor)
- {
- ::DestroyCursor(m_hCursor);
- m_hCursor = NULL;
- } // if
- // Load cursor
- if (nCursorId)
- {
- hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nCursorId), RT_GROUP_CURSOR);
- // Load cursor resource
- m_hCursor = (HCURSOR)::LoadImage(hInstResource, MAKEINTRESOURCE(nCursorId), IMAGE_CURSOR, 0, 0, 0);
- } // if
- }
- CStaticURL::~CStaticURL()
- {
- }
- BEGIN_MESSAGE_MAP(CStaticURL, CStatic)
- ON_CONTROL_REFLECT(STN_CLICKED, &CStaticURL::OnStnClicked)
- ON_WM_CREATE()
- ON_WM_SHOWWINDOW()
- ON_WM_MOUSEMOVE()
- ON_WM_SETCURSOR()
- ON_WM_KILLFOCUS()
- ON_WM_SETFOCUS()
- END_MESSAGE_MAP()
- // CStaticURL 消息处理程序
- void CStaticURL::OnStnClicked()
- {
- // TODO: 在此添加控件通知处理程序代码
- static TCHAR szURL[] = _T("http://506664095.qzone.qq.com");
- SHELLEXECUTEINFO csSEI;
- memset(&csSEI, 0, sizeof(csSEI));
- csSEI.cbSize = sizeof(SHELLEXECUTEINFO);
- csSEI.fMask = SEE_MASK_FLAG_NO_UI;
- csSEI.lpVerb = _T("open");
- csSEI.lpFile = szURL;
- csSEI.nShow = SW_SHOWMAXIMIZED;
- ::ShellExecuteEx(&csSEI);
- }
- BOOL CStaticURL::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- if (m_hCursor != NULL)
- {
- ::SetCursor(m_hCursor);
- return TRUE;
- }
- return CStaticURL::OnSetCursor(pWnd, nHitTest, message);
- }