unit Middleware;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, LCLIntf, Windows;
type
{ TFotoviewerMiddleware }
TFotoviewerMiddleware =
class(TForm)
Image1: TImage;
procedure FormCreate(Sender: TObject);
private
public
end;
var
FotoviewerMiddleware: TFotoviewerMiddleware;
implementation
{$R *.lfm}
{ TFotoviewerMiddleware }
procedure TFotoviewerMiddleware.FormCreate(Sender: TObject);
var
Filename : WideString;
begin
Application.ShowMainForm := false;
if ParamStr(1) <> '
'
then
begin
Image1.Picture.LoadFromFile(ParamStr(1));
Filename := Widestring(Extractfilename(ParamStr(1)));
Filename := Widestring(LeftStr(Filename, Length(Filename) - 3));
Filename := Widestring('
C:\temp\' + Filename + '
bmp');
Image1.Picture.SaveToFile(Filename);
OpenDocument(Filename);
ShellexecuteW(
Handle, '
open', PWideChar(Filename), PWideChar('
'),
nil, SW_MAXIMIZE);
end;
Application.Terminate;
end;
end.