win ce右键消息
点按动作是WinCE里面取代右键的动作。 SHRecognizeGesture API是用来判断是否有点按消息的。在直接模式,如果有点按消息,则返回GN_CONTEXTMENU,否则返回0 。对通知模式,则发送WM_NOTIFY 消息携带GN_CONTEXTMENU 到父窗口
1.#include "aygshell.h"
2.如果是CWnd窗口接受消息,由于MFC的错误,应该如下处理:
void CXxWnd::OnLButtonDown(UINT nFlags, CPoint point)
{
SHRGINFO shrgi = {0};
shrgi.cbSize = sizeof(SHRGINFO);
shrgi.hwndClient = m_hWnd;
shrgi.ptDown.x = point.x;
shrgi.ptDown.y = point.y;
shrgi.dwFlags = SHRG_RETURNCMD;
if(GN_CONTEXTMENU == ::SHRecognizeGesture(&shrgi))
....//右键消息的响应函数
else
Default();
}
EVC 中 include <Aygshell.h> 的错误
http://hi.baidu.com/wlcspace
解决方法:
把 include <Aygshell.h> 添加到StdAfx.h中,把其他文件中的 include <Aygshell.h> 都删掉。
另外要注意,include <Aygshell.h> 要放到StdAfx.h中其他include的前面。
修改后的StdAfx.h如下:
#if !defined(AFX_STDAFX_H__5320ACCF_F901_4DD6_9770_78376A4F8121__INCLUDED_)
#define AFX_STDAFX_H__5320ACCF_F901_4DD6_9770_78376A4F8121__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include <aygshell.h> // 放到这里
#pragma comment(lib, "aygshell.lib") // 放到这里
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
//......
#endif