GARANTIR DESCONTO

Fórum Historico IE #265108

12/01/2005

0

Alguem sabe como limpar o Historico do combobox od IE?


Kroki

Kroki

Responder

Posts

12/01/2005

Adriano Santos

Cara, eu tenho um exemplo prontinho que carrega e exclui itens do histório.

Me manda seu email que te repasso.


Responder

Gostei + 0

12/01/2005

Cyber

E ai beleza?

Posta ai seu exemplo para a galera, pois muita gente nao conhece .....
bom aqui vai minha contribuição...

esses componentes alguns tem exemplo e fazem isso que vc precisa, ja usei e aprovo:

link
http://www.euromind.com/iedelphi/index.htm


Responder

Gostei + 0

13/01/2005

Adriano Santos

Bom, eu fiz um prog completo pra isso. Adicionai 1 TListView e um TButton e um TEdit:

[color=red:14ab5e22f8]
No onCreate do form eu trouxe as urls visitadas:[/color:14ab5e22f8]

procedure TForm1.FormCreate(Sender: TObject); var I, Tam: Integer; C, V: string; N: TStringList; Lin: TListItem; Col: TListColumn; begin Col := Lv.Columns.Add; Col.Caption := ´Páginas visitadas´; Col.Width := 300; Registro := TRegIniFile.Create(´HKEY_CURRENT_USER´); Registro.OpenKey(´\Software\Microsoft\Internet Explorer´, False); Page := Registro.ReadString(´Main´, ´Start Page´, Page); N := TStringList.Create; Registro.ReadSection(´TypedURLs´, N); Edit1.Text := Page; for I := 0 to N.Count - 1 do begin C := N[I]; V := Registro.ReadString(´TypedURLs´, C, V); Lin := LV.Items.Add; Lin.Caption := V; end; if LV.Items.Count = 0 then begin Lin := LV.Items.Add; Lin.Caption := V; Lin.ImageIndex := 1; end; N.Free; Registro.Free; end;


[color=red:14ab5e22f8]
E no onDBClick do TCheckListBox eu coloquei o esquema para excluir:
[/color:14ab5e22f8]

procedure TForm1.LVDblClick(Sender: TObject); var I: Integer; C, V: string; N: TStringList; Lin: TListItem; Col: TListColumn; begin if Lv.ItemFocused.Caption ´Nenhuma url encontrada´ then begin if MessageDlg(´Deseja apagar do histórico a url abaixo ?´ + #13 + Lv.ItemFocused.Caption, mtConfirmation, [mbYes, mbNo], 0) = mrYes then begin Registro := TRegIniFile.Create(´HKEY_CURRENT_USER´); Registro.OpenKey(´\Software\Microsoft\Internet Explorer´, False); N := TStringList.Create; Registro.ReadSection(´TypedURLs´, N); for I := 0 to N.Count - 1 do begin C := N[I]; V := Registro.ReadString(´TypedURLs´, C, V); if Lv.ItemFocused.Caption ´Nenhuma url encontrada´ then if Lv.ItemFocused.Caption = V then Registro.DeleteKey(´TypedURLs´, C); end; N.Free; N := TStringList.Create; Registro.ReadSection(´TypedURLs´, N); LV.Columns.Clear; LV.Items.Clear; Col := Lv.Columns.Add; Col.Caption := ´Páginas visitas´; Col.Width := 300; for I := 0 to N.Count - 1 do begin C := N[I]; V := Registro.ReadString(´TypedURLs´, C, V); Lin := LV.Items.Add; Lin.Caption := V; end; if LV.Items.Count = 0 then begin Lin := LV.Items.Add; Lin.Caption := ´Nenhuma url encontrada´; Lin.ImageIndex := 1; end; N.Free; Registro.Free; end; end; end;


[color=red:14ab5e22f8]
E no TButton eu acionei um esquema para mudar a página padrão do IE:
[/color:14ab5e22f8]


Registro := TRegIniFile.Create(´HKEY_CURRENT_USER´); Registro.OpenKey(´\Software\Microsoft\Internet Explorer´, False); Page := Edit1.Text; Registro.WriteString(´Main´, ´Start Page´, Page); Registro.Free;



[color=blue:14ab5e22f8]
Como podem ver apenas trabalhei com o registro do windows, fica fácil assim. Quem quiser saber mais basta abrir o regedit e verificar a seguinte chave:
\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs
[/color:14ab5e22f8]

[color=green:14ab5e22f8]Ah, não esquecer de declarar a unit Registry no uses[/color:14ab5e22f8]

Até mais.


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar