What commands cen help returning the object`s name under the mousepointer? An A|W factory script does that when presssing the left button over an object, it displays a Marking Menu. One of these related scripts contain a suspicious command named dagObjectHit. But surprisingly, it is undocumented.
Once you get the x/y location of the mouse, you can use MGlobal::selectFromScreen(mouseX, mouseY) to select the object under the mouse.
You can get the mouse position in a couple of different ways. If you are making a context tool, you can use MEvent::getPosition(mouseX, mouseY). You can also write some windows code that gets the Window context and uses GetCursorPos and some other math to figure out the position of the mouse.
g-