-#ifdef __WIN16__
- ::SetCaretPos(m_x, m_y) ;
-#else
- if ( !::SetCaretPos(m_x, m_y) )
- {
- wxLogLastError("SetCaretPos");
- }
-#endif
+ wxASSERT_MSG( wxWindow::FindFocus() == GetWindow(),
+ wxT("how did we lose focus?") );
+
+ // for compatibility with the generic version, the coordinates are
+ // client ones
+ wxPoint pt = GetWindow()->GetClientAreaOrigin();
+ CALL_CARET_API(SetCaretPos, (m_x + pt.x, m_y + pt.y));