Locating mouse clicks



Hello everybody!
I'm using VC++ 6.0, MFC, CHtmlView.
I've encountered a strange problem since I installed IE7. I'm locating mouse clicks by creating a text range
object on the body element and then locating the clicked on word by the moveToPoint function. It worked fine
on IE6 but on IE7 it doesn't work on certain web pages that are vertically scrolled. If the web page below
is rendered in a small window and scrolled to the bottom a click on the "footer" will make the moveToPoint
return "LineK" or some other line depending of the size of the window.
The problem goes away if the DOCTYPE element is removed from the web page or if the "html," is removed
from the style ***.
The disturbing thing is that IE7 seems to be able todetermine where the mouse is clicked on this page.
I don't understand what's going on here. Could someone please enlighten me. Thanks in advance!
Regards
Jan

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";>
<html>
<head>
<title>Click Test</title>
<style>
html,body {height:100%}
table.layout {height:100%; margin-left:auto; margin-right:auto;}
</style>
</head>

<body>
<table class="layout">
<tr valign="top">
<td>
LineA<br>LineB<br>LineC<br>LineD<br>LineE<br>LineF<br>LineG<br>LineH<br>LineI<br>LineJ<br>
LineK<br>LineL<br>LineM<br>LineN<br>LineO<br>LineP<br>LineQ<br>LineR<br>LineS<br>LineT<br>
LineU<br>LineV<br>LineW<br>LineX<br>LineY<br>LineZ
</td>
</tr>
<tr>
<td>
Footer
</td>
</tr>
</table>
</body>
</html>

Jan Ostedt
www.learnware.se

.