StaticURL.cpp
上传用户:tree100901
上传日期:2016-07-12
资源大小:182k
文件大小:2k
源码类别:

外挂编程

开发平台:

Visual C++

  1. // StaticURL.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "WarH.h"
  5. #include "StaticURL.h"
  6. // CStaticURL
  7. IMPLEMENT_DYNAMIC(CStaticURL, CStatic)
  8. CStaticURL::CStaticURL()
  9. {
  10. int nCursorId = IDC_HAND;
  11. HINSTANCE hInstResource = NULL;
  12. // Destroy any previous cursor
  13. if (m_hCursor)
  14. {
  15. ::DestroyCursor(m_hCursor);
  16. m_hCursor = NULL;
  17. } // if
  18. // Load cursor
  19. if (nCursorId)
  20. {
  21. hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(nCursorId), RT_GROUP_CURSOR);
  22. // Load cursor resource
  23. m_hCursor = (HCURSOR)::LoadImage(hInstResource, MAKEINTRESOURCE(nCursorId), IMAGE_CURSOR, 0, 0, 0);
  24. } // if
  25. }
  26. CStaticURL::~CStaticURL()
  27. {
  28. }
  29. BEGIN_MESSAGE_MAP(CStaticURL, CStatic)
  30. ON_CONTROL_REFLECT(STN_CLICKED, &CStaticURL::OnStnClicked)
  31. ON_WM_CREATE()
  32. ON_WM_SHOWWINDOW()
  33. ON_WM_MOUSEMOVE()
  34. ON_WM_SETCURSOR()
  35. ON_WM_KILLFOCUS()
  36. ON_WM_SETFOCUS()
  37. END_MESSAGE_MAP()
  38. // CStaticURL 消息处理程序
  39. void CStaticURL::OnStnClicked()
  40. {
  41. // TODO: 在此添加控件通知处理程序代码
  42. static TCHAR szURL[] = _T("http://506664095.qzone.qq.com");
  43. SHELLEXECUTEINFO csSEI;
  44. memset(&csSEI, 0, sizeof(csSEI));
  45. csSEI.cbSize = sizeof(SHELLEXECUTEINFO);
  46. csSEI.fMask = SEE_MASK_FLAG_NO_UI;
  47. csSEI.lpVerb = _T("open");
  48. csSEI.lpFile = szURL;
  49. csSEI.nShow = SW_SHOWMAXIMIZED;
  50. ::ShellExecuteEx(&csSEI);
  51. }
  52. BOOL CStaticURL::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
  53. {
  54. // TODO: 在此添加消息处理程序代码和/或调用默认值
  55. if (m_hCursor != NULL)
  56. {
  57. ::SetCursor(m_hCursor);
  58. return TRUE;
  59. return CStaticURL::OnSetCursor(pWnd, nHitTest, message);
  60. }