IDE caret-position for window-popups

hi all,
is there a way to access the text-cursor-position (the caret in the IDE, not the mouse eg QtGUI.cursorPosition) ?
i want to build some custom popup windows at exact string positions (using Document Class) to insert custom blocks etc.

the SCIDEs autocompletion-popup wins are exactely doing this (they popup at the correct pos on screen), how to access this position?

thank you in advance!!