here is part of code from O2HEdit
from Arnold or Roland ...from old JRS forum
but this code is not test and there is no proof that work properly
any expert?
case IDC_FINDNEXT 'Find next Button
SendMessage hFindEdit, WM_GETTEXT,len(szBuffer), szBuffer
if IsDlgButtonChecked(hDlg, IDC_FINDDOWN) then
down=true
FindTxt.Chrg.cpMin = SendMessage(hSci, SCI_GetCurrentPos,0,0) 'if up-curpos, if down-anchor
else
down=false
FindTxt.Chrg.cpMin = SendMessage(hSci, SCI_GetAnchor,0,0) 'if up-curpos, if down-anchor
end if
FindTxt.Chrg.cpMax = down * SendMessage(hSci, SCI_GetLength,0,0) 'if up-length if down-0
FindTxt.lpstrText=szBuffer 'The search pattern (NULL terminated)
dwSearchOptions=0
if IsDlgButtonChecked(hDlg, IDC_FINDMATCHWORD) then dwSearchOptions= SCFIND_WHOLEWORD
if IsDlgButtonChecked(hDlg, IDC_FINDMATCHCASE) then dwSearchOptions=dwSearchOptions OR SCFIND_MATCHCASE
if SendMessage(hSci, SCI_FINDTEXT, dwSearchOptions, FindTxt)=-1 then
mbox "No (more) matches found"
else
dwCurLine=SendMessage(hSci, SCI_LINEFROMPOSITION,FindTxt.chrgText.cpMin,0)
SendMessage hSci, SCI_ENSUREVISIBLE,dwCurLine,0 'Open the sub containing this line if necessary
SendMessage hSci, SCI_SETCURRENTPOS,FindTxt.chrgText.cpMax,0 'Set end of selection
SendMessage hSci, SCI_SETANCHOR,FindTxt.chrgText.cpMin,0 'Set begin of selection
SendMessage hSci, SCI_SCROLLCARET,0,0 'Scroll to the current caret position
end if