unit pdf;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls,
ActiveX,FileCtrl, StdCtrls, OleCtrls, SHDocVw,IniFiles,jpeg ;
type
TForm1 =
class(TForm)
WebBrowser1: TWebBrowser;
Button1: TButton;
ComboBox1: TComboBox;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint;
var Handled: Boolean);
procedure FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint;
var Handled: Boolean);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
var1:
String;
Pfad:
string;
mask :
string;
text1:
string;
ini: TIniFile;
implementation
{$R *.dfm}
// ordner öffnen
procedure GetFileList(aMask :
string;aList : TStrings);
begin
aList.Clear;
with TFileListBox.CreateParented(HWND(-3))
do
begin
try
Mask := ExtractFileName(aMask);
Directory := ExtractFilePath(aMask);
FileType := [ftArchive];
aList.Assign(items);
finally
Free;
end
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ini := TIniFile.Create('
mmmpdf.ini');
// INI-Datei und initialisieren
try
var1 := ini.ReadString('
Sektion1', '
pfad', '
c:\');
ini.UpdateFile;
finally
ini.Free
// Variable ini wieder freigeben
end;
GetFileList(var1 + '
*.pdf',ComboBox1.Items);
image1.picture.loadfromfile(ExtractFilePath(ParamStr( 0 )) + '
logo.jpg');
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Param: OleVariant;
begin
text1 :=
string(ComboBox1.Items[ComboBox1.ItemIndex]);
WebBrowser1.Navigate((var1 + text1), Param, Param, Param, Param);
end;
procedure TForm1.FormMouseWheelUp(Sender: TObject; Shift: TShiftState;
MousePos: TPoint;
var Handled: Boolean);
begin
VertScrollBar.Position := VertScrollBar.Position - 10;
end;
procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint;
var Handled: Boolean);
begin
VertScrollBar.Position := VertScrollBar.Position + 10;
end;
end.