![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
TWebBrowser [D6, D7, Win2k, WinXP]
Vladimir © (2003-01-12 10:28:00)Скажите, можно ли в TWebBrowser программно кликнуть по ссылке, и если можно, то может кто знает как?
Troll (2003-01-13 23:51:00) [1]2Opuhshii
огромное спасибо, если не трудно не поможешь организовать это дело для какого нибудь фрейма.
2Ksion (2003-01-13 17:21:00) [2]Opuhshii
А можно такойже код для кнопки? а то импритировал не получаеться.=(
Opuhshii (2003-01-13 12:29:00) [3]или можно по другому...
procedure TForm1.Button2Click(Sender: TObject);
var
Document:Variant;
A:Variant;
I:Integer;
begin
WebBrowser1.Navigate("www.delphi.mastak.ru");
while WebBrowser1.ReadyState <> READYSTATE_COMPLETE do
Application.ProcessMessages;
ShowMessageFmt("%s READYSTATE_COMPLETE",[WebBrowser1.LocationURL]);
Document:=WebBrowser1.Document;
for I:=1 to Document.Body.All.Tags("A").Length -1 do begin // перебором все теги <A></A>
A:=Document.Body.All.Tags("A").Item(I);
if A.InnerText="FAQ" then // если Текст = FAQ тогда
A.Click; // Кликнем по этому элементу
end;
end;
alvin (2003-01-13 07:56:00) [4]Это чтобы имитпровать клик, сначала надо имитировать перемещение, затем MOUSEEVENTF_LEFTDOWN,а затем MOUSEEVENTF_LEFTUP - я правильно понимаю?
alvin (2003-01-13 07:56:00) [5]Это чтобы имитировать клик, сначала надо имитировать перемещение, затем MOUSEEVENTF_LEFTDOWN,а затем MOUSEEVENTF_LEFTUP - я правильно понимаю?
Rouse_ (2003-01-12 18:59:00) [6]
The mouse_event function synthesizes mouse motion and button clicks.
VOID mouse_event(
DWORD dwFlags, // flags specifying various motion/click variants
DWORD dx, // horizontal mouse position or position change
DWORD dy, // vertical mouse position or position change
DWORD dwData, // amount of wheel movement
DWORD dwExtraInfo // 32 bits of application-defined information
);
Parameters
dwFlags
A set of flag bits that specify various aspects of mouse motion and button clicking. The bits in this parameter can be any reasonable combination of the following values:
Value Meaning
MOUSEEVENTF_ABSOLUTE Specifies that the dx and dy parameters contain normalized absolute coordinates. If not set, those parameters contain relative data: the change in position since the last reported position. This flag can be set, or not set, regardless of what kind of mouse or mouse-like device, if any, is connected to the system. For further information about relative mouse motion, see the following Remarks section.
MOUSEEVENTF_MOVE Specifies that movement occurred.
MOUSEEVENTF_LEFTDOWN Specifies that the left button changed to down.
MOUSEEVENTF_LEFTUP Specifies that the left button changed to up.
MOUSEEVENTF_RIGHTDOWN Specifies that the right button changed to down.
MOUSEEVENTF_RIGHTUP Specifies that the right button changed to up.
MOUSEEVENTF_MIDDLEDOWN Specifies that the middle button changed to down.
MOUSEEVENTF_MIDDLEUP Specifies that the middle button changed to up.
MOUSEEVENTF_WHEEL Windows NT only: Specifies that the wheel has been moved, if the mouse has a wheel. The amount of movement is given in dwData
Разве трудно F1 нажать?
Желаю успехов
sergey2 (2003-01-12 18:37:00) [7]Народ, подскажите чем отличается клик по ссылке в TWebbrowser от Webbrowser1.Navigate2(URL)?
Vladimir (2003-01-12 12:36:00) [8]А подробнее, можно? Mouse_event() - что это
Song (2003-01-12 10:30:00) [9]Mouse_event()