Einzelnen Beitrag anzeigen

DRPEnc

Registriert seit: 20. Feb 2004
Ort: Noch unterm Mond
126 Beiträge
 
#8

Re: Übergabestring bearbeiten.

  Alt 16. Mai 2004, 16:56
Dani kannst Du mir sagen welche Projectart du für deinen Code benutzt hast

Es hängt nun nur noch am string. Ich habs mal in eine Oberfläche eingebaut um zu sehen ob der Code funzt.
Hier mal der Code von mir:

Delphi-Quellcode:
unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ShellApi, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    OpenDialog1: TOpenDialog;
    Edit1: TEdit;
    Edit2: TEdit;
    GroupBox1: TGroupBox;
    ComboBox1: TComboBox;
    Edit3: TEdit;
    procedure Button1Click(Sender: TObject);


  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
function TrimAtDoubleAt(s: String): String;
var iPos: Integer;
begin
Result := s;
iPos := pos('@@', s);
If iPos>0 then
  Result := copy(s, 1, iPos-1);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin

if not OpenDialog1.execute then exit;
Edit1.text:=Opendialog1.filename;
Edit2.text:=TrimAtDoubleAt( Edit1.text );
if combobox1.itemindex=0 then Edit3.text:='notepad.exe';
if combobox1.itemindex=1 then Edit3.text:='wordpad.exe';
shellexecute (0, Nil, PChar(edit3.text), PChar(edit1.text), Nil, SW_NORMAL);
end;

end.
Nun müsste das Programm aber auch bei Sendto laufen, oder wenn ich eine Datei auf das Programm ziehe.
CU

DRPEnc
  Mit Zitat antworten Zitat