Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.08.01;
Скачать: CL | DM;

Вниз

Слово   Найти похожие ветки 

 
Volk   (2004-07-18 02:34) [0]

Как получит слово в браузере (только не в TWebBrowser, а обычный Интернет браузер) над которым находится курсор.


 
Volk   (2004-07-18 03:50) [1]

Хотя вот нашел пример, тока он из richedit берет слово а надо из обычного браузера!

uses
RichEdit;
 
procedure TForm1.RichEdit1MouseMove(Sender: TObject; Shift: TShiftState;
 X, Y: Integer);
var
 iCharIndex, iLineIndex, iCharOffset, i, j: Integer;
 Pt: TPoint;
 s: string;
begin
 with TRichEdit(Sender) do
 begin
   Pt := Point(X, Y);
   // Get Character Index from word under the cursor
   iCharIndex := Perform(Messages.EM_CHARFROMPOS, 0, Integer(@Pt));
   if iCharIndex < 0 then Exit;
   // Get line Index
   iLineIndex  := Perform(EM_EXLINEFROMCHAR, 0, iCharIndex);
   iCharOffset := iCharIndex - Perform(EM_LINEINDEX, iLineIndex, 0);
   if Lines.Count - 1 < iLineIndex then Exit;
   // store the current line in a variable
   s := Lines[iLineIndex];
   // Search the beginning of the word
   i := iCharOffset + 1;
   while (i > 0) and (s[i] <> " ") do Dec(i);
   // Search the end of the word
   j := iCharOffset + 1;
   while (j <= Length(s)) and (s[j] <> " ") do Inc(j);
   // Display Text under Cursor
   Caption := Copy(s, i, j - i);
 end;
end;



Страницы: 1 вся ветка

Текущий архив: 2004.08.01;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.053 c
14-1089745881
\m/
2004-07-13 23:11
2004.08.01
Асма в делфи


1-1089898891
DSKalugin
2004-07-15 17:41
2004.08.01
закраска в StringGrid


1-1090239944
Lenor
2004-07-19 16:25
2004.08.01
сравнение TMemo.Lines


9-1082455854
WondeRu
2004-04-20 14:10
2004.08.01
OpenGL Extensions


4-1086938374
leonidus
2004-06-11 11:19
2004.08.01
Плавающее окошко как у FlashGet