⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 navmsg_.h

📁 EVC环境下用SDK开发WINCE的应用程序
💻 H
字号:
#ifndef _NAVMSG_H_
#define _NAVMSG_H_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

enum NavSig
{
	NavSig_end = 0,     // [marks end of message map]

	NavSig_bD,      // BOOL (CDC*)
	NavSig_bb,      // BOOL (BOOL)
	NavSig_bWww,    // BOOL (CWnd*, UINT, UINT)
	NavSig_hDWw,    // HBRUSH (CDC*, CWnd*, UINT)
	NavSig_hDw,     // HBRUSH (CDC*, UINT)
	NavSig_iwWw,    // int (UINT, CWnd*, UINT)
	NavSig_iww,     // int (UINT, UINT)
	NavSig_iWww,    // int (CWnd*, UINT, UINT)
	NavSig_is,      // int (LPTSTR)
	NavSig_lwl,     // LRESULT (WPARAM, LPARAM)
	NavSig_lwwM,    // LRESULT (UINT, UINT, CMenu*)
	NavSig_vv,      // void (void)

	NavSig_vw,      // void (UINT)
	NavSig_vww,     // void (UINT, UINT)
	NavSig_vvii,    // void (int, int) // wParam is ignored
	NavSig_vwww,    // void (UINT, UINT, UINT)
	NavSig_vwii,    // void (UINT, int, int)
	NavSig_vwl,     // void (UINT, LPARAM)
	NavSig_vbWW,    // void (BOOL, CWnd*, CWnd*)
	NavSig_vD,      // void (CDC*)
	NavSig_vM,      // void (CMenu*)
	NavSig_vMwb,    // void (CMenu*, UINT, BOOL)

	NavSig_vW,      // void (CWnd*)
	NavSig_vWww,    // void (CWnd*, UINT, UINT)
	NavSig_vWp,     // void (CWnd*, CPoint)
	NavSig_vWh,     // void (CWnd*, HANDLE)
	NavSig_vwW,     // void (UINT, CWnd*)
	NavSig_vwWb,    // void (UINT, CWnd*, BOOL)
	NavSig_vwwW,    // void (UINT, UINT, CWnd*)
	NavSig_vwwx,    // void (UINT, UINT)
	NavSig_vs,      // void (LPTSTR)
	NavSig_vOWNER,  // void (int, LPTSTR), force return TRUE
	NavSig_iis,     // int (int, LPTSTR)
	NavSig_wp,      // UINT (CPoint)
	NavSig_wv,      // UINT (void)
	NavSig_vPOS,    // void (WINDOWPOS*)
	NavSig_vCALC,   // void (BOOL, NCCALCSIZE_PARAMS*)
	NavSig_vNMHDRpl,    // void (NMHDR*, LRESULT*)
	NavSig_bNMHDRpl,    // BOOL (NMHDR*, LRESULT*)
	NavSig_vwNMHDRpl,   // void (UINT, NMHDR*, LRESULT*)
	NavSig_bwNMHDRpl,   // BOOL (UINT, NMHDR*, LRESULT*)
	NavSig_bHELPINFO,   // BOOL (HELPINFO*)
	NavSig_vwSIZING,    // void (UINT, LPRECT) -- return TRUE

	// signatures specific to CCmdTarget
	NavSig_cmdui,   // void (CCmdUI*)
	NavSig_cmduiw,  // void (CCmdUI*, UINT)
	NavSig_vpv,     // void (void*)
	NavSig_bpv,     // BOOL (void*)

	// Other aliases (based on implementation)
	NavSig_vwwh,                // void (UINT, UINT, HANDLE)
	NavSig_vwp,                 // void (UINT, CPoint)
	NavSig_bw = NavSig_bb,      // BOOL (UINT)
	NavSig_bh = NavSig_bb,      // BOOL (HANDLE)
	NavSig_iw = NavSig_bb,      // int (UINT)
	NavSig_ww = NavSig_bb,      // UINT (UINT)
	NavSig_bv = NavSig_wv,      // BOOL (void)
	NavSig_hv = NavSig_wv,      // HANDLE (void)
	NavSig_vb = NavSig_vw,      // void (BOOL)
	NavSig_vbh = NavSig_vww,    // void (BOOL, HANDLE)
	NavSig_vbw = NavSig_vww,    // void (BOOL, UINT)
	NavSig_vhh = NavSig_vww,    // void (HANDLE, HANDLE)
	NavSig_vh = NavSig_vw,      // void (HANDLE)
	NavSig_viSS = NavSig_vwl,   // void (int, STYLESTRUCT*)
	NavSig_bwl = NavSig_lwl,
	NavSig_vwMOVING = NavSig_vwSIZING,  // void (UINT, LPRECT) -- return TRUE

	NavSig_vW2,                 // void (CWnd*) (CWnd* comes from lParam)
	NavSig_bWCDS,               // BOOL (CWnd*, COPYDATASTRUCT*)
	NavSig_bwsp,                // BOOL (UINT, short, CPoint)
	NavSig_vws,
};

#define NAV_MSG_CALL
#define NAV_DATA
#define NAV_COMDAT
#define NAV_DATADEF
class CNWnd;
typedef void (NAV_MSG_CALL CNWnd::*NAV_PMSG)(void);

/////////////////////////////////////////////////////////////////////////////
// Window message map handling

struct NAV_MSGMAP_ENTRY
{
	UINT nMessage;   // windows message
	UINT nCode;      // control code or WM_NOTIFY code
	UINT nID;        // control ID (or 0 for windows messages)
	UINT nLastID;    // used for entries specifying a range of control id's
	UINT nSig;       // signature type (action) or pointer to message #
	NAV_PMSG pfn;    // routine to call (or special value)
};

struct NAV_MSGMAP
{
	const NAV_MSGMAP* pBaseMap;
	const NAV_MSGMAP_ENTRY* lpEntries;
};

#define DECLARE_MESSAGE_MAP() \
private: \
	static const NAV_MSGMAP_ENTRY _messageEntries[]; \
protected: \
	static NAV_DATA const NAV_MSGMAP messageMap; \
	virtual const NAV_MSGMAP* GetMessageMap() const; \


#define BEGIN_MESSAGE_MAP(theClass, baseClass) \
	const NAV_MSGMAP* theClass::GetMessageMap() const \
		{ return &theClass::messageMap; } \
	NAV_COMDAT NAV_DATADEF const NAV_MSGMAP theClass::messageMap = \
	{ &baseClass::messageMap, &theClass::_messageEntries[0] }; \
	NAV_COMDAT const NAV_MSGMAP_ENTRY theClass::_messageEntries[] = \
	{ \

#define BEGIN_MESSAGE_MAP_BASE(theClass) \
	const NAV_MSGMAP* theClass::GetMessageMap() const \
		{ return &theClass::messageMap; } \
	NAV_COMDAT NAV_DATADEF const NAV_MSGMAP theClass::messageMap = \
	{ NULL, &theClass::_messageEntries[0] }; \
	NAV_COMDAT const NAV_MSGMAP_ENTRY theClass::_messageEntries[] = \
	{ \

#define END_MESSAGE_MAP() \
		{0, 0, 0, 0, NavSig_end, (NAV_PMSG)0 } \
	}; \

/////////////////////////////////////////////////////////////////////////////
// Message map tables for Windows messages
#define ON_WM_PAINT() \
	{ WM_PAINT, 0, 0, 0, AfxSig_vv, \
		(AFX_PMSG)(AFX_PMSGW)(void (AFX_MSG_CALL CWnd::*)(void))&OnPaint },

// for general controls
#define ON_CONTROL(wNotifyCode, id, memberFxn) \
	{ WM_COMMAND, (WORD)wNotifyCode, (WORD)id, (WORD)id, NavSig_vv, \
		(NAV_PMSG)&memberFxn },

/////////////////////////////////////////////////////////////////////////////
// Message map tables for Control Notification messages

// Static control notification codes
#define ON_STN_CLICKED(id, memberFxn) \
	ON_CONTROL(STN_CLICKED, id, memberFxn)
#define ON_STN_DBLCLK(id, memberFxn) \
	ON_CONTROL(STN_DBLCLK, id, memberFxn)
#define ON_STN_ENABLE(id, memberFxn) \
	ON_CONTROL(STN_ENABLE, id, memberFxn)
#define ON_STN_DISABLE(id, memberFxn) \
	ON_CONTROL(STN_DISABLE, id, memberFxn)

// User Button Notification Codes
#define ON_BN_CLICKED(id, memberFxn) \
	ON_CONTROL(BN_CLICKED, id, memberFxn)
#define ON_BN_DOUBLECLICKED(id, memberFxn) \
	ON_CONTROL(BN_DOUBLECLICKED, id, memberFxn)
#define ON_BN_SETFOCUS(id, memberFxn) \
	ON_CONTROL(BN_SETFOCUS, id, memberFxn)
#define ON_BN_KILLFOCUS(id, memberFxn) \
	ON_CONTROL(BN_KILLFOCUS, id, memberFxn)

const NAV_MSGMAP_ENTRY* /*NAVAPI*/
NavFindMessageEntry(const NAV_MSGMAP_ENTRY* lpEntry,
	UINT nMsg, UINT nCode, UINT nID);

union MessageMapFunctions
{
	NAV_PMSG pfn;   // generic member function pointer


	// specific type safe variants for WM_COMMAND and WM_NOTIFY messages
/*	void (NAV_MSG_CALL CNWnd::*pfn_COMMAND)();
	BOOL (NAV_MSG_CALL CNWnd::*pfn_bCOMMAND)();
	void (NAV_MSG_CALL CNWnd::*pfn_COMMAND_RANGE)(UINT);
	BOOL (NAV_MSG_CALL CNWnd::*pfn_COMMAND_EX)(UINT);

	void (NAV_MSG_CALL CNWnd::*pfn_UPDATE_COMMAND_UI)(CCmdUI*);
	void (NAV_MSG_CALL CNWnd::*pfn_UPDATE_COMMAND_UI_RANGE)(CCmdUI*, UINT);
	void (NAV_MSG_CALL CNWnd::*pfn_OTHER)(void*);
	BOOL (NAV_MSG_CALL CNWnd::*pfn_OTHER_EX)(void*);

	void (NAV_MSG_CALL CNWnd::*pfn_NOTIFY)(NMHDR*, LRESULT*);
	BOOL (NAV_MSG_CALL CNWnd::*pfn_bNOTIFY)(NMHDR*, LRESULT*);
	void (NAV_MSG_CALL CNWnd::*pfn_NOTIFY_RANGE)(UINT, NMHDR*, LRESULT*);
	BOOL (NAV_MSG_CALL CNWnd::*pfn_NOTIFY_EX)(UINT, NMHDR*, LRESULT*);
*/
	// type safe variant for thread messages

//	void (NAV_MSG_CALL CWinThread::*pfn_THREAD)(WPARAM, LPARAM);

	// specific type safe variants for WM-style messages
/*	BOOL    (NAV_MSG_CALL CNWnd::*pfn_bD)(CDC*);
	BOOL    (NAV_MSG_CALL CNWnd::*pfn_bb)(BOOL);
	BOOL    (NAV_MSG_CALL CNWnd::*pfn_bWww)(CNWnd*, UINT, UINT);
	BOOL    (NAV_MSG_CALL CNWnd::*pfn_bHELPINFO)(HELPINFO*);
	BOOL    (NAV_MSG_CALL CNWnd::*pfn_bWCDS)(CNWnd*, COPYDATASTRUCT*);
	HBRUSH  (NAV_MSG_CALL CNWnd::*pfn_hDWw)(CDC*, CNWnd*, UINT);
	HBRUSH  (NAV_MSG_CALL CNWnd::*pfn_hDw)(CDC*, UINT);
	int     (NAV_MSG_CALL CNWnd::*pfn_iwWw)(UINT, CNWnd*, UINT);
	int     (NAV_MSG_CALL CNWnd::*pfn_iww)(UINT, UINT);
	int     (NAV_MSG_CALL CNWnd::*pfn_iWww)(CNWnd*, UINT, UINT);
	int     (NAV_MSG_CALL CNWnd::*pfn_is)(LPTSTR);
	LRESULT (NAV_MSG_CALL CNWnd::*pfn_lwl)(WPARAM, LPARAM);
	LRESULT (NAV_MSG_CALL CNWnd::*pfn_lwwM)(UINT, UINT, CMenu*);
*/	void    (NAV_MSG_CALL CNWnd::*pfn_vv)(void);
/*
	void    (NAV_MSG_CALL CNWnd::*pfn_vw)(UINT);
	void    (NAV_MSG_CALL CNWnd::*pfn_vww)(UINT, UINT);
	void    (NAV_MSG_CALL CNWnd::*pfn_vvii)(int, int);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwww)(UINT, UINT, UINT);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwii)(UINT, int, int);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwl)(WPARAM, LPARAM);
	void    (NAV_MSG_CALL CNWnd::*pfn_vbWW)(BOOL, CNWnd*, CNWnd*);
	void    (NAV_MSG_CALL CNWnd::*pfn_vD)(CDC*);
	void    (NAV_MSG_CALL CNWnd::*pfn_vM)(CMenu*);
	void    (NAV_MSG_CALL CNWnd::*pfn_vMwb)(CMenu*, UINT, BOOL);

	void    (NAV_MSG_CALL CNWnd::*pfn_vW)(CNWnd*);
	void    (NAV_MSG_CALL CNWnd::*pfn_vWww)(CNWnd*, UINT, UINT);
	void    (NAV_MSG_CALL CNWnd::*pfn_vWp)(CNWnd*, CPoint);
	void    (NAV_MSG_CALL CNWnd::*pfn_vWh)(CNWnd*, HANDLE);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwW)(UINT, CNWnd*);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwWb)(UINT, CNWnd*, BOOL);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwwW)(UINT, UINT, CNWnd*);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwwx)(UINT, UINT);
	void    (NAV_MSG_CALL CNWnd::*pfn_vs)(LPTSTR);
	void    (NAV_MSG_CALL CNWnd::*pfn_vOWNER)(int, LPTSTR);   // force return TRUE
	int     (NAV_MSG_CALL CNWnd::*pfn_iis)(int, LPTSTR);
	UINT    (NAV_MSG_CALL CNWnd::*pfn_wp)(CPoint);
	UINT    (NAV_MSG_CALL CNWnd::*pfn_wv)(void);
	void    (NAV_MSG_CALL CNWnd::*pfn_vPOS)(WINDOWPOS*);
	void    (NAV_MSG_CALL CNWnd::*pfn_vCALC)(BOOL, NCCALCSIZE_PARAMS*);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwp)(UINT, CPoint);
	void    (NAV_MSG_CALL CNWnd::*pfn_vwwh)(UINT, UINT, HANDLE);
	BOOL    (NAV_MSG_CALL CNWnd::*pfn_bwsp)(UINT, short, CPoint);
	void    (NAV_MSG_CALL CNWnd::*pfn_vws)(UINT, LPCTSTR);
*/
};

#endif // _NAVMSG_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -