|
Find an entity under the cursor position using Win32 and ObjectARX使用 Win32 和 ObjectARX 查找光标位置下的实体[code]BOOL filterMouse(MSG *pMsg)
{
if( pMsg->message == WM_MOUSEMOVE ||
pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONUP ) {
acedDwgPoint cpt={ 0, 0, 0 };
CPoint cPnt(pMsg->lParam);
acedCoordFromPixelToWorld(cPnt, cpt) ;
ads_point pt={ cpt[X], cpt[Y], 0 } ;
ads_name ss;
acedSSGet(L"_:E", pt, NULL, NULL, ss) ;
long len =0 ;
acedSSLength(ss, &len) ;
acutPrintf(L"\nThe ss length is %d", len) ;
acedSSFree(ss) ;
if ( pMsg->message == WM_LBUTTONDOWN || pMsg->message == WM_LBUTTONUP )
unmouse ();
}
return (FALSE) ; //----- continue
}[/code] |
|