//ShAutoComplete确实有这个功能,看看下面的例子(窗口上只有一个Edit和一个Button)
//不过我只能在自己的浏览器中使用它,
//因为它的列表框的内容就是IE地址栏的列表框的内容,不知道怎样自定义其中的内容
//至于我的TComBoBoxIE,我在试试[
]
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, Forms,
Dialogs, StdCtrls, ActiveX;
const
SHACF_DEFAULT = $00000000;
SHACF_FILESYSTEM = $00000001;
SHACF_URLHISTORY = $00000002;
SHACF_URLMRU = $00000004;
SHACF_URLALL = SHACF_URLHISTORY or SHACF_URLMRU;
SHACF_USETAB = $00000008;
SHACF_FILESYS_ONLY = $00000010;
SHACF_AUTOSUGGEST_FORCE_ON= $10000000;
SHACF_AUTOSUGGEST_FORCE_OFF = $20000000;
SHACF_AUTOAPPEND_FORCE_ON = $40000000;
SHACF_AUTOAPPEND_FORCE_OFF= $80000000;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function SHAutoComplete(hWnd: HWND; dwFlags: DWORD): LRESULT; stdcall;
implementation
function SHAutoComplete; external 'shlwapi.dll' name 'SHAutoComplete';
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowMessage(Edit1.Text);
Edit1.Text := '';
end;
procedure TForm1.FormCreate(Sender: TObject);
var
ret: Integer;
begin
ret := SHAutoComplete(Edit1.Handle, SHACF_DEFAULT);
//ShowMessage(IntToStr(ret));//如果这里返回0,则表示调用SHAutoComplete成功了。
end;
initialization
Oleinitialize(nil);
finalization
OleUninitialize;
end.