我想实现frontpage中,鼠标移到每行或者每列的开头就出现箭头,所以做了如下操作:
在PreTranslateMessage中截获了mousemove的消息
void CHHtmlEditCtrl::MouseMove(UINT nFlags, CPoint point)
{
IHTMLDocument2 *pDoc;
GetDHtmlDocument(&pDoc);
IHTMLElement * pElement;
// 转换成客户区的坐标
//ScreenToClient(point);
//LPPOINT repoint;
//repoint->x = point.x;
ScreenToClient(&point);
HRESULT hr = pDoc->elementFromPoint(point.x,point.y,&pElement);
BSTR str;
pElement->get_tagName(&str);
CString tempstr = (CW2A)str;
if(tempstr =="TR"||tempstr == "TABLE")
{
// tr基本上不会被找到,只好奢望table
// 但是55555555555555,我发现无法获取当前table的位置
// 自然无从知道此时的鼠标到底在table的什么位置
// 晕倒,我该怎么办?
}
}
在PreTranslateMessage中截获了mousemove的消息
void CHHtmlEditCtrl::MouseMove(UINT nFlags, CPoint point)
{
IHTMLDocument2 *pDoc;
GetDHtmlDocument(&pDoc);
IHTMLElement * pElement;
// 转换成客户区的坐标
//ScreenToClient(point);
//LPPOINT repoint;
//repoint->x = point.x;
ScreenToClient(&point);
HRESULT hr = pDoc->elementFromPoint(point.x,point.y,&pElement);
BSTR str;
pElement->get_tagName(&str);
CString tempstr = (CW2A)str;
if(tempstr =="TR"||tempstr == "TABLE")
{
// tr基本上不会被找到,只好奢望table
// 但是55555555555555,我发现无法获取当前table的位置
// 自然无从知道此时的鼠标到底在table的什么位置
// 晕倒,我该怎么办?
}
}
建议的解决方法……在上下文菜单中添加选择行/选择列选项……*%#·!*—%
就是想锦上添那么一朵小花,鼠标选择可以让我小小的虚荣心得到满足:)
有没有办法通过pElement得到table的屏幕位置?