Take a look at the cursor function and example files as described here in the DirectRT manual:

http://www.empirisoft.com/directrt/h...een_cursor.htm