The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Caret position

Is there any way to get exact caret position?WinAPI getcaretpos works for notepad,and few more simple apps.But it never returns right caret position for Word,IE,Opera...
anon for this
Sunday, August 17, 2008
That's because Word, IE, and Opera all paint their own UI's without using native Windows controls. Caret position is really only applicable to textboxes and richtextboxes. It doesn't apply to all controls (especially "owner-drawn" ones). For example labels, calendars, buttons, images, and many more controls do not have the concept of caret position.

So no, there isn't a common standard way to get the caret position for a generic window/application. Especially for those that implement their own UI's without using the built-in textbox controls.
Monday, August 18, 2008
Properly done custom controls can have the caret from WinAPI - it is just that everyone want to reinvent the wheel. It also implicates that there can be a situation where user sees few custom carets blinking at the same time and that is a violation of Window GUI.
asmguru62 Send private email
Monday, August 18, 2008

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz