War3Container.cpp
上传用户:jinbin898
上传日期:2022-06-24
资源大小:89k
文件大小:1k
源码类别:

外挂编程

开发平台:

Visual C++

  1. // War3Container.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "ReKey.h"
  5. #include "War3Container.h"
  6. // CWar3Container
  7. IMPLEMENT_DYNAMIC(CWar3Container, CStatic)
  8. CWar3Container::CWar3Container()
  9. {
  10. }
  11. CWar3Container::~CWar3Container()
  12. {
  13. }
  14. BEGIN_MESSAGE_MAP(CWar3Container, CStatic)
  15. ON_WM_RBUTTONUP()
  16. ON_WM_SETCURSOR()
  17. END_MESSAGE_MAP()
  18. // CWar3Container 消息处理程序
  19. extern CString g_war3InstallPath;
  20. void CWar3Container::OnRButtonUp(UINT nFlags, CPoint point)
  21. {
  22. // TODO: 在此添加消息处理程序代码和/或调用默认值
  23. POINT pt;
  24. GetCursorPos(&pt);
  25. CMenu menu;
  26. menu.CreatePopupMenu();
  27. if ( g_war3InstallPath.GetLength() != 0 )
  28. {
  29. menu.AppendMenu(MF_STRING,IDM_SETWAR3PATH,_T("重设war3路径"));
  30. }
  31. else
  32. {
  33. menu.AppendMenu(MF_STRING,IDM_SETWAR3PATH,_T("设置war3路径"));
  34. }
  35. menu.TrackPopupMenu(TPM_LEFTALIGN,pt.x,pt.y,this->GetParent());
  36. menu.Detach();
  37. menu.DestroyMenu();
  38. CStatic::OnRButtonUp(nFlags, point);
  39. }
  40. BOOL CWar3Container::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
  41. {
  42. // TODO: 在此添加消息处理程序代码和/或调用默认值
  43. HCURSOR hCursor = (HCURSOR)LoadImage(NULL,IDC_HAND,IMAGE_CURSOR,0,0,LR_SHARED);//LoadCursor(NULL,IDC_HAND);
  44. if (hCursor)
  45. {
  46. ::SetCursor(hCursor);
  47. return TRUE;
  48. }
  49. return CStatic::OnSetCursor(pWnd, nHitTest, message);
  50. }