Mega Code Archive

 
Categories / Delphi / Graphic
 

How to turning images on-off in internet explorer

unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls,Registry; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure ImageIE_On_Off(bDisplay : boolean); const DisplayInlineImages = 'Display Inline Images'; var sTmp : string; begin with TRegistry.Create do begin RootKey := HKEY_CURRENT_USER; OpenKey ('\Software\Microsoft\Internet Explorer\Main', True); if bDisplay then sTmp := 'yes' else sTmp := 'no'; WriteString (DisplayInlineImages, sTmp); Free; end { with TRegistry.Create }; end; procedure TForm1.Button1Click(Sender: TObject); begin ImageIE_On_Off(true); end; procedure TForm1.Button2Click(Sender: TObject); begin ImageIE_On_Off(false); end; end.