//////////////////////////////////////////////////////////////
//
// Includes
//
//////////////////////////////////////////////////////////////
#define _AFX_NOFORCE_LIBS // we do not want to link to MFC DLLs or libs
#ifdef _DEBUG
#define WAS_DEBUG
#undef _DEBUG
#endif
#include "afxwin.h" // need this because ******rxmfcapi.h****** needs windows header.
//////////////////////////////////////////////////////////////
//
// Standard C Test function
//
//////////////////////////////////////////////////////////////
BOOL filterLC(MSG *pMsg); // hook function for autoimeing.
BOOL filterMouse(MSG *pMsg); // hook function for making mouse dragging
// only horizontal or vertical based on
// SHIFT or Control key is pressed or not.
static BOOL vMode; // holds mouse vertical Mode status
static BOOL hMode; // holds mouse horizontal Mode status
// preventing from inserting the same hook twice.
static BOOL autoimeDone = FALSE;
static BOOL mouseDone = FALSE;
acedRegCmds->addCommand( "MKEvents", // Group name
"autoime", // Global function name
"autoime", // Local function name
ACRX_CMD_MODAL, // Type
&autoime ); // Function pointer
acedRegCmds->addCommand( "MKEvents", // Group name
"vhmouse", // Global function name
"vhmouse", // Local function name
ACRX_CMD_MODAL, // Type
&mouse ); // Function pointer
acedRegCmds->addCommand( "MKEvents", // Group name
"unautoime", // Global function name
"unautoime", // Local function name
ACRX_CMD_MODAL, // Type
&unautoime ); // Function pointer
acedRegCmds->addCommand( "MKEvents", // Group name
"unvhmouse", // Global function name
"unvhmouse", // Local function name
ACRX_CMD_MODAL, // Type
&unmouse ); // Function pointer
//acutPrintf( ".OK!\n" );
}
void unloadApp()
{
// Remove the command group because we are unloading
//
acedRegCmds->removeGroup( "MKEvents" );
// Removing all hooks <no matter they're planted or not>
if (autoimeDone == TRUE)
acedRemoveFilterWinMsg(filterLC);
if (mouseDone == TRUE)
acedRemoveFilterWinMsg(filterMouse);
}
//////////////////////////////////////////////////////////////
//
// Entry point
//
//////////////////////////////////////////////////////////////