War3Container.cpp
上传用户:jinbin898
上传日期:2022-06-24
资源大小:89k
文件大小:1k
- // War3Container.cpp : 实现文件
- //
- #include "stdafx.h"
- #include "ReKey.h"
- #include "War3Container.h"
- // CWar3Container
- IMPLEMENT_DYNAMIC(CWar3Container, CStatic)
- CWar3Container::CWar3Container()
- {
- }
- CWar3Container::~CWar3Container()
- {
- }
- BEGIN_MESSAGE_MAP(CWar3Container, CStatic)
- ON_WM_RBUTTONUP()
- ON_WM_SETCURSOR()
- END_MESSAGE_MAP()
- // CWar3Container 消息处理程序
- extern CString g_war3InstallPath;
- void CWar3Container::OnRButtonUp(UINT nFlags, CPoint point)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- POINT pt;
- GetCursorPos(&pt);
- CMenu menu;
- menu.CreatePopupMenu();
-
- if ( g_war3InstallPath.GetLength() != 0 )
- {
- menu.AppendMenu(MF_STRING,IDM_SETWAR3PATH,_T("重设war3路径"));
- }
- else
- {
- menu.AppendMenu(MF_STRING,IDM_SETWAR3PATH,_T("设置war3路径"));
- }
- menu.TrackPopupMenu(TPM_LEFTALIGN,pt.x,pt.y,this->GetParent());
- menu.Detach();
- menu.DestroyMenu();
- CStatic::OnRButtonUp(nFlags, point);
- }
- BOOL CWar3Container::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
- {
- // TODO: 在此添加消息处理程序代码和/或调用默认值
- HCURSOR hCursor = (HCURSOR)LoadImage(NULL,IDC_HAND,IMAGE_CURSOR,0,0,LR_SHARED);//LoadCursor(NULL,IDC_HAND);
- if (hCursor)
- {
- ::SetCursor(hCursor);
- return TRUE;
- }
- return CStatic::OnSetCursor(pWnd, nHitTest, message);
- }