请问怎样得到 IE 的滚动条的信息: 200 分(200分)

  • 主题发起人 主题发起人 pengyt
  • 开始时间 开始时间
P

pengyt

Unregistered / Unconfirmed
GUEST, unregistred user!
请问怎样得到 IE 的滚动条的信息(位置,最大值等),注意,是 IE,不是其他的
什么窗口.
 
这些内容是用script写上去的,不知道反过来,用来读可以不?
没试过,不好用就当提前了:)
 
介绍你个网站

http://www.euromind.com/iedelphi/
 
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls,
Forms, Dialogs,
TLHelp32, StdCtrls, ExtCtrls, CheckLst;

type
TForm1 = class(TForm)
Panel1: TPanel;
Button1: TButton;
Panel2: TPanel;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
Timer1: TTimer;
ListBox1: TListBox;
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure ListBox1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
Button1Click(self);
end;

//杀死进程
procedure TForm1.Button2Click(Sender: TObject);
var
pProcessID,Found, FAppState : dword;
sPID:string;
k:integer;
begin
sPID:=Listbox1.Items[Listbox1.ItemIndex];
k:=pos(' ',sPID);
sPID:=copy(sPID,1,k-1);
pProcessID:=strtoint64(sPID);
k:=0;
repeat
Found:=OpenProcess(PROCESS_TERMINATE,False,pProcessID);
TerminateProcess(Found,$FFFFFFFF);
Found := OpenProcess(PROCESS_QUERY_INFORMATION,False,pProcessID);
GetExitCodeProcess(Found,FAppState);
inc(k);
until (FAppState<>STILL_ACTIVE) or(k>1000);//直到这个进程已结束
application.ProcessMessages;
Button1Click(Sender);
end;

procedure TForm1.ListBox1Click(Sender: TObject);
begin
Button2.Enabled:=true
end;

//列系统进程
procedure TForm1.Button1Click(Sender: TObject);
var
pProcessID :DWORD;
ContinueLoop : BOOL;
FSnapshotHandle : THandle;
FProcessEntry32 : TProcessEntry32;
pExeFile : string;
begin
Button2.Enabled:=false;
ListBox1.Clear;
FSnapshotHandle:=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);

FProcessEntry32.dwSize:=Sizeof(FProcessEntry32);
ContinueLoop:=Process32First(FSnapshotHandle,FProcessEntry32);
while ContinueLoop do begin
pExeFile := FProcessEntry32.szExeFile; //进程文件名
pProcessID := FProcessEntry32.th32ProcessID; //进程ID
ListBox1.Items.Append(inttostr(pProcessID)+' -> '+pExeFile);
ContinueLoop:=Process32Next(FSnapshotHandle,FProcessEntry32);
end;

CloseHandle(FSnapshotHandle);
end;

//前端窗口类名
procedure TForm1.Timer1Timer(Sender: TObject);
var
hActiv ,PID:HWnd;
buffer:array[0..255] of char;
classn:string;
begin
hActiv:=GetForegroundWindow;
GetWindowThreadProcessID(hActiv,@PID);
GetClassName(hActiv,buffer,sizeof(buffer));
classn:=buffer;
application.Title:=classn;
caption:='前端窗口ClassNmae='+classn+',Handle='+inttohex(hActiv,4)+',PID='+inttohex(PID,8);
end;


end.
 
amsea 能详细一些吗? :)
balangate: 正在看你介绍的网站
forgot2002: 我的意思是,我已经知道一个IE窗口的handle了,
比如就是你现在正在看的这个IE窗口,窗口的右边不是有滚动条
吗,我想得到这个滚动条的信息:当前位置,范围等. 再帮忙想想 :)
 
大家来看看吧 :) , 200分啊
 
有人能回答吗? 提个思路也可以
 
后退
顶部