- int lineNo = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)pos, (LPARAM)0);
+ int lineNo;
+#if wxUSE_RICHEDIT
+ if ( m_isRich )
+ {
+ lineNo = (int)SendMessage(hWnd, EM_EXLINEFROMCHAR, 0, (LPARAM)pos);
+ }
+ else
+#endif // wxUSE_RICHEDIT
+ lineNo = (int)SendMessage(hWnd, EM_LINEFROMCHAR, (WPARAM)pos, 0);
+
+ if ( lineNo == -1 )
+ {
+ // no such line
+ return FALSE;
+ }
+